Skip to content

feat(mcp): add compact descriptor mode#43

Merged
ScottRBK merged 1 commit into
ScottRBK:mainfrom
bertheto:feat/compact-mcp-descriptors
May 10, 2026
Merged

feat(mcp): add compact descriptor mode#43
ScottRBK merged 1 commit into
ScottRBK:mainfrom
bertheto:feat/compact-mcp-descriptors

Conversation

@bertheto

Copy link
Copy Markdown
Contributor

Summary

  • Adds opt-in MCP_DESCRIPTOR_MODE=compact for shorter MCP meta-tool descriptions.
  • Keeps verbose as the default so existing users retain the current inline guidance.
  • Preserves the three meta-tool names, schemas, registry behavior, and execution payloads.

Why

Some MCP clients load tool descriptions into the model context at startup. Forgetful already uses the right meta-tool pattern, but the discover_forgetful_tools and execute_forgetful_tool descriptions embed long examples and catalogs. Compact mode lets context-sensitive clients keep those descriptors small while still fetching full schemas/examples on demand via how_to_use_forgetful_tool.

Validation

  • uv run pytest tests/integration/test_meta_tools_docstrings.py -> 25 passed.
  • uv run python -m compileall app/routes/mcp/meta_tools.py app/config/settings.py -> passed.
  • Local compact descriptor check via main.mcp.list_tools() -> 3 tools, 1,442 total description chars (discover 506, how_to_use 321, execute 615).
  • uv run pytest tests/e2e_sqlite/test_meta_tools_sqlite.py was attempted but blocked during setup because FastEmbed attempted a HuggingFace model download and the remote connection was closed.

Compatibility

  • Default behavior remains MCP_DESCRIPTOR_MODE=verbose.
  • Unknown descriptor mode values fall back to verbose.
  • No inner tool schemas, adapters, registry behavior, or response payloads are changed.

Keep verbose meta-tool descriptions as the default while allowing clients to opt into shorter MCP descriptors for context-sensitive environments.
@ScottRBK ScottRBK merged commit 445f37e into ScottRBK:main May 10, 2026
2 checks passed
@bertheto bertheto deleted the feat/compact-mcp-descriptors branch May 18, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants