Repository navigation
mcp: add tool annotations to render, lint and read_docs - #27
Merged
Merged
Conversation
All three tools only read: render and lint are pure functions of their input and read_docs fetches pages from emailmd.dev. Declare that with explicit readOnlyHint/destructiveHint/idempotentHint/openWorldHint so clients do not fall back to the spec defaults (destructiveHint and openWorldHint default to true), and repeat the tool title in annotations.title for clients that read it from there.
|
@theluckystrike is attempting to deploy a commit to the unmta Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
@theluckystrike thanks for the contribution! |
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.
What was missing
The three MCP tools (
render,lint,read_docs) are registered withoutannotations, sotools/listreturns noreadOnlyHint,destructiveHintoropenWorldHint. Under the MCP spec'sToolAnnotationsdefaults, a tool without hints is treated as possibly destructive (destructiveHintdefaults totrue) and open-world (openWorldHintdefaults totrue).Why it matters
readOnlyHintordestructiveHinton every tool, and OpenAI's app review checksreadOnlyHint,destructiveHintandopenWorldHinton every tool.The change
I read each handler before choosing the values:
renderlintread_docsThe values live in one
READ_ONLY_ANNOTATIONSconstant insrc/mcp.ts, and each tool also getsannotations.title(same as its existingtitle). A test intests/mcp.test.tsasserts the annotations on every listed tool.How I verified
npx vitest runinpackages/emailmd: 991 passed (990 before, plus the new test)npx tsc --noEmit -p packages/emailmd: cleannpm run buildandnpm run lintat the root: cleanFound with the free McpStamp check (mcpstamp.com/check).