In virtual server tool testing, an unfilled required argument appears in the generated snippets as an empty string, which describes a request the UI will not send.
defaultValueForField at ToolArgumentsForm.tsx:465-469 returns "" for string fields, and stripEmptyOptionalValues at line 471 removes empty optional values but skips required ones at line 477. A required argument therefore stays in the payload as "" while unfilled optional arguments are dropped, so a tool with a required string argument produces "arguments":{"<name>":""}.
Once form field validation is fixed in #6860 (item 3), clicking Preview or Invoke with an unfilled required argument will report the error rather than dispatch. The snippet would then be showing a payload the product declines to send.
The snippets already use placeholders for values the page cannot know. The URL and bearer token render as environment references in every language, $MCPGATEWAY_URL and $MCPGATEWAY_BEARER_TOKEN in bash with the equivalents in Python and TypeScript, because the browser holds neither. The BFF keeps the bearer token in its session store and injects the Authorization header when forwarding the request (server/src/routes/proxy/catch-all.ts:151), and the browser only calls the BFF on its own origin, so the upstream address is not available to the page either.
Proposed change: render an unfilled required argument the same way, as a placeholder naming the argument, for example "skill_name": "<skill_name>". Values the user has entered continue to render as entered, and unfilled optional arguments continue to be omitted.
This does not make the snippet runnable as copied, and that is not the intent. The URL and token still require substitution. The aim is that everything the user has to supply is presented consistently.
The snippets are built in buildToolSnippets.ts and cover the preview and invoke paths, so this applies to both.
Scope is the web UI only, no API change, and no work on the Admin UI.
In virtual server tool testing, an unfilled required argument appears in the generated snippets as an empty string, which describes a request the UI will not send.
defaultValueForField at ToolArgumentsForm.tsx:465-469 returns "" for string fields, and stripEmptyOptionalValues at line 471 removes empty optional values but skips required ones at line 477. A required argument therefore stays in the payload as "" while unfilled optional arguments are dropped, so a tool with a required string argument produces "arguments":{"<name>":""}.
Once form field validation is fixed in #6860 (item 3), clicking Preview or Invoke with an unfilled required argument will report the error rather than dispatch. The snippet would then be showing a payload the product declines to send.
The snippets already use placeholders for values the page cannot know. The URL and bearer token render as environment references in every language, $MCPGATEWAY_URL and $MCPGATEWAY_BEARER_TOKEN in bash with the equivalents in Python and TypeScript, because the browser holds neither. The BFF keeps the bearer token in its session store and injects the Authorization header when forwarding the request (server/src/routes/proxy/catch-all.ts:151), and the browser only calls the BFF on its own origin, so the upstream address is not available to the page either.
Proposed change: render an unfilled required argument the same way, as a placeholder naming the argument, for example "skill_name": "<skill_name>". Values the user has entered continue to render as entered, and unfilled optional arguments continue to be omitted.
This does not make the snippet runnable as copied, and that is not the intent. The URL and token still require substitution. The aim is that everything the user has to supply is presented consistently.
The snippets are built in buildToolSnippets.ts and cover the preview and invoke paths, so this applies to both.
Scope is the web UI only, no API change, and no work on the Admin UI.