Skip to content

All tools unusable in 2020-12-only clients: outputSchema declares draft-07 dialect #132

Description

@jessemaher

Summary

Every tool in @perplexity-ai/mcp-server fails immediately in MCP clients that validate embedded schemas as JSON Schema 2020-12. The call is rejected at the client's schema-validation layer and never reaches the Perplexity API, so no request is billed — the tools are simply unusable.

Error

Tool 'perplexity_ask' has an invalid outputSchema: JSON Schema declares an
unsupported dialect ("$schema": "http://json-schema.org/draft-07/schema#").
The default validator supports JSON Schema 2020-12 only; pass a
pre-configured Ajv instance to Ajv...

Identical failure on perplexity_ask, perplexity_search, perplexity_reason, and perplexity_research. Not intermittent — it fails on every call, immediately, with no network activity.

Environment

  • @perplexity-ai/mcp-server — current latest from npm, installed globally via npm install -g
  • Client: Claude desktop app (Cowork), macOS
  • Confirmed the installed version matches npm view @perplexity-ai/mcp-server version, so this reproduces on the current release

Reproduce

  1. npm install -g @perplexity-ai/mcp-server
  2. Register it in an MCP client that validates outputSchema against 2020-12
  3. Call any tool

Cause

The tools declare outputSchema with "$schema": "http://json-schema.org/draft-07/schema#". This is the well-known zod-to-json-schema default in the MCP TypeScript SDK — see [typescript-sdk#745](modelcontextprotocol/typescript-sdk#745). Note the string does not appear in dist/index.js; it originates in the dependency at schema-generation time, so it cannot be patched by editing the built entry point.

Suggested fix, in order of preference

  1. Emit 2020-12. Zod v4's toJSONSchema({ target: "draft-2020-12" }), or pass the 2020-12 target explicitly to zod-to-json-schema.
  2. Drop outputSchema entirely. It is optional in the MCP spec. Removing it restores every client immediately at the cost of advertising structured output, and would make a good stopgap release while option 1 lands.

Spec note

[SEP-1613](https://modelcontextprotocol.io/seps/1613-establish-json-schema-2020-12-as-default-dialect-f) (Final) makes 2020-12 the default dialect but permits servers to declare another via $schema, and requires clients to validate against the declared dialect. So this is arguably a shared problem — strict clients are rejecting something the spec allows. That said, servers MUST "generate schemas conforming to 2020-12 by default," and moving this server to 2020-12 fixes it for every affected client without waiting on any of them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions