FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[UI-REWRITE]: Show unfilled required arguments as placeholders in generated snippets · Issue #6947 · IBM/mcp-context-forge · GitHub

[UI-REWRITE]: Show unfilled required arguments as placeholders in generated snippets #6947

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttriageIssues / Features awaiting triageui-rewriteTasks for the isolated ui rewrite feature branch

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL