jobId, you can pass the task id or the id of any run in it.
Batch tools exist but stay hidden unless your administrator enables batches. They are not covered here.
Discovery
Use these to find valid values before you create a task.Reading
Task states used across these tools:
pending, running, succeeded, failed, cancelled, needs_attention. See Task lifecycle.
Waiting
Acting
All of these act as you. Tools that create runs accept anidempotencyKey (8-128 characters). If an answer is lost, retry with the same key and you get the same task, not a second one.
Attach a file
1
Ask for a link
Call
create_attachment_upload with no arguments. It returns uploadUrl (one HTTP PUT of the raw file) and pageUrl (a page where you pick the file in the browser).2
Upload
Upload the file. The link expires in minutes and works once. Treat it as a secret.
3
Check and bind
Call the tool again with
uploadId. When the state is completed, pass attachmentId in attachmentIds of create_task or follow_up_task.Example conversations
Fix a failing test and wait for the PR
You: Fix the failing test in acme/notes-api and wait for the PR.The assistant works through these calls:
list_reposto confirmacme/notes-apiexists.preflight_taskwith that repo. The verdict isready.create_taskwith a command like “Fix the failingTestListNotestest. Don’t change the public API.” It returns a task id.wait_taskwith the id. It returnstimeout, so the assistant calls it again until the result issucceeded.get_task_resultfor the summary, gatechecksand pull request link.
Assistant: The task succeeded. All gates passed and the PR is open: the link comes from pullRequest.url.
An agent asks a question
You: Why is my notes-api task stuck?
list_taskswithstate: "attention"finds the task, markedneeds_attention.list_questionsshows: “Should deleted notes be soft-deleted?” with the optionsYesandNo.- The assistant asks you. You say “Yes.”
answer_questionwithanswers: ["Yes"].wait_taskuntil the run settles, thenget_task_result.
investigate_job, then read_job_log, and offer retry_task or follow_up_task with a corrected command.