Skip to content

feat(mcp): expand the MCP server, describe and annotate its tools - #1123

Open
jmylchreest wants to merge 2 commits into
TomBursch:mainfrom
jmylchreest:feat/mcp-tool-metadata
Open

feat(mcp): expand the MCP server, describe and annotate its tools#1123
jmylchreest wants to merge 2 commits into
TomBursch:mainfrom
jmylchreest:feat/mcp-tool-metadata

Conversation

@jmylchreest

@jmylchreest jmylchreest commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Builds on #1121. This is a cross-fork PR so I can't set that as the base, and the diff below includes it. The commit to review here is the second one, feat(mcp): Describe and annotate tools, bound list responses.

Every tool is advertised as KitchenOwl tool: <name> with no parameter descriptions, so a model has to infer what things do from the name alone. Tools now carry a written description, a title, per-parameter descriptions, and readOnly/destructive/idempotent/openWorld annotations.

list_recipes returned obj_to_full_dict() for every recipe in the household, method body and nested household included, with no limit. It now returns summaries, and every list tool takes limit/offset and reports total and has_more. Page size is capped at 200.

Tool failures come back as isError results rather than JSON-RPC protocol errors, which is what the spec asks for and lets the model recover. Unexpected exceptions are logged and replaced with a generic message rather than returning str(e).

There is more behind this. Each link shows only that branch's own changes:

Branch Change
socket events +127/-1 MCP writes don't emit the socket events the REST endpoints do, so open apps show a stale list
workflow tools +385/-12 add_recipe_items_to_list, bulk add, categories
token scopes +327/-51 read/write/full scopes on long-lived tokens, optionally pinned to one household
attribution +180/-18 record which token added an item
item reuse +200/-53 report when a tool invents a new household item instead of reusing one
suggestions +226 expose the existing nightly recipe ranking
planner history +131 planner changes via MCP don't write RecipeHistory, so they never feed suggestions
docs +121 documentation, closes #901

How would you like me to submit the subsequent PRs, if at all you'd like me to?

The HTTP+SSE transport never worked. The stream emitted only ping events
and never `event: message`, while /mcp/messages returned JSON-RPC replies
in the POST body. Under the 2024-11-05 transport the client reads replies
off the stream, so any conforming client hung after initialize. The
generated session id was never stored or looked up either.

Sessions are now tracked per worker, replies are delivered over the
stream, and POSTs return 202. A session may only be written to by the
user who opened it. The announced endpoint is relative so it stays
correct behind a reverse proxy.

Adds Streamable HTTP on POST /mcp, implemented statelessly so it works
across multiple workers, with GET/DELETE answering 405 as the spec
allows. protocolVersion is now negotiated against the versions actually
supported rather than hardcoded to 2024-11-05, and notifications and
JSON-RPC batches are handled properly.

Verified against Claude Code over both transports.
Every tool was advertised as "KitchenOwl tool: <name>" with undescribed
parameters, leaving the model to infer semantics from the name alone.
Tools now carry a written description, a title, per-parameter
descriptions, and readOnly/destructive/idempotent/openWorld annotations,
so a client can tell reading from writing and prompt accordingly.

list_recipes returned obj_to_full_dict for every recipe in the
household, method body and nested household included, with no limit. It
now returns summaries and every list tool takes limit/offset and reports
total and has_more. Page size is clamped to 200.

Tool failures are reported as isError results rather than JSON-RPC
protocol errors, which is what the spec asks for and lets the model
recover. Unexpected exceptions are logged and replaced with a generic
message instead of returning str(e) to the caller.
@TomBursch TomBursch added the enhancement New feature or request label Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: MCP Server

2 participants