@mapbox/mcp-server 0.8.2 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/dist/commonjs/index.js +79 -5
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/prompts/SearchAlongRoutePrompt.d.ts +26 -0
- package/dist/commonjs/prompts/SearchAlongRoutePrompt.d.ts.map +1 -0
- package/dist/commonjs/prompts/SearchAlongRoutePrompt.js +164 -0
- package/dist/commonjs/prompts/SearchAlongRoutePrompt.js.map +1 -0
- package/dist/commonjs/prompts/promptRegistry.d.ts +2 -1
- package/dist/commonjs/prompts/promptRegistry.d.ts.map +1 -1
- package/dist/commonjs/prompts/promptRegistry.js +2 -0
- package/dist/commonjs/prompts/promptRegistry.js.map +1 -1
- package/dist/commonjs/tools/toolRegistry.d.ts +51 -1
- package/dist/commonjs/tools/toolRegistry.d.ts.map +1 -1
- package/dist/commonjs/tools/toolRegistry.js +68 -5
- package/dist/commonjs/tools/toolRegistry.js.map +1 -1
- package/dist/commonjs/version.json +3 -3
- package/dist/esm/index.js +80 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/prompts/SearchAlongRoutePrompt.d.ts +26 -0
- package/dist/esm/prompts/SearchAlongRoutePrompt.d.ts.map +1 -0
- package/dist/esm/prompts/SearchAlongRoutePrompt.js +160 -0
- package/dist/esm/prompts/SearchAlongRoutePrompt.js.map +1 -0
- package/dist/esm/prompts/promptRegistry.d.ts +2 -1
- package/dist/esm/prompts/promptRegistry.d.ts.map +1 -1
- package/dist/esm/prompts/promptRegistry.js +2 -0
- package/dist/esm/prompts/promptRegistry.js.map +1 -1
- package/dist/esm/tools/toolRegistry.d.ts +51 -1
- package/dist/esm/tools/toolRegistry.d.ts.map +1 -1
- package/dist/esm/tools/toolRegistry.js +64 -4
- package/dist/esm/tools/toolRegistry.js.map +1 -1
- package/dist/esm/version.json +3 -3
- package/package.json +2 -2
- /package/patches/{@modelcontextprotocol+sdk+1.25.2.patch → @modelcontextprotocol+sdk+1.25.3.patch} +0 -0
package/README.md
CHANGED
|
@@ -59,6 +59,7 @@ Try these prompts with Claude Desktop or other MCP clients after setup:
|
|
|
59
59
|
### Location Discovery
|
|
60
60
|
|
|
61
61
|
- "Find coffee shops within walking distance of the Empire State Building"
|
|
62
|
+
- "I want to go from Seattle to Portland, is there a Starbucks along the way?"
|
|
62
63
|
- "Show me gas stations along the route from Boston to New York"
|
|
63
64
|
- "What restaurants are near Times Square?"
|
|
64
65
|
|
|
@@ -106,6 +107,8 @@ Try these prompts with Claude Desktop or other MCP clients after setup:
|
|
|
106
107
|
- Include time constraints when relevant ("during rush hour", "at 3 PM")
|
|
107
108
|
- Ask for specific output formats when needed ("as a map image", "in JSON format")
|
|
108
109
|
|
|
110
|
+
> **Detailed examples:** See [examples/search-along-route.md](./examples/search-along-route.md) for comprehensive examples of the search-along-route prompt with different use cases and MCP Inspector testing instructions.
|
|
111
|
+
|
|
109
112
|
## Resources
|
|
110
113
|
|
|
111
114
|
The MCP server exposes static reference data as **MCP resources**. Resources provide read-only access to data that clients can reference directly without making tool calls.
|
|
@@ -181,6 +184,29 @@ node dist/esm/index.js --disable-mcp-ui
|
|
|
181
184
|
|
|
182
185
|
**For more detailed information**, including compatible clients, technical implementation details, and troubleshooting, see the [MCP-UI documentation](./docs/mcp-ui.md).
|
|
183
186
|
|
|
187
|
+
#### CLIENT_NEEDS_RESOURCE_FALLBACK
|
|
188
|
+
|
|
189
|
+
**Resource Fallback Tools (Opt-In for Non-Compliant Clients)**
|
|
190
|
+
|
|
191
|
+
Resources are a core MCP feature supported by most clients (Claude Desktop, VS Code, MCP Inspector, etc.). However, some clients (like smolagents) don't support resources at all. For these clients, the server can provide "resource fallback tools" that deliver the same content as resources but via tool calls.
|
|
192
|
+
|
|
193
|
+
**Fallback Tools:**
|
|
194
|
+
|
|
195
|
+
- `resource_reader_tool` - Generic fallback for reading any resource by URI
|
|
196
|
+
- `category_list_tool` - Provides access to category list (mapbox://categories)
|
|
197
|
+
|
|
198
|
+
**By default, these tools are NOT included** (assumes your client supports resources). If your client doesn't support resources, enable the fallback tools:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
export CLIENT_NEEDS_RESOURCE_FALLBACK=true
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
**When to set this:**
|
|
205
|
+
|
|
206
|
+
- ✅ Set to `true` if using smolagents or other clients without resource support
|
|
207
|
+
- ❌ Leave unset (default) if using Claude Desktop, VS Code, MCP Inspector, or any resource-capable client
|
|
208
|
+
- ❌ Leave unset if unsure (most clients support resources)
|
|
209
|
+
|
|
184
210
|
## Tools
|
|
185
211
|
|
|
186
212
|
### Utility Tools
|
package/dist/commonjs/index.js
CHANGED
|
@@ -44,8 +44,13 @@ const versionInfo = (0, versionUtils_js_1.getVersionInfo)();
|
|
|
44
44
|
// Parse configuration from command-line arguments
|
|
45
45
|
const config = (0, toolConfig_js_1.parseToolConfigFromArgs)();
|
|
46
46
|
// Get and filter tools based on configuration
|
|
47
|
-
|
|
48
|
-
const
|
|
47
|
+
// Split into categories for capability-aware registration
|
|
48
|
+
const coreTools = (0, toolRegistry_js_1.getCoreTools)();
|
|
49
|
+
const elicitationTools = (0, toolRegistry_js_1.getElicitationTools)();
|
|
50
|
+
const resourceFallbackTools = (0, toolRegistry_js_1.getResourceFallbackTools)();
|
|
51
|
+
const enabledCoreTools = (0, toolConfig_js_1.filterTools)(coreTools, config);
|
|
52
|
+
const enabledElicitationTools = (0, toolConfig_js_1.filterTools)(elicitationTools, config);
|
|
53
|
+
const enabledResourceFallbackTools = (0, toolConfig_js_1.filterTools)(resourceFallbackTools, config);
|
|
49
54
|
// Get all resources
|
|
50
55
|
const allResources = (0, resourceRegistry_js_1.getAllResources)();
|
|
51
56
|
// Create an MCP server
|
|
@@ -68,13 +73,16 @@ const server = new mcp_js_1.McpServer({
|
|
|
68
73
|
]
|
|
69
74
|
}, {
|
|
70
75
|
capabilities: {
|
|
71
|
-
tools: {
|
|
76
|
+
tools: {
|
|
77
|
+
listChanged: true // Advertise support for dynamic tool registration (ready for future capability-dependent tools)
|
|
78
|
+
},
|
|
72
79
|
resources: {},
|
|
73
80
|
prompts: {}
|
|
74
81
|
}
|
|
75
82
|
});
|
|
76
|
-
// Register
|
|
77
|
-
|
|
83
|
+
// Register only core tools before connection
|
|
84
|
+
// Capability-dependent tools will be registered dynamically after connection
|
|
85
|
+
enabledCoreTools.forEach((tool) => {
|
|
78
86
|
tool.installTo(server);
|
|
79
87
|
});
|
|
80
88
|
// Register all resources to the server
|
|
@@ -204,6 +212,72 @@ async function main() {
|
|
|
204
212
|
// Start receiving messages on stdin and sending messages on stdout
|
|
205
213
|
const transport = new stdio_js_1.StdioServerTransport();
|
|
206
214
|
await server.connect(transport);
|
|
215
|
+
// After connection, dynamically register capability-dependent tools
|
|
216
|
+
const clientCapabilities = server.server.getClientCapabilities();
|
|
217
|
+
// Debug: Log what capabilities we detected
|
|
218
|
+
server.server.sendLoggingMessage({
|
|
219
|
+
level: 'info',
|
|
220
|
+
data: `Client capabilities detected: ${JSON.stringify(clientCapabilities, null, 2)}`
|
|
221
|
+
});
|
|
222
|
+
let toolsAdded = false;
|
|
223
|
+
// Register elicitation tools if client supports elicitation
|
|
224
|
+
if (clientCapabilities?.elicitation && enabledElicitationTools.length > 0) {
|
|
225
|
+
server.server.sendLoggingMessage({
|
|
226
|
+
level: 'info',
|
|
227
|
+
data: `Client supports elicitation. Registering ${enabledElicitationTools.length} elicitation-dependent tools`
|
|
228
|
+
});
|
|
229
|
+
enabledElicitationTools.forEach((tool) => {
|
|
230
|
+
tool.installTo(server);
|
|
231
|
+
});
|
|
232
|
+
toolsAdded = true;
|
|
233
|
+
}
|
|
234
|
+
else if (enabledElicitationTools.length > 0) {
|
|
235
|
+
server.server.sendLoggingMessage({
|
|
236
|
+
level: 'debug',
|
|
237
|
+
data: `Client does not support elicitation. Skipping ${enabledElicitationTools.length} elicitation-dependent tools`
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
// Register resource fallback tools for clients that don't support resources
|
|
241
|
+
// Note: Resources are a core MCP feature supported by most clients.
|
|
242
|
+
// However, some clients (like smolagents) don't support resources at all.
|
|
243
|
+
// These fallback tools provide the same content as resources but via tool calls instead.
|
|
244
|
+
//
|
|
245
|
+
// Configuration via CLIENT_NEEDS_RESOURCE_FALLBACK environment variable:
|
|
246
|
+
// - unset (default) = Skip fallback tools (assume client supports resources)
|
|
247
|
+
// - "true" = Provide fallback tools (client does NOT support resources)
|
|
248
|
+
const clientNeedsResourceFallback = process.env.CLIENT_NEEDS_RESOURCE_FALLBACK?.toLowerCase() === 'true';
|
|
249
|
+
if (clientNeedsResourceFallback && enabledResourceFallbackTools.length > 0) {
|
|
250
|
+
server.server.sendLoggingMessage({
|
|
251
|
+
level: 'info',
|
|
252
|
+
data: `CLIENT_NEEDS_RESOURCE_FALLBACK=true. Registering ${enabledResourceFallbackTools.length} resource fallback tools`
|
|
253
|
+
});
|
|
254
|
+
enabledResourceFallbackTools.forEach((tool) => {
|
|
255
|
+
tool.installTo(server);
|
|
256
|
+
});
|
|
257
|
+
toolsAdded = true;
|
|
258
|
+
}
|
|
259
|
+
else if (enabledResourceFallbackTools.length > 0) {
|
|
260
|
+
server.server.sendLoggingMessage({
|
|
261
|
+
level: 'debug',
|
|
262
|
+
data: `CLIENT_NEEDS_RESOURCE_FALLBACK not set or false. Skipping ${enabledResourceFallbackTools.length} resource fallback tools (client supports resources)`
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
// Notify client about tool list changes if any tools were added
|
|
266
|
+
if (toolsAdded) {
|
|
267
|
+
try {
|
|
268
|
+
server.sendToolListChanged();
|
|
269
|
+
server.server.sendLoggingMessage({
|
|
270
|
+
level: 'debug',
|
|
271
|
+
data: 'Sent notifications/tools/list_changed to client'
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
catch (error) {
|
|
275
|
+
server.server.sendLoggingMessage({
|
|
276
|
+
level: 'warning',
|
|
277
|
+
data: `Failed to send tool list change notification: ${error instanceof Error ? error.message : String(error)}`
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
}
|
|
207
281
|
}
|
|
208
282
|
// Ensure cleanup interval is cleared when the process exits
|
|
209
283
|
async function shutdown() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,kCAAkC;;AAElC,uDAAuD;AACvD,oFAAoF;AACpF,yCAAqC;AACrC,qCAAuC;AACvC,yCAAiC;AACjC,qCAAqC;AACrC,4CAAoD;AAEpD,oEAAoE;AACpE,wEAAiF;AACjF,iEAG4C;AAC5C,0DAA8E;AAC9E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,kCAAkC;;AAElC,uDAAuD;AACvD,oFAAoF;AACpF,yCAAqC;AACrC,qCAAuC;AACvC,yCAAiC;AACjC,qCAAqC;AACrC,4CAAoD;AAEpD,oEAAoE;AACpE,wEAAiF;AACjF,iEAG4C;AAC5C,0DAA8E;AAC9E,6DAIiC;AACjC,yEAAkE;AAClE,mEAA6E;AAC7E,6DAAyD;AACzD,mDAK4B;AAE5B,uEAAuE;AACvE,yFAAyF;AACzF,MAAM,OAAO,GAAG,IAAA,gBAAI,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;AAC5C,IAAI,YAAY,GAAiB,IAAI,CAAC;AACtC,IAAI,cAAc,GAAG,CAAC,CAAC;AAEvB,IAAI,IAAA,oBAAU,EAAC,OAAO,CAAC,EAAE,CAAC;IACxB,IAAI,CAAC;QACH,2DAA2D;QAC3D,MAAM,OAAO,GAAG,IAAA,sBAAY,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC/C,MAAM,MAAM,GAAG,IAAA,oBAAQ,EAAC,O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AC;YACT,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,GAAG,EAAE,EAAE,CACtC,WAAW,CAAC,qBAAqB,EAAE,GAAG,CAAC,CACxC,CAAC;AACF,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,MAAM,EAAE,EAAE,CAC1C,WAAW,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAC5C,CAAC;AAEF,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BasePrompt } from './BasePrompt.js';
|
|
2
|
+
import type { PromptArgument, PromptMessage } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Prompt for finding places along a route between two locations.
|
|
5
|
+
*
|
|
6
|
+
* This prompt guides the agent through:
|
|
7
|
+
* 1. Geocoding start and end locations (if needed)
|
|
8
|
+
* 2. Getting the route geometry
|
|
9
|
+
* 3. Creating a buffer corridor around the route
|
|
10
|
+
* 4. Searching for places within that corridor
|
|
11
|
+
* 5. Filtering and ordering results by distance from route
|
|
12
|
+
* 6. Visualizing on a map
|
|
13
|
+
*
|
|
14
|
+
* Example queries:
|
|
15
|
+
* - "I want to go from Seattle to Portland, is there a Starbucks along the way?"
|
|
16
|
+
* - "Find gas stations along my route from LA to San Francisco"
|
|
17
|
+
* - "Show me rest stops between Denver and Salt Lake City"
|
|
18
|
+
* - "What restaurants are along the drive from Boston to NYC?"
|
|
19
|
+
*/
|
|
20
|
+
export declare class SearchAlongRoutePrompt extends BasePrompt {
|
|
21
|
+
readonly name = "search-along-route";
|
|
22
|
+
readonly description = "Finds specific types of places along a route between two locations, using buffer analysis and POI search";
|
|
23
|
+
readonly arguments: PromptArgument[];
|
|
24
|
+
getMessages(args: Record<string, string>): PromptMessage[];
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=SearchAlongRoutePrompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchAlongRoutePrompt.d.ts","sourceRoot":"","sources":["../../../src/prompts/SearchAlongRoutePrompt.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACd,MAAM,oCAAoC,CAAC;AAE5C;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,sBAAuB,SAAQ,UAAU;IACpD,QAAQ,CAAC,IAAI,wBAAwB;IACrC,QAAQ,CAAC,WAAW,8GACyF;IAE7G,QAAQ,CAAC,SAAS,EAAE,cAAc,EAAE,CA6BlC;IAEF,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,aAAa,EAAE;CAkH3D"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Mapbox, Inc.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.SearchAlongRoutePrompt = void 0;
|
|
6
|
+
const BasePrompt_js_1 = require("./BasePrompt.js");
|
|
7
|
+
/**
|
|
8
|
+
* Prompt for finding places along a route between two locations.
|
|
9
|
+
*
|
|
10
|
+
* This prompt guides the agent through:
|
|
11
|
+
* 1. Geocoding start and end locations (if needed)
|
|
12
|
+
* 2. Getting the route geometry
|
|
13
|
+
* 3. Creating a buffer corridor around the route
|
|
14
|
+
* 4. Searching for places within that corridor
|
|
15
|
+
* 5. Filtering and ordering results by distance from route
|
|
16
|
+
* 6. Visualizing on a map
|
|
17
|
+
*
|
|
18
|
+
* Example queries:
|
|
19
|
+
* - "I want to go from Seattle to Portland, is there a Starbucks along the way?"
|
|
20
|
+
* - "Find gas stations along my route from LA to San Francisco"
|
|
21
|
+
* - "Show me rest stops between Denver and Salt Lake City"
|
|
22
|
+
* - "What restaurants are along the drive from Boston to NYC?"
|
|
23
|
+
*/
|
|
24
|
+
class SearchAlongRoutePrompt extends BasePrompt_js_1.BasePrompt {
|
|
25
|
+
name = 'search-along-route';
|
|
26
|
+
description = 'Finds specific types of places along a route between two locations, using buffer analysis and POI search';
|
|
27
|
+
arguments = [
|
|
28
|
+
{
|
|
29
|
+
name: 'from',
|
|
30
|
+
description: 'Starting location (address, place name, or coordinates)',
|
|
31
|
+
required: true
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'to',
|
|
35
|
+
description: 'Destination location (address, place name, or coordinates)',
|
|
36
|
+
required: true
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'search_for',
|
|
40
|
+
description: 'Type of place to search for (e.g., "Starbucks", "gas stations", "rest stops", "restaurants")',
|
|
41
|
+
required: true
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'mode',
|
|
45
|
+
description: 'Travel mode: driving, walking, or cycling (default: driving)',
|
|
46
|
+
required: false
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'buffer_meters',
|
|
50
|
+
description: 'Search corridor width on each side of route in meters (default: 1000)',
|
|
51
|
+
required: false
|
|
52
|
+
}
|
|
53
|
+
];
|
|
54
|
+
getMessages(args) {
|
|
55
|
+
this.validateArguments(args);
|
|
56
|
+
const { from, to, search_for, mode = 'driving'
|
|
57
|
+
// buffer_meters parameter is kept for API compatibility but not used
|
|
58
|
+
// in the simplified proximity-sampling approach
|
|
59
|
+
} = args;
|
|
60
|
+
return [
|
|
61
|
+
{
|
|
62
|
+
role: 'user',
|
|
63
|
+
content: {
|
|
64
|
+
type: 'text',
|
|
65
|
+
text: `Find ${search_for} along the ${mode} route from ${from} to ${to}.
|
|
66
|
+
|
|
67
|
+
Please follow these steps:
|
|
68
|
+
|
|
69
|
+
1. **Geocode locations** (if needed):
|
|
70
|
+
- Use search_and_geocode_tool to convert ${from} and ${to} to coordinates if they're not already in coordinate format
|
|
71
|
+
|
|
72
|
+
2. **Get the route**:
|
|
73
|
+
- Use directions_tool with profile=${mode} to get the route geometry between the two points
|
|
74
|
+
- Extract the route LineString coordinates from the response (it will be an array of [lon, lat] pairs)
|
|
75
|
+
- Note the total route distance
|
|
76
|
+
|
|
77
|
+
3. **Search along the route using point sampling** (works for all route lengths):
|
|
78
|
+
|
|
79
|
+
**Determine sample strategy based on route length:**
|
|
80
|
+
- SHORT routes (< 50km): Sample every 5-10 points along the route (more samples for better coverage)
|
|
81
|
+
- MEDIUM routes (50-150km): Sample every 15-20 points along the route
|
|
82
|
+
- VERY LONG routes (> 150km): Sample 5-7 evenly spaced points (start, end, and middle points)
|
|
83
|
+
|
|
84
|
+
**For each sample point:**
|
|
85
|
+
- Extract the coordinate [lon, lat] from the route
|
|
86
|
+
- Choose the appropriate search tool:
|
|
87
|
+
* If "${search_for}" is a specific place/brand (e.g., "Starbucks", "McDonald's", "Whole Foods"):
|
|
88
|
+
Use search_and_geocode_tool with proximity="lon,lat" and q="${search_for}"
|
|
89
|
+
* If "${search_for}" is a category (e.g., "coffee shops", "gas stations", "restaurants"):
|
|
90
|
+
Use category_search_tool with types="${search_for}" and proximity="lon,lat"
|
|
91
|
+
- Limit results per point (10-20 for short routes, 5-10 for long routes)
|
|
92
|
+
|
|
93
|
+
**IMPORTANT - Execute searches in parallel:**
|
|
94
|
+
- All sample point searches are INDEPENDENT and can run concurrently
|
|
95
|
+
- Make ALL search tool calls in a single message (parallel execution)
|
|
96
|
+
- Example: If you have 5 sample points, make 5 search_and_geocode_tool calls in one turn
|
|
97
|
+
- This dramatically speeds up the workflow vs sequential searches
|
|
98
|
+
|
|
99
|
+
**Combine and deduplicate:**
|
|
100
|
+
- Collect all results from sample points
|
|
101
|
+
- Remove duplicates (same place found from multiple sample points)
|
|
102
|
+
- Calculate distances from start point using distance_tool:
|
|
103
|
+
* These calculations are INDEPENDENT and can run in parallel
|
|
104
|
+
* Make ALL distance_tool calls in a single message for all results
|
|
105
|
+
* Example: If you have 10 unique results, make 10 distance_tool calls in one turn
|
|
106
|
+
- Order results by distance from start (approximate route progress)
|
|
107
|
+
|
|
108
|
+
**Why this approach works:**
|
|
109
|
+
- Simple and reliable - just directions + proximity searches
|
|
110
|
+
- No buffer/bbox/polygon complexity
|
|
111
|
+
- Works consistently for all route lengths
|
|
112
|
+
- Fast execution, no token issues
|
|
113
|
+
- Covers the route corridor naturally through proximity searches
|
|
114
|
+
|
|
115
|
+
4. **Present results**:
|
|
116
|
+
- Results are already ordered by distance from start
|
|
117
|
+
- Limit to top 15 results if many were found
|
|
118
|
+
- Note: Results are biased to the route corridor through proximity searches at sample points
|
|
119
|
+
|
|
120
|
+
5. **Present results**:
|
|
121
|
+
|
|
122
|
+
**Skip map generation by default** (static_map_image_tool encoding is slow):
|
|
123
|
+
- Note to user: "Map visualization can be generated separately if needed"
|
|
124
|
+
- The client (Claude Desktop, etc.) may have its own map display capabilities
|
|
125
|
+
- Focus on providing excellent text results instead
|
|
126
|
+
|
|
127
|
+
**Results list (always provide):**
|
|
128
|
+
- Summary: "Found X results along the route from ${from} to ${to}"
|
|
129
|
+
- Route details: Total distance and estimated travel time
|
|
130
|
+
- For each result:
|
|
131
|
+
* Name and address
|
|
132
|
+
* Approximate distance from start (e.g., "45 miles into your trip")
|
|
133
|
+
* Coordinates (so user could map them separately if desired)
|
|
134
|
+
- Total results found
|
|
135
|
+
- Note which sampling strategy was used
|
|
136
|
+
|
|
137
|
+
**If user explicitly asks for a map:**
|
|
138
|
+
- Only then use static_map_image_tool with route and top 8-10 results
|
|
139
|
+
- Warn that encoding may take time for longer routes
|
|
140
|
+
|
|
141
|
+
6. **Additional context**:
|
|
142
|
+
- Mention the total route distance and estimated travel time
|
|
143
|
+
- Note which sampling strategy was used:
|
|
144
|
+
* Short route: "Searched every 5-10 points along the route for comprehensive coverage"
|
|
145
|
+
* Medium route: "Sampled key points along the route"
|
|
146
|
+
* Very long route: "Sampled major points along the route"
|
|
147
|
+
- If no results were found, suggest trying a different search term or checking a specific segment
|
|
148
|
+
- If many results (>15), show top 15 and mention there are more
|
|
149
|
+
|
|
150
|
+
**Important notes:**
|
|
151
|
+
- This approach uses simple proximity searches at sampled route points
|
|
152
|
+
- No buffer/bbox/polygon operations needed - much more reliable
|
|
153
|
+
- Works consistently for all route lengths
|
|
154
|
+
- Fast and avoids token/timeout issues
|
|
155
|
+
- Results naturally cover the route corridor through proximity biasing
|
|
156
|
+
|
|
157
|
+
Make the output clear, actionable, and well-formatted.`
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
];
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
exports.SearchAlongRoutePrompt = SearchAlongRoutePrompt;
|
|
164
|
+
//# sourceMappingURL=SearchAlongRoutePrompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchAlongRoutePrompt.js","sourceRoot":"","sources":["../../../src/prompts/SearchAlongRoutePrompt.ts"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,kCAAkC;;;AAElC,mDAA6C;AAM7C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAa,sBAAuB,SAAQ,0BAAU;IAC3C,IAAI,GAAG,oBAAoB,CAAC;IAC5B,WAAW,GAClB,0GAA0G,CAAC;IAEpG,SAAS,GAAqB;QACrC;YACE,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,yDAAyD;YACtE,QAAQ,EAAE,IAAI;SACf;QACD;YACE,IAAI,EAAE,IAAI;YACV,WAAW,EAAE,4DAA4D;YACzE,QAAQ,EAAE,IAAI;SACf;QACD;YACE,IAAI,EAAE,YAAY;YAClB,WAAW,EACT,8FAA8F;YAChG,QAAQ,EAAE,IAAI;SACf;QACD;YACE,IAAI,EAAE,MAAM;YACZ,WAAW,EACT,8DAA8D;YAChE,QAAQ,EAAE,KAAK;SAChB;QACD;YACE,IAAI,EAAE,eAAe;YACrB,WAAW,EACT,uEAAuE;YACzE,QAAQ,EAAE,KAAK;SAChB;KACF,CAAC;IAEF,WAAW,CAAC,IAA4B;QACtC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAE7B,MAAM,EACJ,IAAI,EACJ,EAAE,EACF,UAAU,EACV,IAAI,GAAG,SAAS;QAChB,qEAAqE;QACrE,gDAAgD;UACjD,GAAG,IAAI,CAAC;QAET,OAAO;YACL;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,QAAQ,UAAU,cAAc,IAAI,eAAe,IAAI,OAAO,EAAE;;;;;8CAKlC,IAAI,QAAQ,EAAE;;;wCAGpB,IAAI;;;;;;;;;;;;;;aAc/B,UAAU;qEAC8C,UAAU;aAClE,UAAU;8CACuB,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sDAsCF,IAAI,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDA6BZ;iBAC9C;aACF;SACF,CAAC;IACJ,CAAC;CACF;AAtJD,wDAsJC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FindPlacesNearbyPrompt } from './FindPlacesNearbyPrompt.js';
|
|
2
2
|
import { GetDirectionsPrompt } from './GetDirectionsPrompt.js';
|
|
3
|
+
import { SearchAlongRoutePrompt } from './SearchAlongRoutePrompt.js';
|
|
3
4
|
import { ShowReachableAreasPrompt } from './ShowReachableAreasPrompt.js';
|
|
4
5
|
/**
|
|
5
6
|
* Central registry of all available prompts.
|
|
@@ -7,7 +8,7 @@ import { ShowReachableAreasPrompt } from './ShowReachableAreasPrompt.js';
|
|
|
7
8
|
* This module maintains a readonly collection of prompt instances and provides
|
|
8
9
|
* type-safe access methods.
|
|
9
10
|
*/
|
|
10
|
-
declare const ALL_PROMPTS: readonly [FindPlacesNearbyPrompt, GetDirectionsPrompt, ShowReachableAreasPrompt];
|
|
11
|
+
declare const ALL_PROMPTS: readonly [FindPlacesNearbyPrompt, GetDirectionsPrompt, SearchAlongRoutePrompt, ShowReachableAreasPrompt];
|
|
11
12
|
/**
|
|
12
13
|
* Type representing any prompt instance
|
|
13
14
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promptRegistry.d.ts","sourceRoot":"","sources":["../../../src/prompts/promptRegistry.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE;;;;;GAKG;AAGH,QAAA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"promptRegistry.d.ts","sourceRoot":"","sources":["../../../src/prompts/promptRegistry.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE;;;;;GAKG;AAGH,QAAA,MAAM,WAAW,0GAKP,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,SAAS,cAAc,EAAE,CAEzD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAExE"}
|
|
@@ -6,6 +6,7 @@ exports.getAllPrompts = getAllPrompts;
|
|
|
6
6
|
exports.getPromptByName = getPromptByName;
|
|
7
7
|
const FindPlacesNearbyPrompt_js_1 = require("./FindPlacesNearbyPrompt.js");
|
|
8
8
|
const GetDirectionsPrompt_js_1 = require("./GetDirectionsPrompt.js");
|
|
9
|
+
const SearchAlongRoutePrompt_js_1 = require("./SearchAlongRoutePrompt.js");
|
|
9
10
|
const ShowReachableAreasPrompt_js_1 = require("./ShowReachableAreasPrompt.js");
|
|
10
11
|
/**
|
|
11
12
|
* Central registry of all available prompts.
|
|
@@ -17,6 +18,7 @@ const ShowReachableAreasPrompt_js_1 = require("./ShowReachableAreasPrompt.js");
|
|
|
17
18
|
const ALL_PROMPTS = [
|
|
18
19
|
new FindPlacesNearbyPrompt_js_1.FindPlacesNearbyPrompt(),
|
|
19
20
|
new GetDirectionsPrompt_js_1.GetDirectionsPrompt(),
|
|
21
|
+
new SearchAlongRoutePrompt_js_1.SearchAlongRoutePrompt(),
|
|
20
22
|
new ShowReachableAreasPrompt_js_1.ShowReachableAreasPrompt()
|
|
21
23
|
];
|
|
22
24
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promptRegistry.js","sourceRoot":"","sources":["../../../src/prompts/promptRegistry.ts"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,kCAAkC;;
|
|
1
|
+
{"version":3,"file":"promptRegistry.js","sourceRoot":"","sources":["../../../src/prompts/promptRegistry.ts"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,kCAAkC;;AAgClC,sCAEC;AAQD,0CAEC;AA1CD,2EAAqE;AACrE,qEAA+D;AAC/D,2EAAqE;AACrE,+EAAyE;AAEzE;;;;;GAKG;AAEH,0BAA0B;AAC1B,MAAM,WAAW,GAAG;IAClB,IAAI,kDAAsB,EAAE;IAC5B,IAAI,4CAAmB,EAAE;IACzB,IAAI,kDAAsB,EAAE;IAC5B,IAAI,sDAAwB,EAAE;CACtB,CAAC;AAOX;;;;GAIG;AACH,SAAgB,aAAa;IAC3B,OAAO,WAAW,CAAC;AACrB,CAAC;AAED;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,IAAY;IAC1C,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -19,8 +19,58 @@ import { ReverseGeocodeTool } from './reverse-geocode-tool/ReverseGeocodeTool.js
|
|
|
19
19
|
import { StaticMapImageTool } from './static-map-image-tool/StaticMapImageTool.js';
|
|
20
20
|
import { SearchAndGeocodeTool } from './search-and-geocode-tool/SearchAndGeocodeTool.js';
|
|
21
21
|
import { VersionTool } from './version-tool/VersionTool.js';
|
|
22
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Core tools that work in all MCP clients without requiring special capabilities
|
|
24
|
+
* These tools are registered immediately during server startup
|
|
25
|
+
*/
|
|
26
|
+
export declare const CORE_TOOLS: readonly [SimplifyTool, BoundingBoxTool, CentroidTool, MidpointTool, BearingTool, AreaTool, BufferTool, PointInPolygonTool, DistanceTool, VersionTool, CategorySearchTool, DirectionsTool, IsochroneTool, MapMatchingTool, MatrixTool, OptimizationTool, ReverseGeocodeTool, StaticMapImageTool, SearchAndGeocodeTool];
|
|
27
|
+
/**
|
|
28
|
+
* Tools that require elicitation capability for optimal functionality
|
|
29
|
+
* These tools use elicitInput() for secure token management
|
|
30
|
+
* Registered only if client supports elicitation
|
|
31
|
+
*
|
|
32
|
+
* Currently empty - elicitation support will be added in a future PR.
|
|
33
|
+
* This category is ready for tools that require the elicitation capability.
|
|
34
|
+
*/
|
|
35
|
+
export declare const ELICITATION_TOOLS: readonly [];
|
|
36
|
+
/**
|
|
37
|
+
* Tools that serve as bridges for clients without resource support
|
|
38
|
+
* These tools are only registered if CLIENT_NEEDS_RESOURCE_FALLBACK env var is set to "true"
|
|
39
|
+
*
|
|
40
|
+
* Context: Most MCP clients support resources (Claude Desktop, VS Code, Inspector, etc.).
|
|
41
|
+
* However, some clients (like smolagents) don't support resources at all.
|
|
42
|
+
* These tools provide the same content as resources but via tool calls instead.
|
|
43
|
+
*
|
|
44
|
+
* Configuration:
|
|
45
|
+
* - Leave unset (default) = Skip these tools (assumes client supports resources)
|
|
46
|
+
* - Set CLIENT_NEEDS_RESOURCE_FALLBACK=true = Include these tools (for smolagents, etc.)
|
|
47
|
+
*
|
|
48
|
+
* Tools:
|
|
49
|
+
* - ResourceReaderTool: Generic fallback for reading any resource by URI
|
|
50
|
+
* - CategoryListTool: Provides access to category list (mapbox://categories)
|
|
51
|
+
*/
|
|
52
|
+
export declare const RESOURCE_FALLBACK_TOOLS: readonly [ResourceReaderTool, CategoryListTool];
|
|
53
|
+
/**
|
|
54
|
+
* All tools combined (for backward compatibility and testing)
|
|
55
|
+
*/
|
|
56
|
+
export declare const ALL_TOOLS: readonly [SimplifyTool, BoundingBoxTool, CentroidTool, MidpointTool, BearingTool, AreaTool, BufferTool, PointInPolygonTool, DistanceTool, VersionTool, CategorySearchTool, DirectionsTool, IsochroneTool, MapMatchingTool, MatrixTool, OptimizationTool, ReverseGeocodeTool, StaticMapImageTool, SearchAndGeocodeTool, ResourceReaderTool, CategoryListTool];
|
|
23
57
|
export type ToolInstance = (typeof ALL_TOOLS)[number];
|
|
58
|
+
/**
|
|
59
|
+
* Get all tools (for backward compatibility)
|
|
60
|
+
* @deprecated Use getCoreTools(), getElicitationTools(), etc. instead for capability-aware registration
|
|
61
|
+
*/
|
|
24
62
|
export declare function getAllTools(): readonly ToolInstance[];
|
|
63
|
+
/**
|
|
64
|
+
* Get tools that work in all MCP clients
|
|
65
|
+
*/
|
|
66
|
+
export declare function getCoreTools(): readonly ToolInstance[];
|
|
67
|
+
/**
|
|
68
|
+
* Get tools that require elicitation capability
|
|
69
|
+
*/
|
|
70
|
+
export declare function getElicitationTools(): readonly ToolInstance[];
|
|
71
|
+
/**
|
|
72
|
+
* Get tools that serve as fallbacks when client doesn't support resources
|
|
73
|
+
*/
|
|
74
|
+
export declare function getResourceFallbackTools(): readonly ToolInstance[];
|
|
25
75
|
export declare function getToolByName(name: string): ToolInstance | undefined;
|
|
26
76
|
//# sourceMappingURL=toolRegistry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolRegistry.d.ts","sourceRoot":"","sources":["../../../src/tools/toolRegistry.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AACzF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D;;;GAGG;AACH,eAAO,MAAM,UAAU,wTAqBb,CAAC;AAEX;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,aAAc,CAAC;AAE7C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,uBAAuB,iDAG1B,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,SAAS,8VAIZ,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtD;;;GAGG;AACH,wBAAgB,WAAW,IAAI,SAAS,YAAY,EAAE,CAErD;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,SAAS,YAAY,EAAE,CAEtD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,SAAS,YAAY,EAAE,CAE7D;AAED;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,SAAS,YAAY,EAAE,CAElE;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAEpE"}
|
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
// Copyright (c) Mapbox, Inc.
|
|
3
3
|
// Licensed under the MIT License.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.ALL_TOOLS = void 0;
|
|
5
|
+
exports.ALL_TOOLS = exports.RESOURCE_FALLBACK_TOOLS = exports.ELICITATION_TOOLS = exports.CORE_TOOLS = void 0;
|
|
6
6
|
exports.getAllTools = getAllTools;
|
|
7
|
+
exports.getCoreTools = getCoreTools;
|
|
8
|
+
exports.getElicitationTools = getElicitationTools;
|
|
9
|
+
exports.getResourceFallbackTools = getResourceFallbackTools;
|
|
7
10
|
exports.getToolByName = getToolByName;
|
|
8
11
|
// INSERT NEW TOOL IMPORT HERE
|
|
9
12
|
const SimplifyTool_js_1 = require("./simplify-tool/SimplifyTool.js");
|
|
@@ -28,8 +31,11 @@ const StaticMapImageTool_js_1 = require("./static-map-image-tool/StaticMapImageT
|
|
|
28
31
|
const SearchAndGeocodeTool_js_1 = require("./search-and-geocode-tool/SearchAndGeocodeTool.js");
|
|
29
32
|
const VersionTool_js_1 = require("./version-tool/VersionTool.js");
|
|
30
33
|
const httpPipeline_js_1 = require("../utils/httpPipeline.js");
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Core tools that work in all MCP clients without requiring special capabilities
|
|
36
|
+
* These tools are registered immediately during server startup
|
|
37
|
+
*/
|
|
38
|
+
exports.CORE_TOOLS = [
|
|
33
39
|
// INSERT NEW TOOL INSTANCE HERE
|
|
34
40
|
new SimplifyTool_js_1.SimplifyTool(),
|
|
35
41
|
new BoundingBoxTool_js_1.BoundingBoxTool(),
|
|
@@ -41,8 +47,6 @@ exports.ALL_TOOLS = [
|
|
|
41
47
|
new PointInPolygonTool_js_1.PointInPolygonTool(),
|
|
42
48
|
new DistanceTool_js_1.DistanceTool(),
|
|
43
49
|
new VersionTool_js_1.VersionTool(),
|
|
44
|
-
new ResourceReaderTool_js_1.ResourceReaderTool(),
|
|
45
|
-
new CategoryListTool_js_1.CategoryListTool({ httpRequest: httpPipeline_js_1.httpRequest }),
|
|
46
50
|
new CategorySearchTool_js_1.CategorySearchTool({ httpRequest: httpPipeline_js_1.httpRequest }),
|
|
47
51
|
new DirectionsTool_js_1.DirectionsTool({ httpRequest: httpPipeline_js_1.httpRequest }),
|
|
48
52
|
new IsochroneTool_js_1.IsochroneTool({ httpRequest: httpPipeline_js_1.httpRequest }),
|
|
@@ -53,9 +57,68 @@ exports.ALL_TOOLS = [
|
|
|
53
57
|
new StaticMapImageTool_js_1.StaticMapImageTool({ httpRequest: httpPipeline_js_1.httpRequest }),
|
|
54
58
|
new SearchAndGeocodeTool_js_1.SearchAndGeocodeTool({ httpRequest: httpPipeline_js_1.httpRequest })
|
|
55
59
|
];
|
|
60
|
+
/**
|
|
61
|
+
* Tools that require elicitation capability for optimal functionality
|
|
62
|
+
* These tools use elicitInput() for secure token management
|
|
63
|
+
* Registered only if client supports elicitation
|
|
64
|
+
*
|
|
65
|
+
* Currently empty - elicitation support will be added in a future PR.
|
|
66
|
+
* This category is ready for tools that require the elicitation capability.
|
|
67
|
+
*/
|
|
68
|
+
exports.ELICITATION_TOOLS = [];
|
|
69
|
+
/**
|
|
70
|
+
* Tools that serve as bridges for clients without resource support
|
|
71
|
+
* These tools are only registered if CLIENT_NEEDS_RESOURCE_FALLBACK env var is set to "true"
|
|
72
|
+
*
|
|
73
|
+
* Context: Most MCP clients support resources (Claude Desktop, VS Code, Inspector, etc.).
|
|
74
|
+
* However, some clients (like smolagents) don't support resources at all.
|
|
75
|
+
* These tools provide the same content as resources but via tool calls instead.
|
|
76
|
+
*
|
|
77
|
+
* Configuration:
|
|
78
|
+
* - Leave unset (default) = Skip these tools (assumes client supports resources)
|
|
79
|
+
* - Set CLIENT_NEEDS_RESOURCE_FALLBACK=true = Include these tools (for smolagents, etc.)
|
|
80
|
+
*
|
|
81
|
+
* Tools:
|
|
82
|
+
* - ResourceReaderTool: Generic fallback for reading any resource by URI
|
|
83
|
+
* - CategoryListTool: Provides access to category list (mapbox://categories)
|
|
84
|
+
*/
|
|
85
|
+
exports.RESOURCE_FALLBACK_TOOLS = [
|
|
86
|
+
new ResourceReaderTool_js_1.ResourceReaderTool(),
|
|
87
|
+
new CategoryListTool_js_1.CategoryListTool({ httpRequest: httpPipeline_js_1.httpRequest })
|
|
88
|
+
];
|
|
89
|
+
/**
|
|
90
|
+
* All tools combined (for backward compatibility and testing)
|
|
91
|
+
*/
|
|
92
|
+
exports.ALL_TOOLS = [
|
|
93
|
+
...exports.CORE_TOOLS,
|
|
94
|
+
...exports.ELICITATION_TOOLS,
|
|
95
|
+
...exports.RESOURCE_FALLBACK_TOOLS
|
|
96
|
+
];
|
|
97
|
+
/**
|
|
98
|
+
* Get all tools (for backward compatibility)
|
|
99
|
+
* @deprecated Use getCoreTools(), getElicitationTools(), etc. instead for capability-aware registration
|
|
100
|
+
*/
|
|
56
101
|
function getAllTools() {
|
|
57
102
|
return exports.ALL_TOOLS;
|
|
58
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* Get tools that work in all MCP clients
|
|
106
|
+
*/
|
|
107
|
+
function getCoreTools() {
|
|
108
|
+
return exports.CORE_TOOLS;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Get tools that require elicitation capability
|
|
112
|
+
*/
|
|
113
|
+
function getElicitationTools() {
|
|
114
|
+
return exports.ELICITATION_TOOLS;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Get tools that serve as fallbacks when client doesn't support resources
|
|
118
|
+
*/
|
|
119
|
+
function getResourceFallbackTools() {
|
|
120
|
+
return exports.RESOURCE_FALLBACK_TOOLS;
|
|
121
|
+
}
|
|
59
122
|
function getToolByName(name) {
|
|
60
123
|
return exports.ALL_TOOLS.find((tool) => tool.name === name);
|
|
61
124
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolRegistry.js","sourceRoot":"","sources":["../../../src/tools/toolRegistry.ts"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,kCAAkC;;;
|
|
1
|
+
{"version":3,"file":"toolRegistry.js","sourceRoot":"","sources":["../../../src/tools/toolRegistry.ts"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,kCAAkC;;;AAmGlC,kCAEC;AAKD,oCAEC;AAKD,kDAEC;AAKD,4DAEC;AAED,sCAEC;AA5HD,8BAA8B;AAC9B,qEAA+D;AAC/D,+EAAyE;AACzE,qEAA+D;AAC/D,qEAA+D;AAC/D,kEAA4D;AAC5D,yDAAmD;AACnD,+DAAyD;AACzD,yFAAmF;AACnF,qEAA+D;AAC/D,kFAA4E;AAC5E,wFAAkF;AAClF,2EAAqE;AACrE,wEAAkE;AAClE,+EAAyE;AACzE,+DAAyD;AACzD,iFAA2E;AAC3E,wFAAkF;AAClF,wFAAkF;AAClF,yFAAmF;AACnF,+FAAyF;AACzF,kEAA4D;AAC5D,8DAA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