Cancel A2A Task
a2a_cancel_taskStop an active agent task by providing its ID and agent card URL, transitioning its status to canceled. Use this to halt long-running or unwanted operations.
Instructions
Cancel a running A2A task.
This tool requests cancellation of an active task. The agent will attempt to gracefully stop the task execution and update its status to "canceled".
Args:
agentCardUrl (string): URL to the agent's card endpoint
taskId (string): The unique identifier of the task to cancel
Returns: JSON response confirming the cancellation request:
success: Boolean indicating if cancellation was initiated
message: Description of the cancellation result
task: Updated task object with "canceled" status (if available)
Note: Cancellation may not be immediate. The task status should transition to "canceled" once the agent completes the cancellation process.
Examples:
Use when: "Cancel the long-running task abc-123" params: { agentCardUrl: "https://agent.example.com/.well-known/agent-card.json", taskId: "abc-123" }
Use when: "Stop the data processing task I started" params: { agentCardUrl: "https://agent.example.com/.well-known/agent-card.json", taskId: "task-id-to-cancel" }
Don't use when: Task has already completed (cancellation only works for active tasks)
Error Handling:
Returns "Error: Task not found" if the task ID doesn't exist
Returns "Error: Task already completed" if the task is no longer running
Returns "Error: Cancellation not supported" if the agent doesn't support task cancellation
After cancellation, use a2a_get_task to verify the task status changed to "canceled"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| taskId | Yes | The unique identifier of the task to cancel | |
| agentCardUrl | Yes | URL to the agent's card endpoint |