You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: give each routing endpoint its own focused tool set
/mcp/code now only exposes code_execution + retrieve_tools (with
instructions to use code_execution, not call_tool_*).
/mcp/call now has a dedicated server with retrieve_tools (with
instructions to use call_tool_read/write/destructive) + the three
call_tool variants + read_cache. No code_execution, upstream_servers,
or other tools that don't belong.
Previously /mcp/call served the full default server with all tools.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
// retrieve_tools for discovery — instructs to use code_execution (NOT call_tool_*)
268
268
retrieveToolsTool:=mcp.NewTool("retrieve_tools",
269
-
mcp.WithDescription("Search and discover available upstream tools using BM25 full-text search. Use this to find tools before orchestrating them with code_execution. Use natural language to describe what you want to accomplish."),
269
+
mcp.WithDescription("Search and discover available upstream tools using BM25 full-text search. "+
270
+
"Use this to find tools, then use the `code_execution` tool to call them via `call_tool(serverName, toolName, args)` in JavaScript. "+
271
+
"Do NOT use call_tool_read/write/destructive — they are not available in this mode. "+
272
+
"Use natural language to describe what you want to accomplish."),
// retrieve_tools — instructs to use call_tool_read/write/destructive
301
+
retrieveToolsTool:=mcp.NewTool("retrieve_tools",
302
+
mcp.WithDescription("Search and discover available upstream tools using BM25 full-text search. "+
303
+
"WORKFLOW: 1) Call this tool first to find relevant tools, 2) Check the 'call_with' field in results "+
304
+
"to determine which variant to use, 3) Call the tool using call_tool_read, call_tool_write, or call_tool_destructive. "+
305
+
"Results include 'annotations' (tool behavior hints like destructiveHint) and 'call_with' recommendation. "+
306
+
"Use natural language to describe what you want to accomplish."),
307
+
mcp.WithTitleAnnotation("Retrieve Tools"),
308
+
mcp.WithReadOnlyHintAnnotation(true),
309
+
mcp.WithString("query",
310
+
mcp.Required(),
311
+
mcp.Description("Natural language description of what you want to accomplish. Be specific (e.g., 'create a new GitHub repository', 'get weather for London')."),
312
+
),
313
+
mcp.WithNumber("limit",
314
+
mcp.Description("Maximum number of tools to return (default: configured tools_limit, max: 100)"),
315
+
),
316
+
mcp.WithBoolean("include_stats",
317
+
mcp.Description("Include usage statistics for returned tools (default: false)"),
318
+
),
319
+
mcp.WithBoolean("debug",
320
+
mcp.Description("Enable debug mode with detailed scoring and ranking explanations (default: false)"),
321
+
),
322
+
mcp.WithString("explain_tool",
323
+
mcp.Description("When debug=true, explain why a specific tool was ranked low (format: 'server:tool')"),
mcp.WithDescription("Execute a READ-ONLY tool. WORKFLOW: 1) Call retrieve_tools first to find tools, 2) Use the exact 'name' field from results. Use this for: search, query, list, get, fetch, find, check, view, read, show, describe, lookup, retrieve, browse, explore, discover, scan, inspect, analyze, examine, validate, verify. This is the DEFAULT choice when unsure."),
334
+
mcp.WithTitleAnnotation("Call Tool (Read)"),
335
+
mcp.WithReadOnlyHintAnnotation(true),
336
+
mcp.WithString("name",
337
+
mcp.Required(),
338
+
mcp.Description("Tool name in format 'server:tool' (e.g., 'github:get_user'). Use exact names from retrieve_tools results."),
339
+
),
340
+
mcp.WithString("args_json",
341
+
mcp.Description("Arguments as JSON string. Refer to the tool's inputSchema from retrieve_tools."),
342
+
),
343
+
mcp.WithString("intent_data_sensitivity",
344
+
mcp.Description("Classify data: public, internal, private, or unknown."),
345
+
),
346
+
mcp.WithString("intent_reason",
347
+
mcp.Description("Why is this tool being called? Provide context."),
mcp.WithDescription("Execute a STATE-MODIFYING tool. WORKFLOW: 1) Call retrieve_tools first to find tools, 2) Use the exact 'name' field from results. Use this for: create, update, modify, add, set, send, edit, change, write, post, put, patch, insert, upload, submit. Use only when explicitly modifying state."),
358
+
mcp.WithTitleAnnotation("Call Tool (Write)"),
359
+
mcp.WithDestructiveHintAnnotation(false),
360
+
mcp.WithString("name",
361
+
mcp.Required(),
362
+
mcp.Description("Tool name in format 'server:tool' (e.g., 'github:create_issue'). Use exact names from retrieve_tools results."),
363
+
),
364
+
mcp.WithString("args_json",
365
+
mcp.Description("Arguments as JSON string. Refer to the tool's inputSchema from retrieve_tools."),
366
+
),
367
+
mcp.WithString("intent_data_sensitivity",
368
+
mcp.Description("Classify data: public, internal, private, or unknown."),
369
+
),
370
+
mcp.WithString("intent_reason",
371
+
mcp.Description("Why is this modification needed? Provide context."),
mcp.WithDescription("Execute a DESTRUCTIVE tool. WORKFLOW: 1) Call retrieve_tools first to find tools, 2) Use the exact 'name' field from results. Use this for: delete, remove, drop, revoke, disable, destroy, purge, reset, clear, terminate. Use for irreversible or high-impact operations."),
mcp.Description("Tool name in format 'server:tool' (e.g., 'github:delete_repo'). Use exact names from retrieve_tools results."),
387
+
),
388
+
mcp.WithString("args_json",
389
+
mcp.Description("Arguments as JSON string. Refer to the tool's inputSchema from retrieve_tools."),
390
+
),
391
+
mcp.WithString("intent_data_sensitivity",
392
+
mcp.Description("Classify data: public, internal, private, or unknown."),
393
+
),
394
+
mcp.WithString("intent_reason",
395
+
mcp.Description("Why is this deletion needed? Provide justification."),
396
+
),
397
+
)
398
+
tools=append(tools, mcpserver.ServerTool{
399
+
Tool: callToolDestructiveTool,
400
+
Handler: p.handleCallToolDestructive,
401
+
})
402
+
403
+
// read_cache for paginated responses
404
+
readCacheTool:=mcp.NewTool("read_cache",
405
+
mcp.WithDescription("Retrieve paginated data when mcpproxy indicates a tool response was truncated. Use the cache key provided in truncation messages."),
406
+
mcp.WithTitleAnnotation("Read Cache"),
407
+
mcp.WithReadOnlyHintAnnotation(true),
408
+
mcp.WithString("key",
409
+
mcp.Required(),
410
+
mcp.Description("Cache key provided by mcpproxy when a response was truncated."),
411
+
),
412
+
mcp.WithNumber("offset",
413
+
mcp.Description("Starting record offset for pagination (default: 0)"),
414
+
),
415
+
mcp.WithNumber("limit",
416
+
mcp.Description("Maximum number of records to return per page (default: 50, max: 1000)"),
417
+
),
418
+
)
419
+
tools=append(tools, mcpserver.ServerTool{
420
+
Tool: readCacheTool,
421
+
Handler: p.handleReadCache,
422
+
})
423
+
424
+
p.logger.Info("built call tool mode tools",
425
+
zap.Int("tool_count", len(tools)))
426
+
427
+
returntools
428
+
}
429
+
291
430
// buildToolCatalogDescription builds a human-readable catalog of available tools for the code_execution description.
0 commit comments