Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Ajv defaults: non-standard "format": "json" in third-party schemas (e.g. Notion) warns twice per property — register it like #2601

Open Beginner friendly
#2,854 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
70/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active

Research direction

Look at the createDefaultAjvInstance function in the SDK's validator module. The issue is about adding a no-op format for 'json' to Ajv instances to suppress warnings. Check how 'google-duration' was registered in issue #2601 as a reference. The change involves modifying the default validator setup to include ajv.addFormat('json', true) for all three dialect engines (Ajv2020, Ajv2019, Ajv). After making the change, test with the provided reproduction code to ensure warnings are gone.

Written by the indexing model from the issue text.

Description

Context

This is the same class of noise as #2601 (google-duration), with an instance found in the wild.

The Notion MCP server's post-page tool annotates two string properties with "format": "json" — a value that is defined neither by JSON Schema nor by ajv-formats. Compiling that inputSchema through the default validator instances of @modelcontextprotocol/client@2.0.0 (createDefaultAjvInstance: { strict: false, allErrors: true } + ajv-formats) logs, per compile:

unknown format "json" ignored in schema at path "#/properties/icon"
unknown format "json" ignored in schema at path "#/properties/icon"
unknown format "json" ignored in schema at path "#/properties/cover"
unknown format "json" ignored in schema at path "#/properties/cover"

Two lines per property, because allErrors: true makes Ajv compile the format check twice — i.e. connecting to that one server costs 4 lines of client-side warning output per session.

It is not purely cosmetic: with Ajv's own defaults (strict: true) the same schema throws during compile (Error: unknown format "json" ignored in schema at path "#/properties/icon"), so any integrator who wants a strict validator cannot load that tool.

Ask

  1. Register json as a no-op format (ajv.addFormat("json", true)) in createDefaultAjvInstance, for all three dialect engines, alongside the google-duration registration proposed in #2601; or
  2. Downgrade the unknown-format message to debug-level output, so quirks in third-party schemas don't surface as user-visible warnings.

Note on custom validator providers

Consumers that pass their own Ajv instance to AjvJsonSchemaValidator bypass the default instances entirely, so registering formats there does not help them — e.g. a downstream extension that constructs its own validator provider still gets the warnings until it registers json itself. Worth a line in the validator docs.

Environment / reproduction

@modelcontextprotocol/client 2.0.0 · ajv 8.20.0 · node 24.12.0

import Ajv2020 from "ajv/dist/2020.js";
import addFormats from "ajv-formats";

const ajv = new Ajv2020({ strict: false, allErrors: true });  // mirrors createDefaultAjvInstance
addFormats(ajv);

ajv.compile({
  type: "object",
  properties: {
    icon:  { type: "string", format: "json" },
    cover: { type: "string", format: "json" },
  },
});
// -> the four "unknown format" lines above

Filed after reproducing the behaviour locally with the reporter's coding agent; outputs above are from that run and can be provided on request.

Dominant language
TypeScript
Stars
13.4k
Forks
2.2k
Avg merge
4d 18h
Merged PRs (30d)
6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from modelcontextprotocol/typescript-sdk

All issues in modelcontextprotocol/typescript-sdk

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.