Skip to content

Tools Tab Run button is blocked while a task is polling — prevents concurrent tool calls during task execution #1077

@Yeaury

Description

@Yeaury

Inspector Version

  • 0.19.0

Describe the bug

When a tool is invoked as a task (with "Run as task" checked), the Run button on the Tools Tab is disabled for the entire duration of the task's polling cycle. This prevents users from running any other tool (whether as a normal call or as another task) while a task is in progress.

This behavior contradicts the MCP specification's intent for tasks. According to the [Tasks specification (2025-11-25)](https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/tasks), tasks are specifically designed to enable concurrent operations:

When a task is created in response to a tools/call request, host applications may wish to return control to the model while the task is executing. This allows the model to continue processing other requests or perform additional work while waiting for the task to complete.

The specification's [Task-Augmented Tool Call With Elicitation flow](https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/tasks#task-augmented-tool-call-with-elicitation) also explicitly illustrates this pattern:

Note over LLM,C: Client continues processing other requests while task executes in background
LLM->>C: Request other operation
C->>LLM: Other operation result

The current implementation in ToolsTab.tsx sets isPollingTask to true during polling and uses it to disable the Run button, effectively serializing all tool operations. This makes it impossible to test real-world task use cases such as:

  • Running a long-lived monitoring task (e.g., watch) while executing other diagnostic tools
  • Launching multiple concurrent tasks
  • Interleaving normal tool calls with background tasks

Root Cause

In [PR #1013](#1013) ("Add Tasks support"), the following design choices cause this behavior:

  1. In App.tsx, the callTool function enters a blocking polling loop (while loop with await) that keeps isPollingTask = true until the task reaches a terminal status.
  2. In ToolsTab.tsx, the Run button's disabled condition includes isPollingTask, preventing any tool execution during polling.
  3. The polling state is global (single isPollingTask boolean), so even switching to a different tool won't allow execution.

To Reproduce

  1. Connect to an MCP server that supports tasks

  2. Go to the Tools tab

  3. Select a tool, check "Run as task", and click "Run Tool"

  4. While the task is running (status: working, button shows "Polling Task..."), try to:

    • Select a different tool and click "Run Tool" → button is disabled
    • Or try to run the same tool again → button is disabled
  5. You must wait until the task completes, fails, or is cancelled before running any other tool

Expected behavior

According to the MCP specification, the Inspector (as a requestor/client) should allow users to:

  1. Run other normal tool calls while a task is being polled in the background
  2. Launch multiple concurrent tasks since the protocol supports this via unique task IDs
  3. Continue interacting with the Tools tab normally — the polling should happen asynchronously without blocking the UI

The polling loop should run in the background (e.g., managed independently per task), and the Run button should remain enabled for other operations. Task status and results could be tracked independently, perhaps with visual indicators showing which tasks are currently in progress.

Suggested approach

  • Decouple the polling loop from the callTool function — manage task polling independently (e.g., per-task polling via a Map<taskId, pollingState>)
  • Remove the isPollingTask condition from the Run button's disabled logic
  • Allow the tool result area to show either the latest normal tool result or a task's live status, with the ability to switch between active tasks
  • Consider showing a list/badge of active tasks on the Tools tab so users can monitor multiple concurrent tasks

Screenshots

Task running — Run button is disabled, showing "Polling Task..." with no way to execute other tools:

Task polling blocks tool execution

Environment

  • OS: macOS
  • Browser: Chrome
  • Transport: Streamable HTTP
  • Connection Type: Via Proxy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions