googleapis/mcp-toolbox · error

INVALID_PARAMS

INVALID_PARAMS

Error message

_meta error: missing io.modelcontextprotocol/protocolVersion

What it means

Error "_meta error: missing io.modelcontextprotocol/protocolVersion" thrown in googleapis/mcp-toolbox.

Source

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

		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 {
				metaErr := fmt.Errorf("_meta error: header mismatch: MCP-Protocol-Version header value '%s' does not match body value '%s'", PROTOCOL_VERSION, v)
				return jsonrpc.NewHeaderMismatchedError(id, metaErr), metaErr
			}
		}

		// check for clientInfo
		clientInfo := params.Meta.ClientInfo
		if clientInfo.Version == "" || clientInfo.Name == "" {
			metaErr := fmt.Errorf("_meta error: missing field from io.modelcontextprotocol/clientInfo")
			return jsonrpc.NewError(id, jsonrpc.INVALID_PARAMS, metaErr.Error(), nil), metaErr
		}
		// check for clientCapabilities

View on GitHub (pinned to 8cc6e09de2)

When it happens

Trigger: Thrown at internal/server/mcp/v20260728/method.go:68 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/6c4af7b6279967dc. Report an issue: GitHub.