{"record":{"id":"9926de30744adca7","repo":"googleapis/mcp-toolbox","slug":"internal-error-9926de","errorCode":"INTERNAL_ERROR","errorMessage":"tool does not exist: %s","messagePattern":"tool does not exist: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/server/mcp/v20251125/manifests.go","lineNumber":108,"sourceCode":"\t\t}\n\t\tif len(authParamList) > 0 {\n\t\t\tauthParam[name] = authParamList\n\t\t}\n\t}\n\treturn InputSchema{\n\t\tType:       \"object\",\n\t\tProperties: properties,\n\t\tRequired:   required,\n\t}, authParam\n}\n\n// GenerateListToolsResult generates tools/list method result according to mcp schema\nfunc GenerateListToolsResult(pMgr *primitives.PrimitiveManager, g group.Group, urlParams map[string]string) (ListToolsResult, error) {\n\tmcpManifest := make([]Tool, 0, len(g.ToolNames))\n\tfor _, toolName := range g.ToolNames {\n\t\ttool, ok := pMgr.GetTool(toolName)\n\t\tif !ok {\n\t\t\treturn ListToolsResult{}, fmt.Errorf(\"tool does not exist: %s\", toolName)\n\t\t}\n\t\t// Skip a Tool that requires secure params as they are not supported in this protocol version.\n\t\tif tool.HasSecureParams() {\n\t\t\tcontinue\n\t\t}\n\t\tsrcName := tool.GetSourceName()\n\t\tvar src sources.Source\n\t\tif srcName != \"\" {\n\t\t\tsrc, ok = pMgr.GetSource(srcName)\n\t\t\tif !ok {\n\t\t\t\treturn ListToolsResult{}, fmt.Errorf(\"unable to retrieve %s source for tool %q\", srcName, tool.GetName())\n\t\t\t}\n\t\t}\n\t\tparams, err := tool.GetParameters(src)\n\t\tif err != nil {\n\t\t\treturn ListToolsResult{}, fmt.Errorf(\"error getting parameters for tool %q: %w\", toolName, err)\n\t\t}\n\t\ttoolManifest := generateToolManifest(toolName, tool.GetDescription(), tool.GetAuthRequired(), params, tool.GetAnnotations(src), urlParams)","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/server/mcp/v20251125/manifests.go#L90-L126","documentation":"GenerateListToolsResult iterates a group's tool names and looks each one up in the PrimitiveManager. If GetTool cannot find a name present in the group this INTERNAL_ERROR is thrown, meaning the group's tool list is out of sync with the registered tools.","triggerScenarios":"tools/list is processed while the group.ToolNames slice contains a tool name that is not registered in the PrimitiveManager — e.g. a tool failed to initialize or was removed after the group was built.","commonSituations":"A tool defined in the YAML config failed initialization (bad source, bad SQL) yet its name remained in the group; custom code constructing a group.Group with hand-added tool names; race between tool deregistration and a tools/list call.","solutions":["Check server startup logs for tool initialization failures for the named tool and fix its config (source, statement, parameters).","Ensure every tool name in the group is registered via the PrimitiveManager before serving tools/list.","Validate the toolbox YAML: every tool must have a valid, initialized source.","If building groups programmatically, only append names that pMgr.GetTool() can resolve."],"exampleFix":"// before: group references a tool that failed to init\n// tools.yaml references tool 'query_users' whose source 'db' does not exist\n// after: fix the source so the tool registers\nsources:\n  db:\n    kind: postgres\n    uri: ${POSTGRES_URI}\ntools:\n  query_users:\n    source: db\n    description: List users","handlingStrategy":"validation","validationCode":"// Server-side preflight: every tool name in the group must resolve\nfor _, name := range g.ToolNames {\n    if _, ok := pMgr.GetTool(name); !ok {\n        return fmt.Errorf(\"group references unregistered tool: %s\", name)\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n  const tools = await mcp.listTools();\n} catch (e) {\n  if (e.code === -32603 && /tool does not exist/.test(e.message)) {\n    // server config is broken; surface which tool and stop retrying\n  } else throw e;\n}","preventionTips":["Validate the toolbox YAML config at startup so no tool is listed without successful registration.","Ensure every tool's source exists and initializes before serving traffic.","Never hand-edit group.Group contents; build groups from the registered manager."],"tags":["mcp","tools","manifest","missing-tool"],"backgroundTag":"tool-not-registered","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"}