Skip to content

Tool inputSchemas inline whole Notion object trees per tool — ~21k tokens of definitions per session #330

Description

@lCrazyblindl

The server's 24 tools cost ~21,411 tokens (tiktoken cl100k) at tools/list — the heaviest of 20 popular servers we measured (https://github.com/lCrazyblindl/lap/blob/main/docs/MCP-LEADERBOARD.md). The descriptions are terse (nice!); the weight is schemas: API-update-page-markdown ~1469 tokens, API-post-search ~1258 — the same Notion object subtrees inlined into tool after tool.

Measured: hoisting identical repeated subtrees (≥120 chars, seen ≥2×) into shared $defs saves ~14,811 tokens (~69%) on its own, before any semantic slimming. The 2026-07-28 MCP spec explicitly allows $ref/$defs in inputSchema (SEP-2106), so the compatibility risk that used to argue for inlining is going away. Separately, 12 tools declare parameters without descriptions. Method + script: https://github.com/lCrazyblindl/lap/blob/main/docs/UPSTREAM-ISSUES.md.

Happy to contribute the $defs hoisting or the measurement harness. (Disclosure: I maintain lap, the measurement tool; MIT, no product.)

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