Skip to content

fix(smolagents): support MCP tools with no input parameters - #86

Open
syf2211 wants to merge 1 commit into
grll:mainfrom
syf2211:fix/78-smolagents-empty-input-schema
Open

fix(smolagents): support MCP tools with no input parameters#86
syf2211 wants to merge 1 commit into
grll:mainfrom
syf2211:fix/78-smolagents-empty-input-schema

Conversation

@syf2211

@syf2211 syf2211 commented Jun 28, 2026

Copy link
Copy Markdown

Summary

Fix SmolAgentsAdapter crashing when adapting MCP tools whose inputSchema is a valid empty object schema ({"type": "object"}) without a properties field.

Motivation

Some MCP servers expose parameter-less tools (for example, a server version probe). JSON Schema allows omitting properties for object schemas with no fields, but the adapter accessed input_schema["properties"] unconditionally and raised KeyError.

Fixes #78

Changes

  • Treat missing properties as an empty dict via input_schema.setdefault("properties", {})
  • Reuse the normalized properties mapping when constructing the SmolAgents tool inputs
  • Add an integration test covering a no-argument MCP tool end-to-end

Tests

  • uv run pytest tests/test_smolagents_adapter.py::test_tool_with_no_input_parameters -q — passed
  • uv run pytest tests/test_smolagents_adapter.py -q — 10 passed

Notes

  • composer-2.5 review: APPROVE
  • Minimal behavioral change for tools that already declare properties

Parameter-less tools may expose a valid JSON Schema of {"type": "object"}
without a properties field. SmolAgentsAdapter previously assumed properties
was always present and raised KeyError during adaptation.

Fixes grll#78
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SmolAgentsAdapter fails on tools with no input parameters (missing properties field)

1 participant