{"record":{"id":"5052e82a690a2ead","repo":"googleapis/mcp-toolbox","slug":"invalid-params-5052e8","errorCode":"INVALID_PARAMS","errorMessage":"invalid tool name: tool with name %q does not exist","messagePattern":"invalid tool name: tool with name %q does not exist","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/server/mcp/v20250618/method.go","lineNumber":170,"sourceCode":"\t\terr = fmt.Errorf(\"invalid mcp tools call request: %w\", err)\n\t\treturn jsonrpc.NewError(id, jsonrpc.INVALID_REQUEST, err.Error(), nil), err\n\t}\n\n\ttoolName := req.Params.Name\n\ttoolArgument := req.Params.Arguments\n\tlogger.DebugContext(ctx, fmt.Sprintf(\"tool name: %s\", toolName))\n\n\t// Update span name and set gen_ai attributes\n\tspan := trace.SpanFromContext(ctx)\n\tspan.SetName(fmt.Sprintf(\"%s %s\", TOOLS_CALL, toolName))\n\tspan.SetAttributes(\n\t\tattribute.String(\"gen_ai.tool.name\", toolName),\n\t\tattribute.String(\"gen_ai.operation.name\", \"execute_tool\"),\n\t)\n\n\t// Verify tool belongs to the current group before resolving globally.\n\tif !g.ContainsTool(toolName) {\n\t\terr = fmt.Errorf(\"invalid tool name: tool with name %q does not exist\", toolName)\n\t\treturn jsonrpc.NewError(id, jsonrpc.INVALID_PARAMS, err.Error(), nil), err\n\t}\n\n\ttool, ok := primitiveMgr.GetTool(toolName)\n\tif !ok {\n\t\terr = fmt.Errorf(\"invalid tool name: tool with name %q does not exist\", toolName)\n\t\treturn jsonrpc.NewError(id, jsonrpc.INVALID_PARAMS, err.Error(), nil), err\n\t}\n\n\tif tool.HasSecureParams() {\n\t\terr = fmt.Errorf(\"invalid tool name: tool with name %q does not exist\", toolName)\n\t\treturn jsonrpc.NewError(id, jsonrpc.INVALID_PARAMS, err.Error(), nil), err\n\t}\n\n\tsrcName := tool.GetSourceName()\n\tvar src sources.Source\n\tif srcName != \"\" {\n\t\tsrc, ok = primitiveMgr.GetSource(srcName)","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/server/mcp/v20250618/method.go#L152-L188","documentation":"Before resolving a tool globally, toolsCallHandler verifies the requested tool belongs to the active authorization group (g.ContainsTool). If the tool name is not in the current group's allowlist, the server returns JSON-RPC INVALID_PARAMS with 'invalid tool name: tool with name %q does not exist'. This enforces per-group/per-invocation tool scoping.","triggerScenarios":"Calling tools/call with a params.name that exists in the toolbox config but is not included in the current group's tool allowlist — e.g. calling a tool that was filtered out by the group or URL-parameter filters used for this invocation.","commonSituations":"Using a group/restricted client setup where the allowlist omits the tool; stale client-side tool cache from before the group config changed; typos in the tool name when calling directly via HTTP.","solutions":["Call tools/list for your current session/group and use a name exactly from that result","Check your group/allowlist configuration and add the tool to the group if it should be callable","Confirm any URL query filters (e.g. tool name filters) are not excluding the tool for this request","Fix typos — the %q in the message shows the exact name the server received"],"exampleFix":"// before\n{\"name\":\"execute_sql\",\"arguments\":{}}\n// after\n{\"name\":\"execute-sql\",\"arguments\":{}}","handlingStrategy":"validation","validationCode":"const listed = await listTools();\nconst names = new Set(listed.tools.map(t => t.name));\nif (!names.has(\"execute-sql\")) throw new Error(\"tool not available in this group/session\");","typeGuard":"function isToolAvailable(name: string, listed: { tools: { name: string }[] }): boolean {\n  return listed.tools.some(t => t.name === name);\n}","tryCatchPattern":"try { const res = await callTool(name, args); } catch (e) { if (e.code === -32602 && /does not exist/.test(e.message)) { await refreshToolList(); } else throw e; }","preventionTips":["Always derive tool names from tools/list of the current session","Keep group allowlists in sync with the tools clients call","Refresh cached tool lists after any server config change"],"tags":["mcp","tools-call","authorization","invalid-params"],"backgroundTag":"unknown-tool-name","analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}