Skip to content

API: operation summaries are names, so every docs title fits in 60 characters - #989

Merged
R44VC0RP merged 2 commits into
devfrom
seo/api-summaries
Nov 26, 2026
Merged

R44VC0RP merged 2 commits into
devfrom
seo/api-summaries

Conversation

@R44VC0RP

Copy link
Copy Markdown
Collaborator

Step 1 of the docs plan. 52 API operation summaries were sentences. A summary is the docs page's title (<summary> · Nightmail API docs), the sidebar entry and the SDK's comment, so those 52 docs titles ran past the 60 characters a search result shows. Now each summary is a short name. Its sentence moved, word for word, to the start of the operation's description.

The three worst titles

Before After
Grant mail client access to a persistent inbox. Password shown once; a billable day starts immediately. · Nightmail API docs (124) Create an inbox app password · Nightmail API docs (49)
Trace saved or proposed rules on a stored message or pasted MIME; never asks the AI or delivers mail · Nightmail API docs (121) Test rules on a message · Nightmail API docs (44)
Generate client config with a key limited to selected inboxes. Key shown once. · Nightmail API docs (99) Create an inbox connection · Nightmail API docs (47)

After this, the longest docs title is 60 characters.

Only words move

  • api/openapi.json is identical apart from operation summaries and descriptions. check-api-contract (base vs head): 0 breaking changes.
  • SDK: sdk/src/sdk.gen.ts is the only generated file that changes. With comments removed by the TypeScript printer, base and head are identical (224,986 characters each), so the non-comment diff is empty.
  • MCP: all 244 tools have the same names; none added, removed or renamed.

Nothing is lost

  • 41 sentences moved: 16 now start an existing description, and 25 operations got their first description.
  • 11 summaries were reworded where the description already said the same thing. For example, "Change a rule’s recipe fields and addresses" became "Update a rule from its recipe", above "Rewrites the rule from its recipe with these fields. addresses, when given, replaces where it runs…".
  • createInboxAppPassword's description starts with the warning: "Password shown once; a billable day starts immediately. Grant mail client access to a persistent inbox." The page's search description reads "Create an inbox app password: POST /v1/inboxes/{id}/app-passwords. Password shown once; a billable day starts immediately. …"

What agents see

A tool's description is built in mcp-catalog.ts descriptionFor: the summary, then the description's sentences, up to 400 characters.

  • One change there: when the description opens with the summary's words, they are said once. Without it, the moved sentences would repeat the name and push a later sentence past 400 (listInboundEndpoints would have lost its addressId sentence). At the base, only sendFeedback's description opened with its summary, and it has its own fixed text. So this reaches only the operations moved here.
  • Of the 52: 8 aren't MCP tools; 20 tools read the same as before; 24 now lead with the short name, then the same sentences. The warning is still in every tool that had one. The only sentences gone from a tool are redeliverInboundMessage's and getBilling's old summaries; their descriptions say the same.
  • The budgeted lists don't change: the plain tools/list that the 50,000-byte budget measures (customer 46,500, operator 48,386) is built from resource labels and action notes, never from operation summaries. Its tools are byte-identical before and after (45,846 bytes for the whole catalog). CI's acceptance run prints both sizes.
  • Code Mode list (/mcp?codemode=true, not budgeted): 1,033,338 → 1,033,891 bytes (+553).

The check

scripts/check-premerge.ts adds a 12th check, explained in docs/ci.md under "Operation summaries". It refuses a summary with a full stop, colon or semicolon followed by more words, or one that makes the docs title longer than 60 characters. It measures with the app's own docsTitle, which allows 39 characters, not the 45 first proposed: the title adds 21 characters ( · Nightmail API docs), so 45 would allow titles of 66. The message says to keep a short name and move the sentence to the description, warnings first, then run bun run sdk. Against the base's openapi.json, it fails exactly these 52 operations.

For the reviewer

  1. Read the table below: is any short name wrong, or anything lost?
  2. Check the descriptionFor change in api/src/mcp-catalog.ts.
  3. Check the new check in check-premerge.ts.

Checked

  • bun run sdk, bun run check (api) and check-premerge all pass.
  • check-api-contract, base vs head.
  • The comment-stripped SDK comparison.
  • Before and after tool descriptions and list sizes, from buildMcpCatalog and resourceTools.
  • VITE_HOME=tv bun run build: every docs title is 60 characters or fewer.

The 52

Operation Summary before Summary after The sentence MCP tool text
listAgents List connected agents and their agent tokens List agents starts the description not a tool
revokeAgent Revoke a connected agent and its agent tokens Revoke an agent description already says it not a tool
exchangeAgentSetupToken Exchange a setup token for the agent's API key Exchange a setup token for an API key description already says it not a tool
startAgentDeviceAuthorization Start the device flow for a coding agent Start the device flow for an agent description already says it not a tool
lookUpAgentDevice Look up an agent waiting with a user code Look up an agent by user code description already says it not a tool
approveAgentDevice Approve an agent waiting with a user code Approve an agent by user code description already says it not a tool
restoreRuleVersion Recompile a retained version and restore it as a new version Restore a rules version new description +25 chars
setDecisionOptIns Set the domains and routes whose mail the AI may read for decisions Set the AI decision opt-ins new description +29 chars
createEndpoint Create a named Slack, Discord, webhook or forward endpoint Create an endpoint starts the description same
getEndpoint Read one endpoint, its status and the next step Read an endpoint new description +18 chars
updateEndpoint Edit an endpoint: its name, type, URL, pause state, rate or retry policy Edit an endpoint starts the description same
deleteEndpoint Delete an endpoint no rule or route uses Delete an endpoint new description same
sendEndpointVerification Email a forward recipient a new confirmation link Resend a forward confirmation link starts the description same
testEndpoint Post a fixed test message to a Slack, Discord or webhook endpoint now Test an endpoint starts the description +18 chars
createInboxConnection Generate client config with a key limited to selected inboxes. Key shown once. Create an inbox connection new description same
getRuleVersion Read the rules and routes version, or wait for it to change Read or wait for the rules version starts the description not a tool
checkRule Compile one rule source against this workspace without saving Check a rule without saving it starts the description same
getRuleTypings TypeScript declarations and editor completions for this workspace Read the rules’ TypeScript declarations starts the description same
listRuleTemplates Starting points for common rules, filled in with this workspace’s endpoints List rule templates starts the description same
listRuleRecipes Ready-made rules and the fields each one takes List rule recipes starts the description same
createRuleFromRecipe Create a rule from a recipe and attach it to addresses Create a rule from a recipe description already says it same
updateRuleFromRecipe Change a rule’s recipe fields and addresses Update a rule from its recipe description already says it same
attachRules Attach, reorder and detach rules by replacing the ordered attachment list Attach rules new description same
getRules Read rules, ordered attachments, and sender lists Read rules new description same
applyRules Create, replace or remove rules and ordered attachments in one version Apply rules new description same
testRules Trace saved or proposed rules on a stored message or pasted MIME; never asks the AI or delivers mail Test rules on a message new description same
listInboxFolders List folders, stable UID namespaces and counts List inbox folders new description +20 chars
updateInboxFolder Rename a folder tree or change its subscription Update an inbox folder new description +24 chars
deleteInboxFolder Remove a custom folder; preserve otherwise orphaned mail in Trash Delete an inbox folder new description +24 chars
updateInboxMessage Set read state or flags; deleted applies to one folder entry Update an inbox message new description +25 chars
deleteInboxMessage Move one entry to Trash, or expunge it permanently Delete an inbox message new description +25 chars
moveInboxMessage Move one entry and allocate a new destination UID Move an inbox message new description +23 chars
copyInboxMessage Copy one entry with a fresh destination UID Copy an inbox message new description +23 chars
expungeInboxFolder Remove entries marked deleted; repeat while hasMore is true Expunge an inbox folder new description +25 chars
getInboxChanges Sync changed and removed message IDs since an inbox MODSEQ Read an inbox’s changes new description +25 chars
createInboxAppPassword Grant mail client access to a persistent inbox. Password shown once; a billable day starts immediately. Create an inbox app password new description, warning first +30 chars
listInboxAppPasswords List active app passwords without their secrets List an inbox’s app passwords new description +31 chars
listAppPasswords List the active app passwords of every inbox, without their secrets List every inbox’s app passwords new description +34 chars
revokeInboxAppPassword Revoke a mail client password and invalidate sessions Revoke an inbox app password new description +30 chars
releaseRetiredAddress Release a retired address for reuse (workspace admin) Release a retired address new description same
setInboundAddressFlow Change where one address’s mail goes, in one version Set where an address’s mail goes starts the description +34 chars
createInboundThread Start a conversation from an inbound address Start a conversation new description same
updateInboundThread Mark a conversation read, star, archive or label it for one address Update a conversation new description +23 chars
getInboundAttachment Download an attachment from a visible message Download an inbound attachment new description +32 chars
downloadInboundAttachment Follow an attachment link from a webhook Follow a webhook attachment link description already says it not a tool
getInboundOverview Every route mail can take, with its rules and endpoints, in one read Read the receiving overview starts the description same
listInboundEndpoints List every endpoint a page at a time, with the routes and rules that use it List every endpoint starts the description same
listInboundEvents Poll events for the receiving addresses this key can read List inbound events starts the description +21 chars
listInboundWebhooks List inbound webhooks a page at a time, in a stable ID order List inbound webhooks starts the description same
redeliverInboundMessage Redeliver a message to its route webhooks Redeliver an inbound message description already says it −13 chars
getOverviewSetup What this workspace has set up, in one read Read the workspace setup starts the description +26 chars
getBilling Balance, free allowance and billing state Read the balance and billing state description already says it −7 chars

…tions

52 operation summaries were sentences (up to 103 characters). A summary is the docs page's title
in the browser tab and search results ("<summary> · Nightmail API docs"), the docs sidebar entry
and the SDK's comment, so those 52 docs titles ran past the 60 characters a search result shows
(the worst at 124). Each now has a short name, and its sentence moved word for word to the start
of the operation's description (a new description where it had none), unless the description
already said it (11, listed in the PR). "Password shown once; a billable day starts immediately"
is the first thing createInboxAppPassword's description says.

- Only words: openapi.json is identical apart from operation summaries and descriptions;
  check-api-contract reports 0 breaking changes; the regenerated sdk/src/sdk.gen.ts is identical
  once comments are removed (TypeScript printer); no MCP tool is added, removed or renamed (244).
- MCP: a tool's description is its summary, then the description's sentences up to 400
  characters (mcp-catalog.ts descriptionFor). Where the description now opens with the words the
  summary had, descriptionFor says them once instead of twice, so the moved sentences don't
  push a later sentence past the 400 (listInboundEndpoints would have lost one). That rule
  reaches only the moved operations (at the base only sendFeedback's description opened with its
  summary, and it has its own text). 220 of 244 tool descriptions are unchanged; 24 gain the
  short name (+553 bytes on a 1.03 MB Code Mode listing). The plain tools/list the 50,000-byte
  budget measures is built from resource labels and action notes, not summaries: byte-identical.
- scripts/check-premerge.ts (12, docs/ci.md "Operation summaries") refuses a summary with a full
  stop, colon or semicolon followed by more words, or one that makes the docs title longer than
  60 characters (39 for a summary), using the app's own docsTitle. It fails all 52 at the base.

Verified: bun run sdk; bun run check (api); check-premerge (passes; against the base openapi.json
it fails exactly these 52); check-api-contract base vs head; VITE_HOME=tv bun run build, longest
docs title 60 characters.
The sentence left the summary in the previous commit, where it showed in the docs title and the
sidebar, and became the second sentence of the description. A warning goes first, as for
createInboxAppPassword and as docs/ci.md's "Operation summaries" fix says. The MCP tool text is a
hand-written override that already says the key is returned once, so agents read the same.

Verified: bun run sdk (openapi.json and sdk.gen.ts comment only); check-premerge passes; the ten
operations the review judged to carry a warning each open their description with it.
@R44VC0RP
R44VC0RP enabled auto-merge November 26, 2026 18:51
@R44VC0RP
R44VC0RP added this pull request to the merge queue Nov 26, 2026
Merged via the queue into dev with commit efa7702 Nov 26, 2026
15 checks passed
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