Skip to main content
POST
/
api
/
v1
/
tasks
/
{id}
/
abort-tools
Abort a single subagent run or tool call
curl --request POST \
  --url https://neo.api.projectdiscovery.io/api/v1/tasks/{id}/abort-tools \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "subagent_run_id": "<string>",
  "tool_call_id": "<string>"
}
'
{
  "message": "<string>",
  "stream_id": "<string>",
  "success": true,
  "found": true,
  "subagent_run_id": "<string>",
  "tool_call_id": "<string>"
}

Authorizations

Authorization
string
header
required

JWT authentication token

Path Parameters

id
string<uuid>
required

Task ID

Body

application/json

Provide exactly one of subagent_run_id or tool_call_id. Both present or both absent is rejected with 400. Which field is set selects what gets aborted (a subagent run vs. a tool call).

subagent_run_id
string

Subagent run id surfaced in the stream's data-subagent-stream chunks. Unique per concurrent subagent invocation within a task. Set this to abort a subagent run.

tool_call_id
string

Mastra-generated tool call id surfaced in tool-input-available and tool-call stream chunks. Set this to abort a tool call.

Response

Target aborted successfully (or already gone)

message
string
required
stream_id
string
required
success
boolean
required
found
boolean

True iff the target id was actually present and aborted. False means the id was wrong or the target had already finished. Idempotent: success stays true regardless.

subagent_run_id
string

Echoed back when a subagent run was the target.

target
enum<string>

Which kind of target the request acted on.

Available options:
subagent,
tool
tool_call_id
string

Echoed back when a tool call was the target.