{"record":{"id":"04cf4acb5ffa321e","repo":"googleapis/mcp-toolbox","slug":"internal-error-04cf4a","errorCode":"INTERNAL_ERROR","errorMessage":"error generating manifest: %w","messagePattern":"error generating manifest: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/server/mcp/v20250326/method.go","lineNumber":124,"sourceCode":"func pingHandler(id jsonrpc.RequestId) (any, error) {\n\treturn jsonrpc.JSONRPCResponse{\n\t\tJsonrpc: jsonrpc.JSONRPC_VERSION,\n\t\tId:      id,\n\t\tResult:  struct{}{},\n\t}, nil\n}\n\nfunc toolsListHandler(ctx context.Context, id jsonrpc.RequestId, primitiveMgr *primitives.PrimitiveManager, g group.Group, body []byte) (any, error) {\n\tvar req ListToolsRequest\n\tif err := json.Unmarshal(body, &req); err != nil {\n\t\terr = fmt.Errorf(\"invalid mcp tools list request: %w\", err)\n\t\treturn jsonrpc.NewError(id, jsonrpc.INVALID_REQUEST, err.Error(), nil), err\n\t}\n\n\turlParams, _ := util.UrlParamsFromContext(ctx)\n\tlistToolsResult, err := GenerateListToolsResult(primitiveMgr, g, urlParams)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"error generating manifest: %w\", err)\n\t\treturn jsonrpc.NewError(id, jsonrpc.INTERNAL_ERROR, err.Error(), nil), err\n\t}\n\n\treturn jsonrpc.JSONRPCResponse{\n\t\tJsonrpc: jsonrpc.JSONRPC_VERSION,\n\t\tId:      id,\n\t\tResult:  listToolsResult,\n\t}, nil\n}\n\n// toolsCallHandler generate a response for tools call.\nfunc toolsCallHandler(ctx context.Context, id jsonrpc.RequestId, g group.Group, primitiveMgr *primitives.PrimitiveManager, body []byte, header http.Header) (any, error) {\n\tif header != nil {\n\t\tif clientIP := util.ExtractClientIP(header); clientIP != \"\" {\n\t\t\tctx = util.WithClientIP(ctx, clientIP)\n\t\t}\n\t}\n","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/server/mcp/v20250326/method.go#L106-L142","documentation":"toolsListHandler wraps any error returned by GenerateListToolsResult with \"error generating manifest\" and reports it as INTERNAL_ERROR. The underlying cause is one of the manifest-generation failures: missing tool (260), missing source (261), or GetParameters failure (262).","triggerScenarios":"Any error propagating out of GenerateListToolsResult during tools/list handling — unresolvable tool or source names, or GetParameters failures.","commonSituations":"Server-side registration inconsistencies after config changes; sources that failed to initialize; custom tools whose schema generation hits a down database.","solutions":["Inspect the wrapped cause in the error chain to identify the failing tool/source","Fix source initialization (connection, credentials) or remove tools referencing dead sources","Ensure groups are rebuilt after tool/source registration changes","Restart the server after config edits and verify startup logs show all sources/tools registered"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// client-side: refresh tools and confirm the server is healthy before listing\nconst health = await fetch(`${serverUrl}/api/health`)\nif (!health.ok) throw new Error(\"server sources not ready\")","typeGuard":null,"tryCatchPattern":"try {\n  const tools = await client.listTools()\n} catch (e) {\n  if (e.code === -32603) { // INTERNAL_ERROR: transient source/registry issue\n    await waitForServerReady()\n    return client.listTools()\n  }\n  throw e\n}","preventionTips":["Only call tools/list after the server finishes startup and sources initialize","Monitor server logs for source init failures","Retry tools/list with backoff on INTERNAL_ERROR during startup windows"],"tags":["go","mcp","manifest","internal-error"],"backgroundTag":"manifest-generation-failed","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"}