The SmolAgentsAdapter.adapt() method crashes with a KeyError: 'properties' when processing MCP tools that have no input parameters.
Steps to Reproduce:
- Connect to an MCP server that has at least one tool with no input parameters (e.g., a tool that just returns server version)
- The tool's input schema will be valid JSON Schema:
{"type": "object"}
- Try to load the tools via smolagents MCPClient
Expected Behavior:
Tools with no input parameters should be supported. A JSON Schema of {"type": "object"} without properties is valid and indicates no parameters are required.
Actual Behavior:
The adapter crashes at line 103 in smolagents_adapter.py:
for k, v in input_schema["properties"].items():
This line assumes properties always exists, which is not true for parameter-less tools.
I'd be happy to provide a fix, if confirmed.