Bring the Plans MCP tool reference in line with the server - #40
Open
tpavlu wants to merge 1 commit into
Open
Conversation
Also document Create's kind and initiative parameters, and note which MCP sessions get the review tools.
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 changed and why
plans/install/index.mdxis the canonical list of tools the Ref Plans MCP server exposes, and it was missing three that the server registers. The consequential one isview_media:Readhands back image markdown as rawref-media://URIs that are not fetchable directly, andrich-content.mdxalready promises agents can view the pixels — so an agent built from the published list could read a plan full of images with no documented way to see any of them.RenameandAwaitReviewwere also absent,Createhas gainedkindandinitiative, and two review capabilities are registered for only some kinds of session, whichplans/collaboration/reviews.mdxdescribed with no caveat.Verified
All in
ref-tools/ref:view_mediaexists in both modes — registered inplan-app/server/src/routes/mcpPlanServer.tsandmcpGeneralServer.ts. Behaviour read from the handler,plan-app/server/src/utils/mcpViewMediaToolHandler.ts:sizedefaults tostandardand acceptsthumb/standard/original;formatdefaults tourland returns a signed link with anexpiresAt;format: "image"downloads the object and returns a base64 MCP image block.ref-media://non-fetchability and the "callview_media" instruction are in theReadtool description inplan-app/server/src/routes/mcpToolDefinitions.ts.Renameexists in both modes — registered in both server factories; the schema istitle(plusplanIdin general mode) and the description says it sets the plan's title (mcpToolDefinitions.ts).AwaitReviewexists in both modes, user-driven sessions only — both factories register it inside anif (userDriven)guard. The 50-second hold isAWAIT_REVIEW_WINDOW_MS = 50_000inplan-app/shared/reviewWaitTiming.ts, consumed as the default window byrunAwaitReviewinplan-app/server/src/utils/awaitReviewTool.ts, which returns a pending result telling the model to call again when the window expires.Createparameters —mcpToolDefinitions.ts:title,initial_content,kind(plan|explanation|receipt, defaultplan),initiative.PLAN_CREATED_INITIATIVESis['user', 'agent']inplan-app/shared/types.ts.mcpGeneralServer.tsstripsinitiativefrom the schema for non-user-driven sessions and drops it at write time.isUserDrivenSessioninplan-app/server/src/utils/mcpAudience.tsis true only for API-key auth with no agent id, nointernalflag, and a non-in-process connection. The signals are assembled inplan-app/server/src/routes/mcp.ts; Ref's own agent runner setsinternal: 'true'(plus anagentId) when it builds the plan MCP URL inplan-app/cli/src/commands/agent-thread-config.ts.commentActionsForomitsrequest_reviewfrom the orchestrated action enum, and the orchestrated redirect copy says such an agent's work is reviewed in the app on the plan it was launched on.plan-app/server/src/utils/mcpRequestReviewHandler.tsalways uses the authenticated owner's email as the reviewer; theemailparameter incommentsInputSchemais explicitly ignored. The email-based path in the app isrequestReview(planId, email)fromplan-app/client/src/components/SharePanel.tsx, which matches the flow already documented on the page.request_media_uploadis still registered as a deprecated alias alongsideupload_mediain both factories, so the existing sentence stays accurate.Unverified / omitted
view_media— the handler uses a fixed TTL, but the page says "temporary link" rather than a duration, since the number is an internal constant that could move without notice.thumb/standard— omitted; derivative max-edge sizes are internal constants and not part of any stated contract.Manualtopic list differences between session kinds — orchestrated sessions also get a smaller topic enum, but the page does not enumerateManualtopics today and adding that list would be a restructure, so it is left out.Conflicts
None expected —
docs.jsonis untouched. Onlyplans/install/index.mdxandplans/collaboration/reviews.mdxchanged.Generated by Claude Code