Skip to content

JSON Schema Validation Fails Due to $dynamicRef and Draft 2020-12 #6

Closed

Description

@YuriiMurha

Issue description

When running the MCP server with the @chaindead/telegram-mcp integration, I receive errors indicating that the tool schemas use features from JSON Schema Draft 2020-12 (specifically $dynamicRef) that are not supported by the current validator. All Telegram tool schemas (tg_dialog, tg_dialogs, tg_me, tg_read, tg_send) are rejected as invalid.

Details:

  • The schemas specify "$schema": "https://json-schema.org/draft/2020-12/schema".
  • The error message is: The schema uses meta-schema features ($dynamicRef) that are not yet supported by the validator. (at /$schema)
  • This prevents the Telegram MCP tools from working as expected.

Environment:

  • MCP server launched via VS Code using npx @chaindead/telegram-mcp
  • Windows 11
  • Authenticated successfully

Suggested Solution:

  • Either update the validator to support Draft 2020-12 and $dynamicRef,
  • Or downgrade the schemas to Draft-07 and remove $dynamicRef usage.

MCP Log

[warning] 5 tools have invalid JSON schemas and will be omitted

Full error log

Tool `tg_dialog` has invalid JSON parameters:
	- The schema uses meta-schema features ($dynamicRef) that are not yet supported by the validator. (at /$schema)
	- Schema: {"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"name":{"type":"string","description":"Name of the dialog"},"offset":{"type":"integer","description":"Offset for continuation"}},"type":"object","required":["name"]}

Tool `tg_dialogs` has invalid JSON parameters:
	- The schema uses meta-schema features ($dynamicRef) that are not yet supported by the validator. (at /$schema)
	- Schema: {"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"offset":{"type":"string","description":"Offset for continuation"},"only_unread":{"type":"boolean","description":"Include only dialogs with unread mark"}},"type":"object"}

Tool `tg_me` has invalid JSON parameters:
	- The schema uses meta-schema features ($dynamicRef) that are not yet supported by the validator. (at /$schema)
	- Schema: {"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{},"type":"object"}

Tool `tg_read` has invalid JSON parameters:
	- The schema uses meta-schema features ($dynamicRef) that are not yet supported by the validator. (at /$schema)
	- Schema: {"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"name":{"type":"string","description":"Name of the dialog"}},"type":"object"}

Tool `tg_send` has invalid JSON parameters:
	- The schema uses meta-schema features ($dynamicRef) that are not yet supported by the validator. (at /$schema)
	- Schema: {"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"name":{"type":"string","description":"Name of the dialog"},"text":{"type":"string","description":"Plain text of the message"}},"type":"object","required":["name","text"]}

Activity

  1. chaindead commented on May 9, 2025

    @chaindead
    Owner

    what mcp tool in vs code you are using?

  2. YuriiMurha commented on May 11, 2025

    @YuriiMurha
    Author

    what mcp tool in vs code you are using?

    GitHub Copilot. I pick "Select tools" -> "Add more tools" -> "Add MCP Server".

    Here's the config settings:

    Image

  3. YuriiMurha commented on May 27, 2025

    @YuriiMurha
    Author

    @chaindead If you meant which particular tools of the @chaindead/telegram-mcp MCP Server I was to run, then none, because VS Code showed this warning and did not load the server at all, so I wasn't able to use it.

  4. chaindead commented on May 29, 2025

    @chaindead
    Owner

    try to update your mcp client, i think this issie is client side

  5. oshliaer commented on Jul 8, 2025

    @oshliaer

    @YuriiMurha any updates?

  6. chaindead commented on Feb 27, 2026

    @chaindead
    Owner

    I've opened #16 with a configurable approach to this — adds a --schema-version CLI flag (and TG_SCHEMA_VERSION env var) so users can set https://json-schema.org/draft-07/schema# for VS Code compatibility without changing the default for clients that already support Draft 2020-12.

    This builds on the same root cause identified here and in #11 (invopop/jsonschema defaulting to Draft 2020-12), but keeps the fix opt-in rather than a hard override.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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