Files
hx/docs/adr/0027-mcp-lazy-tool-registration.md
T
johannesandClaude Sonnet 5.5 a94632ea3d chore: delete code comments, add ratchet lint and ADRs
Classify every comment as tautology, stale, excuse or decision record.
Tautology/stale/excuse comments are deleted (excuses filed as issues
#196-#236), decisions moved to docs/adr/0001-0034.

- scripts/lint-comments.sh + .comment-baseline: per-file comment count
  may only go down; wired into tests/all.sh
- .claude/skills/delete-comment: repeatable audit workflow
- cargo fmt applied to touched crates

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-21 13:37:32 +01:00

709 B

Lazy MCP tool registration

Status: accepted

Context

Full MCP tool schemas cost many prompt tokens, but a lazy index costs an extra mcp_describe round trip. Startup listing must not stall a server for the full tool-call timeout.

Decision

Default to a one-line-per-tool index; the model fetches schemas with mcp_describe and calls via mcp_call. Servers whose schemas fit in EAGER_MAX_TOKENS (or eager: true) register natively, since below the threshold the saved tokens do not pay for the round trip. Startup listing uses its own shorter timeout.

Consequences

Smaller prompts for large servers; two modes to maintain.

Code: crates/hx-mcp/src/lib.rs (module, EAGER_MAX_TOKENS, connect)