feat!: fold the per-type document tools into get-document / get-document-file - #65
Merged
Merged
Conversation
…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
changed the base branch from
docs/static-headers-and-output-schema
to
main
September 22, 2026 21:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 7 of 8 in the MCP best-practices stack. Stacked on #64, so merge in order.
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)andget-document-file(resourceType, id, format)already did the same job as the per-type tools for every type.Changes
get-invoice,get-quotation,get-credit-note,get-order-confirmation,get-delivery-note,get-dunning,get-down-payment-invoice, and the sevenrender-<type>-pdftools. The default tier goes from 53 to 39 tools.get-document:voucherTypeis now a published enum instead of a free string, and the description lists every type it reaches, includingdunning, 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.get-voucher,download-fileand thetypes.tscomment no longer point at removed tools. The handler-cost comment inserver.tsnotes that its figures were measured at 53 tools.Trade-offs
formatonly where XML is possible.get-document-filestates that in its description and refuses at runtime instead.Verification
get-document-file, and one test now covers which resources accept XML.get-documentreaches each of the seven document endpoints.npm testpasses all 477 tests.