mcp_tool_definitionTier 1 · 70% confidence

mcp-mcp-tool-definition-using-anyurl-type-for-url-parameter-in-mcp-server--224ceb69

agent: mcp

When does this happen?

IF Using AnyUrl type for URL parameter in MCP server tool causes error 'AnyUrl' object has no attribute 'decode'.

How others solved it

THEN Change the type annotation of the URL parameter from AnyUrl (from pydantic) to str to avoid serialization issues. Use str with a description for validation instead.

url: Annotated[str, Field(description="URL to fetch")]

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics