Manage display of "Run as Task" checkbox on Tools Tab#1072
Manage display of "Run as Task" checkbox on Tools Tab#1072cliffhall wants to merge 2 commits intomodelcontextprotocol:mainfrom
Conversation
* In ToolsTab.tsx
- define ExtendedTool interface for augmenting with execution, meta, icons
- in hasMeta function,
- cast tool as ExtendedTool
- add getTaskSupport function
- returns forbidden if input is not a tool
- returns the setting of execution.taskSupport if set and valid
- returns optional otherwise
- in useEffect map callback
- set runAsTask to true if getTaskSupport returns "required", else false
- in IconDisplay instances cast tool as ExtendedTool instead of as WithIcons
- hide "Run as Task" checkbox if getTaskSupport returns "forbidden" for the selected tool
- disable the "Run as Task" checkbox if getTaskSupport returns "required"
* In ToolsTab.test.tsx
- added unit test
- "should show/hide/disable run-as-task checkbox based on taskSupport"
- tests checkbox checked and disabled states for "forbidden", "required", and "optional" states
|
I can confirm the checkbox is now disabled and checked. But, we still get this behavior: #1073 |
That turns out to be an SDK spec compliance gap that should be closed when modelcontextprotocol/typescript-sdk#1210 lands. |
|
@claude /review |
|
Claude finished @BobDickinson's task in 2m 24s —— View job Code Review
OverviewThis PR addresses a real UX problem: the "Run as Task" checkbox was always visible, leading users to believe any tool could be run as a task, then getting a confusing error when it couldn't. The approach — hiding/disabling the checkbox based on Issues1. Default fallback contradicts the MCP spec (significant)
// Current code - returns "optional" when taskSupport is absent
return "optional";The MCP spec is explicit:
The current fallback of return "forbidden"; // Default per MCP spec when execution.taskSupport is absentThis also makes the fix more impactful: instead of only hiding the checkbox for tools that declare 2. Missing server capability check (moderate)The MCP spec also states:
The 3. Import path inconsistency (minor)
// Changed from:
} from "@/utils/metaUtils";
// To:
} from "../utils/metaUtils";Every other import in the file uses the 4. Misleading comment (minor)
// Type guard to detect execution.taskSupport
const getTaskSupport = (tool: Tool | null): "forbidden" | "required" | "optional" => {
5.
|
Summary
The "Run as Task" button is always available on the Tools Tab. But if a tool that cannot be run as a task has this checkbox checked when you run it, you get an error. This is confusing, because the availability of the "Run as Task" checkbox would indicate to a user that this tool could be run as a task.
execution.taskSupportsetting isforbidden.execution.taskSupportsetting isoptional.execution.taskSupportsetting isrequired.Type of Change
Changes Made
Related Issues
Testing
Test Results and/or Instructions
npx @modelcontextprotocol/server-everything@latest streamableHttpnpx @modelcontextprotocol/inspector@latestexecution.taskSupportsetting is "forbidden")execution.taskSupportsetting is "required")NOTE: We don't have a tool that has an
execution.taskSupportsetting of "optional", but it's unit tested.taskSupport == "forbidden"taskSupport == "required"Checklist
npm run prettier-fix)Breaking Changes
Nope.