Skip to content

Manage display of "Run as Task" checkbox on Tools Tab#1072

Open
cliffhall wants to merge 1 commit intomodelcontextprotocol:mainfrom
cliffhall:hide-run-as-task-if-not-supported
Open

Manage display of "Run as Task" checkbox on Tools Tab#1072
cliffhall wants to merge 1 commit intomodelcontextprotocol:mainfrom
cliffhall:hide-run-as-task-if-not-supported

Conversation

@cliffhall
Copy link
Member

@cliffhall cliffhall commented Feb 6, 2026

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.

  • "Run as Task" is hidden for tools whose execution.taskSupport setting is forbidden.
  • "Run as Task" is shown, enabled, and unchecked for tools whose execution.taskSupport setting is optional.
  • "Run as Task" is shown, disabled, and checked for tools whose execution.taskSupport setting is required.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Refactoring (no functional changes)
  • Test updates
  • Build/CI improvements

Changes Made

  • 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

Related Issues

Testing

  • Tested in UI mode
  • Tested in CLI mode
  • Tested with STDIO transport
  • Tested with SSE transport
  • Tested with Streamable HTTP transport
  • Added/updated automated tests
  • Manual testing performed

Test Results and/or Instructions

  1. Run the Everything server npx @modelcontextprotocol/server-everything@latest streamableHttp
  2. Run the Inspector: npx @modelcontextprotocol/inspector@latest
  3. Click Connect
  4. Click List Tools
  5. Click "Echo" tool in list (this tool's execution.taskSupport setting is "forbidden")
  6. See "Run as Task" checkbox is not available.
  7. Click "Simulate Research Query" tool in list
  8. See "Run as Task" checkbox is available, checked, and disabled (this tool's execution.taskSupport setting is "required")
    NOTE: We don't have a tool that has an execution.taskSupport setting of "optional", but it's unit tested.

taskSupport == "forbidden"

Screenshot 2026-02-06 at 4 31 41 PM

taskSupport == "required"

Screenshot 2026-02-06 at 4 32 58 PM

Checklist

  • [x ] Code follows the style guidelines (ran npm run prettier-fix)
  • Self-review completed
  • Code is commented where necessary
  • [] Documentation updated (README, comments, etc.)

Breaking Changes

Nope.

* 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
@Randgalt
Copy link

Randgalt commented Feb 6, 2026

I can confirm the checkbox is now disabled and checked. But, we still get this behavior: #1073

@cliffhall cliffhall requested a review from evalstate February 7, 2026 15:29
@cliffhall
Copy link
Member Author

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Always present "Run as Task" checkbox is confusing

2 participants