You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mcpcompat shim normalizes tool schemas, dropping properties when type:object is absent #5770
While writing regression tests for the mcp-go → go-sdk migration (#5742), a tool schema fidelity regression was discovered in github.com/stacklok/toolhive-core/mcpcompat v0.0.27.
Finding
The shim's normalizeObjectSchema replaces tool input schemas that lack a top-level "type":"object" with a bare {"type":"object"}, dropping properties, required, and any other fields.
For example, a backend tool with inputSchema: {"properties": {"x": {"type": "string"}}, "required": ["x"]} (no top-level type) is projected as {"type":"object"} — the properties and required fields are lost.
Impact: Clients lose the ability to validate tool arguments or present input forms. The tool's input schema is effectively erased.
TestRegression_ToolSchemaWithoutTypeObject_NormalizedToEmptyObject in pkg/vmcp/server/schema_fidelity_regression_test.go — pins the current (lossy) behavior. When the shim is fixed, the assertion should be flipped to verify the schema is projected intact.
TestRegression_ToolSchemaWithTypeObject_ProjectedIntact — verifies schemas WITH type:object ARE projected verbatim (this passes today).
MCP spec reference
MCP 2025-11-25 §"Tool Definition": inputSchema SHOULD be a JSON Schema object. The server should pass schemas through verbatim without normalizing or injecting missing keys.
Acceptance criteria
When the shim is fixed:
A tool whose input schema lacks "type":"object" should be projected with its schema intact (properties, required, etc. preserved)
The regression test should be updated to assert the correct behavior
Activity
aponcedeleonch commentedon Jul 13, 2026
Duplicate: #5769