Expand description
Tool schema compaction utilities for session tool catalog.
Constants§
- MCP_
TOOL_ DESCRIPTION_ MAX_ LEN - Default max description length for MCP tool descriptions. MCP tools from external servers can have arbitrarily long descriptions; capping them prevents token inflation. The cap applies in every mode and never raises a mode’s own limit.
- MINIMAL_
DESCRIPTION_ MAX_ CHARS - Minimal mode sends only the first sentence of a tool description, capped at this many characters, and strips parameter descriptions.
- PROGRESSIVE_
DESCRIPTION_ MAX_ CHARS - Progressive mode (the default) keeps whole leading sentences of a tool description up to this many characters. Builtin descriptions are limited to 1500 characters by the description contract test, matching this cap, so they reach the model intact; only unusually long tails are dropped, at a sentence boundary.
- PROGRESSIVE_
PARAMETER_ DESCRIPTION_ MAX_ CHARS - Progressive mode keeps parameter descriptions, trimming each one to whole leading sentences within this many characters.
Functions§
- compact_
parameters - Project a parameter schema for the given documentation mode.
- compact_
tool_ description - Project a tool description for the given documentation mode.
- default_
parameter_ schema - remove_
schema_ descriptions