diff --git a/.changeset/route-input-usage-prefill-fixes.md b/.changeset/route-input-usage-prefill-fixes.md new file mode 100644 index 000000000..7c4cacb26 --- /dev/null +++ b/.changeset/route-input-usage-prefill-fixes.md @@ -0,0 +1,12 @@ +--- +"agent-bundle": patch +--- + +Route catalog and MCP prefill correctness fixes from post-merge review: CLI +usage summaries mark repeatable named options with the same ` ...` operand +suffix the generated help prints; optional booleans without a schema default +keep an unset state (a three-state omitted/true/false control) instead of +submitting an explicit `false` the handler can observe; and a stale +Routes-page prefill naming a tool the server no longer advertises surfaces a +missing-tool notice instead of silently attaching the prepared arguments to +the first advertised tool. diff --git a/packages/workbench/src/mcp/mcp-page.css b/packages/workbench/src/mcp/mcp-page.css index 81370cafc..e8c1b4f0f 100644 --- a/packages/workbench/src/mcp/mcp-page.css +++ b/packages/workbench/src/mcp/mcp-page.css @@ -337,6 +337,14 @@ color: #a8b8ca; } +.mcp-page-missing-tool { + background: #3a1f24; + border-left: 3px solid #f28b82; + color: #ffd9d4; + margin: 0 0 0.75rem; + padding: 0.55rem 0.75rem; +} + @media (max-width: 42rem) { .mcp-page-heading, .mcp-page-catalog li, diff --git a/packages/workbench/src/mcp/mcp-page.tsx b/packages/workbench/src/mcp/mcp-page.tsx index 1dda422dd..fa4fa6c4e 100644 --- a/packages/workbench/src/mcp/mcp-page.tsx +++ b/packages/workbench/src/mcp/mcp-page.tsx @@ -1240,7 +1240,13 @@ export const McpPage = (props: McpPageProps) => { const prompts = catalogItems(model.catalogs.prompts, 'Prompt'); const resources = catalogItems(model.catalogs.resources, 'Resource'); const resourceTemplates = catalogItems(model.catalogs.resourceTemplates, 'Resource template'); - const selectedTool = tools.find((item) => item.name === toolName) ?? tools[0]; + const matchedTool = tools.find((item) => item.name === toolName); + const selectedTool = matchedTool ?? (initialToolPrefill === undefined && toolName === '' ? tools[0] : undefined); + const missingToolName = initialToolPrefill !== undefined + && model.phase === 'ready' + && !tools.some((item) => item.name === initialToolPrefill.toolName) + ? initialToolPrefill.toolName + : undefined; const selectedPrompt = prompts.find((item) => item.name === promptName) ?? prompts[0]; const active = Object.values(model.activeRequests); const controls = mcpPageSessionControls(model.phase, pendingActions, onResetSession !== undefined, serverCatalogState); @@ -1428,6 +1434,9 @@ export const McpPage = (props: McpPageProps) => { Tool call prefilled from Routes
{initialToolPrefill.serverName} ยท {initialToolPrefill.toolName}
{display(initialToolPrefill.arguments)}
+ {missingToolName === undefined ? undefined : + The server no longer advertises the "{missingToolName}" tool. The prepared arguments were not applied to another tool. +
}Open the session and use the existing call control when you are ready. Nothing runs automatically.
}{property.description}
} {error === undefined ? undefined : {error}} @@ -192,7 +211,9 @@ const RouteInputEditor = ({ entry, group, onOpenMcp }: { {property.description === undefined ? undefined :{property.description}
} {values.map((value, index) =>