Skip to content

feat: server instructions, title and description - #60

Merged
marselsel merged 1 commit into
mainfrom
feat/server-instructions
Sep 22, 2026
Merged

marselsel merged 1 commit into
mainfrom
feat/server-instructions

Conversation

@marselsel

Copy link
Copy Markdown
Owner

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

Why

The server sent only name and version. The MCP instructions field is the place to explain how the tools fit together, which no single tool description can do. Anthropic's MCP server guidance calls it the highest-leverage addition. Claude's review treats instructions that command the model as prompt injection, so this text states facts instead.

Changes

  • New src/instructions.ts: builds the instructions from the enabled capability tiers, so they never mention a tool the server didn't register. They cover:
    • the ~2 req/s limit, and the tools that page server-side (summarize-vouchers, get-vouchers)
    • finding a document by number (the voucherNumber filter)
    • going from a voucherlist row to the document and its PDF (get-document, get-document-file)
    • the two date formats
    • why a wrong draft can't be fixed through the API
    • the upload-ticket flow
    • the finalize warning, only when that tier is on
  • serverInfo: gains title, description and websiteUrl. Clients receive the instructions in the initialize result, or via server/discover on the 2026-07-28 protocol.

Verification

  • tests/instructions.test.ts covers every tier (read-only, default, finalize): each tool the text names must be registered in that tier, a read-only server says it is read-only, and the finalize line appears only when that tier is on.
  • Over the wire, on the built server, initialize returned the new serverInfo fields and the instructions.
  • npm test passes all 467 tests.

The initialize result now carries instructions on how the tools fit
together (rate limit and the server-side paging tools, lookup by number,
voucherlist row -> document/PDF, date formats, drafts that cannot be fixed
after creation, the upload-ticket flow). They are built from the enabled
tiers, and a test checks every tool they name is registered for that
tier. serverInfo gains title, description and websiteUrl.
@marselsel
marselsel changed the base branch from feat/tool-titles-destructive-hints to main September 22, 2026 21:56
@marselsel
marselsel merged commit b53ebf1 into main Sep 22, 2026
2 checks passed
@marselsel
marselsel deleted the feat/server-instructions 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