Skip to content

fix: handle boolean additionalProperties in _filter_to_supported_schema#2459

Open
mahesh-sadupalli wants to merge 1 commit into
googleapis:mainfrom
mahesh-sadupalli:fix/2393-bool-additional-properties
Open

fix: handle boolean additionalProperties in _filter_to_supported_schema#2459
mahesh-sadupalli wants to merge 1 commit into
googleapis:mainfrom
mahesh-sadupalli:fix/2393-bool-additional-properties

Conversation

@mahesh-sadupalli
Copy link
Copy Markdown

@mahesh-sadupalli mahesh-sadupalli commented May 16, 2026

Summary

  • Add if not isinstance(schema, dict): return schema guard at the top of _filter_to_supported_schema()
  • Fixes AttributeError: 'bool' object has no attribute 'items' when MCP tools have additionalProperties: false in their JSON schema (common in Pydantic-generated schemas used by FastMCP)

Fixes #2393

Test plan

  • Verified fix handles additionalProperties: false without crashing
  • Verified normal dict schemas still filter correctly
  • Test with a real FastMCP server that produces boolean additionalProperties

Add type check to return non-dict values (like booleans) as-is.
Fixes AttributeError when MCP tools have 'additionalProperties: false'
in their schema, common in Pydantic-generated schemas used by FastMCP.

Fixes googleapis#2393
@Venkaiahbabuneelam Venkaiahbabuneelam self-assigned this May 22, 2026
@Venkaiahbabuneelam Venkaiahbabuneelam added the size:S Code changes < 10 lines label May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S Code changes < 10 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError: 'bool' object has no attribute 'items' in _mcp_utils.py when using FastMCP tools

2 participants