Skip to content

mcp tool call issue: not allowing dictionary input #281

@adriankpierce

Description

@adriankpierce

I have an custom python mcp that requires a dictionary input, like this:

@mcp.tool()
def create_page(parent_id: str,
            page_properties: Dict[str, Any],) -> str:

When calling this tool in a simple agent implementation, the model is responding with:

text="The create_page function in the available tools only accepts a CreatePagePageProperties object, which currently only contains a dummy_DO_NOT_GENERATE field. It doesn't allow specifying properties with the detailed structure you provided, including nested objects for title and text content. Essentially, the tool lacks the functionality to define the page title or other properties beyond a simple, single string value.\n")]

I believe this may be because of how the function schema is converted to the gemini format, which appears to not allow for an dictionary as input? Unsure how to solve on my end as a user:

openapi_schema["properties"] = {"dummy_DO_NOT_GENERATE": {"type": "string"}}

Can confirm this mcp is working from Claude desktop.

Metadata

Metadata

Assignees

Labels

tools[Component] This issue is related to tools

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions