Long job as a task (tasks)
run_taskTests MCP client task support by simulating a long-running job with polling, progress updates, configurable outcomes, and halfway yes/no confirmation prompts.
Instructions
Run a fake long job. Clients with task support get a task handle at once and poll it (tasks/get); others wait for the result. Options: seconds, steps, outcome (success, tool_error, failure) and askConfirmation (pauses halfway for a yes/no: task status input_required).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "run_task"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| steps | No | Number of steps; each one updates statusMessage | |
| outcome | No | success = normal result; tool_error = result with isError (task still "completed"); failure = JSON-RPC error (task "failed") | success |
| seconds | No | How long the fake job runs | |
| askConfirmation | No | Halfway through, ask the user to continue (task status input_required) |