Files
oh-my-pi/packages/coding-agent
Miroslav Drbal 8be261cd29 fix(mcp): strip $schema and nullable from MCP tool schemas before AJV validation
MCP servers using JSON Schema draft 2020-12 (e.g. servers built with Rust rmcp/schemars)
emit "$schema": "https://json-schema.org/draft/2020-12/schema" and "nullable": true in
tool inputSchemas. AJV (configured for draft-07) throws:

  Error: no schema with key or ref "https://json-schema.org/draft/2020-12/schema"

This causes all tool calls from these servers to fail argument validation silently.

Add sanitizeSchema() in convertSchema() — the single chokepoint for all MCP tool schemas
(MCPTool and DeferredMCPTool) — that recursively strips before schemas reach AJV or any
LLM provider:

- $schema: meta-schema declaration, not a validation keyword. AJV rejects unknown URIs.
- nullable: OpenAPI 3.0 extension, not standard JSON Schema. AJV rejects unknown keywords
  in strict mode.

This approach keeps AJV on draft-07 with no version switch. Switching to Ajv2020 was
considered but rejected: it would introduce the symmetric failure for servers that still
emit draft-07 $schema URIs.
2026-02-21 09:42:58 +01:00
..
2026-01-03 14:53:38 +01:00
2026-02-20 14:05:10 +01:00
2026-02-16 14:04:14 +00:00

@oh-my-pi/pi-coding-agent

Core implementation package for the omp coding agent in the oh-my-pi monorepo.

For installation, setup, provider configuration, model roles, slash commands, and full CLI reference, see:

Package-specific references: