Skip to content

feat!: fold the per-type document tools into get-document / get-document-file - #65

Merged
marselsel merged 1 commit into
mainfrom
feat/consolidate-document-tools
Sep 22, 2026
Merged

marselsel merged 1 commit into
mainfrom
feat/consolidate-document-tools

Conversation

@marselsel

Copy link
Copy Markdown
Owner

Part 7 of 8 in the MCP best-practices stack. Stacked on #64, so merge in order.

Breaking: 14 tool names go away. This PR is near the top of the stack on purpose, so it can be closed without touching the earlier PRs. Only #66 builds on it and would need a rebase.

Why

53 tools at the default tier add up to about 80 KB of tool definitions (roughly 20k tokens) in every conversation. Anthropic's tool guidance says tool selection gets worse past 30–50 tools, and advises consolidating. get-document(id, voucherType) and get-document-file(resourceType, id, format) already did the same job as the per-type tools for every type.

Changes

  • Removed: get-invoice, get-quotation, get-credit-note, get-order-confirmation, get-delivery-note, get-dunning, get-down-payment-invoice, and the seven render-<type>-pdf tools. The default tier goes from 53 to 39 tools.
  • get-document: voucherType is now a published enum instead of a free string, and the description lists every type it reaches, including dunning, which the voucherlist does not list.
  • get-document-file: the description now names the types that can return XML (XRechnung invoices, credit notes, down payment invoices). That was the one thing the render tools expressed in their schema. XML requests for other types are still refused before a request is spent.
  • References: get-voucher, download-file and the types.ts comment no longer point at removed tools. The handler-cost comment in server.ts notes that its figures were measured at 53 tools.

Trade-offs

  • Saved prompts or client configs that name a removed tool need updating.
  • The per-type render tools advertised format only where XML is possible. get-document-file states that in its description and refuses at runtime instead.

Verification

  • The file-format tests are ported to get-document-file, and one test now covers which resources accept XML.
  • A new test checks that get-document reaches each of the seven document endpoints.
  • npm test passes all 477 tests.

…ent-file

Removes get-<type> (7) and render-<type>-pdf (7): get-document and
get-document-file already covered every type. The default tier drops from
53 to 39 tools. get-document's voucherType becomes a published enum, and
get-document-file's description names the types that can return XML,
which the render tools used to say in their schema.

BREAKING CHANGE: saved prompts or client configs naming a removed tool
need to use get-document / get-document-file instead.
@marselsel
marselsel changed the base branch from docs/static-headers-and-output-schema to main September 22, 2026 21:57
@marselsel
marselsel merged commit e786551 into main Sep 22, 2026
2 checks passed
@marselsel
marselsel deleted the feat/consolidate-document-tools branch September 22, 2026 21:57
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.

1 participant