Skip to content

feat: add input_schema to Tool protocol to match ecosystem convention#22

Open
momuno wants to merge 1 commit intomicrosoft:mainfrom
momuno:fix/tool-protocol-input-schema
Open

feat: add input_schema to Tool protocol to match ecosystem convention#22
momuno wants to merge 1 commit intomicrosoft:mainfrom
momuno:fix/tool-protocol-input-schema

Conversation

@momuno
Copy link
Member

@momuno momuno commented Feb 27, 2026

Every official tool module (tool-bash, tool-filesystem, tool-todo, etc.) already implements input_schema as a @Property returning a JSON Schema dict, but the kernel's Tool Protocol in interfaces.py did not require it. This created a gap between the formal contract and what all real tools do.

Additionally, TOOL_CONTRACT.md referenced a get_schema() method that no real module implements.

This commit:

  • Adds input_schema property to the Tool Protocol in interfaces.py
  • Updates TOOL_CONTRACT.md to use input_schema property throughout
  • Adds input_schema validation check in tool.py
  • Adds behavioral and structural tests for input_schema
  • Updates MockTool classes in test_validation.py to include input_schema
  • Adds input_schema to the MyTool example in README.md

Backward compatible: all existing tool modules already implement this property.

🤖 Generated with Amplifier

Every official tool module (tool-bash, tool-filesystem, tool-todo, etc.)
already implements input_schema as a @Property returning a JSON Schema dict,
but the kernel's Tool Protocol in interfaces.py did not require it. This
created a gap between the formal contract and what all real tools do.

Additionally, TOOL_CONTRACT.md referenced a get_schema() method that no
real module implements.

This commit:
- Adds input_schema property to the Tool Protocol in interfaces.py
- Updates TOOL_CONTRACT.md to use input_schema property throughout
- Adds input_schema validation check in tool.py
- Adds behavioral and structural tests for input_schema
- Updates MockTool classes in test_validation.py to include input_schema
- Adds input_schema to the MyTool example in README.md

Backward compatible: all existing tool modules already implement this property.

🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
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.

1 participant