googleapis/mcp-toolbox · error

METHOD_NOT_FOUND

METHOD_NOT_FOUND

Error message

invalid method %s

What it means

Error "invalid method %s" thrown in googleapis/mcp-toolbox.

Source

Thrown at internal/server/mcp/v20260728/method.go:56

	"go.opentelemetry.io/otel/metric"
	"go.opentelemetry.io/otel/trace"
)

// ProcessMethod returns a response for the request.
func ProcessMethod(ctx context.Context, id jsonrpc.RequestId, method string, g group.Group, primitiveMgr *primitives.PrimitiveManager, body []byte, header http.Header) (any, error) {
	switch method {
	case SERVER_DISCOVER:
		return serverDiscoverHandler(ctx, id, body, header)
	case TOOLS_LIST:
		return toolsListHandler(ctx, id, primitiveMgr, g, body, header)
	case TOOLS_CALL:
		return toolsCallHandler(ctx, id, g, primitiveMgr, body, header)
	case PROMPTS_LIST:
		return promptsListHandler(ctx, id, primitiveMgr, g, body, header)
	case PROMPTS_GET:
		return promptsGetHandler(ctx, id, g, primitiveMgr, body, header)
	default:
		err := fmt.Errorf("invalid method %s", method)
		return jsonrpc.NewError(id, jsonrpc.METHOD_NOT_FOUND, err.Error(), nil), err
	}
}

// validateMetadata checks the metadata of every requests
func validateMetadata(id jsonrpc.RequestId, params RequestParams, stdio bool) (any, error) {
	// Check _meta field for protocol version
	if params.Meta != nil {
		// check for protocol version metadata
		v := params.Meta.ProtocolVersion
		if v == "" {
			metaErr := fmt.Errorf("_meta error: missing io.modelcontextprotocol/protocolVersion")
			return jsonrpc.NewError(id, jsonrpc.INVALID_PARAMS, metaErr.Error(), nil), metaErr
		}
		// do not have to verify header for stdio; already verified during stdio
		// message processing
		if !stdio {
			if PROTOCOL_VERSION != v {

View on GitHub (pinned to 8cc6e09de2)

When it happens

Trigger: Thrown at internal/server/mcp/v20260728/method.go:56 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05). Data as JSON: /api/errors/d0b1f50c17ee9f4c. Report an issue: GitHub.