Repository navigation
feat(mcp-server-kit): tool title, output schema and idempotent/open-world hints - #22
Merged
Merged
Conversation
…orld hints Products that advertise output schemas today (SendLit's 68 tools) lose them when they move onto the kit. Tool definitions now take an optional title, outputSchema and the two annotation hints risk does not set; tools/list advertises them and the SDK validates structuredContent against the output schema.
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
McpToolDefinitiontakes three optional fields:title: a human-readable name for clients.outputSchema: a Zod object schema. It's converted once per process, the same way input schemas are (refs inlined, no$schema), and advertised intools/list. The SDK checks a successful result'sstructuredContentagainst it. A non-object schema throws when the kit is created.annotations: { idempotentHint?, openWorldHint? }:riskstill decidesreadOnlyHintanddestructiveHint, so a product can't contradict it.Tools without these fields are unchanged.
Why
SendLit is moving its MCP server onto the kit, following CourseLit's pattern. Its tools advertise output schemas, titles and these hints today, and without this change the migration would drop them from
tools/list.Testing
bun testinpackages/mcp-server-kitpasses (19, 2 of them new: advertising the new fields, rejecting a result that breaks its output schema, and refusing a non-object output schema). Typecheck and Biome are clean. Includes a minor changeset.