googleapis/mcp-toolbox · error · jsonrpc.Error

METHOD_NOT_FOUND

METHOD_NOT_FOUND

Error message

method not found

What it means

Error "method not found" thrown in googleapis/mcp-toolbox.

Source

Thrown at internal/server/mcp.go:696

	if err = util.DecodeJSON(bytes.NewBuffer(body), &baseMessage); err != nil {
		// The id cannot be determined from an undecodable body (batch or parse
		// error). Per JSON-RPC 2.0, the response id MUST be null in that case.
		// See https://www.jsonrpc.org/specification#response_object

		// check if user is sending a batch request
		var a []any
		unmarshalErr := json.Unmarshal(body, &a)
		if unmarshalErr == nil {
			err = fmt.Errorf("not supporting batch requests")
			return "", jsonrpc.NewError(nil, jsonrpc.INVALID_REQUEST, err.Error(), nil), err
		}

		return "", jsonrpc.NewError(nil, jsonrpc.PARSE_ERROR, err.Error(), nil), err
	}

	// Check if method is present
	if baseMessage.Method == "" {
		err = fmt.Errorf("method not found")
		return "", jsonrpc.NewError(baseMessage.Id, jsonrpc.METHOD_NOT_FOUND, err.Error(), nil), err
	}
	logger.DebugContext(ctx, fmt.Sprintf("method is: %s", baseMessage.Method))

	// Check for JSON-RPC 2.0
	if baseMessage.Jsonrpc != jsonrpc.JSONRPC_VERSION {
		err = fmt.Errorf("invalid json-rpc version")
		return "", jsonrpc.NewError(baseMessage.Id, jsonrpc.INVALID_REQUEST, err.Error(), nil), err
	}

	// Create method-specific span with semantic conventions
	// Note: Trace context is already extracted and set in ctx by the caller
	ctx, span := s.instrumentation.Tracer.Start(ctx, baseMessage.Method,
		trace.WithSpanKind(trace.SpanKindServer),
	)
	defer span.End()

	// Determine network transport and protocol based on header presence

View on GitHub (pinned to 8cc6e09de2)

When it happens

Trigger: Thrown at internal/server/mcp.go:696 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/1ff38dadd82f55c2. Report an issue: GitHub.