Skip to content

[Bug]: MCP Function Schema Missing Type Field - Gemini CLI Compatibility Issue #1311

@ohmyboroda

Description

@ohmyboroda

crawl4ai version

0.7

Expected Behavior

  • All MCP function parameters should have explicit type fields
  • Functions should work with both Claude and Gemini CLI
  • No schema validation errors

Current Behavior

The MCP server's function definitions are missing required type fields in parameter schemas, causing compatibility issues with Google Gemini CLI.

✕ [API Error: [{
    "error": {
      "code": 400,
      "message": "Unable to submit request because `md` functionDeclaration `parameters.f` schema didn't specify the schema type field. Learn more: https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling",
      "errors": [
        {
          "message": "Unable to submit request because `md` functionDeclaration `parameters.f` schema didn't specify the schema type field. Learn more: https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling",
          "domain": "global",
          "reason": "badRequest"
        }
      ],
      "status": "INVALID_ARGUMENT"
    }
  }
  ]]

Is this reproducible?

Yes

Inputs Causing the Bug

Steps to Reproduce

- Configure MCP server with Gemini CLI
- Try to call the md function
- Receive API error about missing schema type field

Client: Google Gemini CLI
Transport: SSE
URL: http://domain.com/mcp/sse

Code snippets

OS

Docker Compose

Python version

0.0

Browser

No response

Browser version

No response

Error logs & Screenshots (if applicable)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 BugSomething isn't working🩺 Needs TriageNeeds attention of maintainers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions