MCPcopy Create free account
hub / github.com/MiniMax-AI/Mini-Agent / test_tool_schema_consistency

Function test_tool_schema_consistency

tests/test_tool_schema.py:230–242  ·  view source on GitHub ↗

Test that both schema methods produce consistent data.

()

Source from the content-addressed store, hash-verified

228
229
230def test_tool_schema_consistency():
231 """Test that both schema methods produce consistent data."""
232 tool = MockCalculatorTool()
233
234 anthropic_schema = tool.to_schema()
235 openai_schema = tool.to_openai_schema()
236
237 # Names should match
238 assert anthropic_schema["name"] == openai_schema["function"]["name"]
239 # Descriptions should match
240 assert anthropic_schema["description"] == openai_schema["function"]["description"]
241 # Parameters should match (just different nesting)
242 assert anthropic_schema["input_schema"] == openai_schema["function"]["parameters"]
243
244
245@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 3

MockCalculatorToolClass · 0.85
to_schemaMethod · 0.80
to_openai_schemaMethod · 0.80

Tested by

no test coverage detected