Fix TypeError in infer_resource_slots() when properties is null #11192

Merged
HAL9000 merged 1 commits from bugfix/mcp-infer-resource-slots-null-properties into master 2026-05-15 03:03:25 +00:00
2 changed files with 1 additions and 2 deletions
@@ -4,7 +4,6 @@ Feature: TDD Issue #10470 — MCPToolAdapter.infer_resource_slots() raises TypeE
the properties dict. When the key exists but has a null value ({"properties": None}),
dict.get() returns None instead of the default {}, causing a TypeError when iterating.
@tdd_expected_fail
Scenario: infer_resource_slots() with null properties does not raise TypeError
Given an MCP tool input schema where properties key is null
When I call infer_resource_slots with the null properties schema
+1 -1
View File
@@ -740,7 +740,7 @@ class MCPToolAdapter:
),
]
properties: dict[str, Any] = input_schema.get("properties", {})
properties: dict[str, Any] = input_schema.get("properties") or {}
slots: list[ResourceSlot] = []
seen_names: set[str] = set()