{"record":{"id":"d0b1f50c17ee9f4c","repo":"googleapis/mcp-toolbox","slug":"method-not-found-d0b1f5","errorCode":"METHOD_NOT_FOUND","errorMessage":"invalid method %s","messagePattern":"invalid method (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/server/mcp/v20260728/method.go","lineNumber":56,"sourceCode":"\t\"go.opentelemetry.io/otel/metric\"\n\t\"go.opentelemetry.io/otel/trace\"\n)\n\n// ProcessMethod returns a response for the request.\nfunc ProcessMethod(ctx context.Context, id jsonrpc.RequestId, method string, g group.Group, primitiveMgr *primitives.PrimitiveManager, body []byte, header http.Header) (any, error) {\n\tswitch method {\n\tcase SERVER_DISCOVER:\n\t\treturn serverDiscoverHandler(ctx, id, body, header)\n\tcase TOOLS_LIST:\n\t\treturn toolsListHandler(ctx, id, primitiveMgr, g, body, header)\n\tcase TOOLS_CALL:\n\t\treturn toolsCallHandler(ctx, id, g, primitiveMgr, body, header)\n\tcase PROMPTS_LIST:\n\t\treturn promptsListHandler(ctx, id, primitiveMgr, g, body, header)\n\tcase PROMPTS_GET:\n\t\treturn promptsGetHandler(ctx, id, g, primitiveMgr, body, header)\n\tdefault:\n\t\terr := fmt.Errorf(\"invalid method %s\", method)\n\t\treturn jsonrpc.NewError(id, jsonrpc.METHOD_NOT_FOUND, err.Error(), nil), err\n\t}\n}\n\n// validateMetadata checks the metadata of every requests\nfunc validateMetadata(id jsonrpc.RequestId, params RequestParams, stdio bool) (any, error) {\n\t// Check _meta field for protocol version\n\tif params.Meta != nil {\n\t\t// check for protocol version metadata\n\t\tv := params.Meta.ProtocolVersion\n\t\tif v == \"\" {\n\t\t\tmetaErr := fmt.Errorf(\"_meta error: missing io.modelcontextprotocol/protocolVersion\")\n\t\t\treturn jsonrpc.NewError(id, jsonrpc.INVALID_PARAMS, metaErr.Error(), nil), metaErr\n\t\t}\n\t\t// do not have to verify header for stdio; already verified during stdio\n\t\t// message processing\n\t\tif !stdio {\n\t\t\tif PROTOCOL_VERSION != v {","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/server/mcp/v20260728/method.go#L38-L74","documentation":"Error \"invalid method %s\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/server/mcp/v20260728/method.go:56 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}