Skip to main content

MCP tools

Use this page to find the tool an agent calls for a job, and the command you would type for the same thing. The server offers 69 tools, grouped the same way as the CLI reference. A tool and its command follow the same rules, and most answer the same object the command prints with --json.

  1. Add the server once per machine, naming the agent (Connect your agent covers Codex and other clients, and what to run until staple-cli is on npm):

    claude mcp add staple -e STAPLE_AGENT=claude -- npx -y staple-cli mcp
  2. Ask your agent to list its staple tools. Each has a description and typed arguments; the client shows them.

  3. Most tools take ws (a workspace slug or prefix) to reach another repository, and every write that records who acted takes actor when STAPLE_AGENT is not set.

The loop an agent follows, described in How an agent works a ticket:

next_task → checkout_task → put_document (the plan) → add_comment as it goes → update_task to done → events_since to see what that unblocked.

Tickets​

ToolWhat it doesCLIWrites
inboxWhat is ready, waiting on a person, or blocked, in pickup orderstaple inboxno
list_tasksList tickets by status, kind, assignee or textstaple lsno
get_taskOne ticket in full: claim, time, gate, blockers, attempts, and file metadatastaple showno
create_taskFile a ticket, with parent, blockers and estimatestaple newyes
update_taskChange status or fields; status: "done" finishes itstaple status, staple doneyes
checkout_taskClaim a ticket and start itstaple startyes
release_taskGive a claim backstaple releaseyes
add_commentAdd a commentstaple commentyes
list_commentsA ticket's comments, oldest firststaple showno
put_documentStore a plan, worklog or other document on a ticketstaple doc --putyes
get_documentRead a document, latest or by revisionstaple docno
list_filesA ticket's files: type, size, and hash. Never the bytesstaple file lsno
attach_fileAttach a file from a path or from base64. The type is sniffed from the bytesstaple file attachyes
export_fileWrite one file's bytes to a pathstaple file getyes
remove_fileRemove a filestaple file rmyes
events_sinceWhat changed since a point in the event logstaple events --sinceno
record_attempt_eventReport a pause, resume, checkpoint or interruption on the ticket you holdstaple attempt pause (and resume, milestone, interrupt)yes

Planning​

ToolWhat it doesCLIWrites
set_blocked_byReplace a ticket's blockersstaple blocked-byyes
gate_taskHold an epic for a person's reviewstaple gateyes
approve_taskRelease a held epic, or some of its ticketsstaple approveyes
request_changesSend a held epic back with a notestaple request-changesyes
list_queueThe pickup plan, and the order agents receivestaple queueno
next_taskThe one ticket to take next, and what it skippedstaple queue nextno
enqueue_taskAdd a ticket, epic or milestone to the planstaple queue addyes
dequeue_taskTake an entry out of the planstaple queue rmyes
move_queue_entryMove one entrystaple queue mvyes
reorder_queueSet the whole orderstaple queue reorderyes
prune_queueDrop finished entriesstaple queue pruneyes
list_milestonesMilestones, with progressstaple milestone lsno
get_milestoneOne milestone: members, goal and pacestaple milestone showno
create_milestoneCreate one, optionally from an epicstaple milestone newyes
update_milestoneChange dates, description or criteriastaple milestone setyes
mark_milestone_criterionJudge one goal criterion met, unmet or unknown, with evidencestaple milestone criterionyes
add_milestone_memberAdd an epic or ticketstaple milestone addyes
remove_milestone_memberRemove a memberstaple milestone rmyes
move_milestone_memberMove a member, or into another milestonestaple milestone mvyes
reorder_milestone_membersSet the members' orderstaple milestone reorderyes

Autopilot runs​

ToolWhat it doesCLIWrites
start_runStart working a scope ticket after ticketstaple run startyes
continue_runAfter each ticket: take the next, wait, or stopstaple run continueyes
run_statusA run, and whether it would stop nowstaple run statusno
pause_runHold a runstaple run pauseyes
resume_runLet a held run go onstaple run resumeyes
stop_runEnd a runstaple run stopyes

Cloud sync​

ToolWhat it doesCLIWrites
cloud_statusWhether this machine syncs this repository, from local filesstaple cloudno
conflict_listFields two machines set differentlystaple cloud conflictsno
conflict_resolveSettle one conflictstaple cloud resolveyes

Connecting, disconnecting, automatic sync, backups, revoking and purging have no tool. They are a person's decisions.

Several repositories​

ToolWhat it doesCLIWrites
hub_overviewEvery workspace on this machine, and the links between themstaple hubno
cross_linkMake a ticket wait on a ticket in another repositorystaple linkyes
cross_unlinkRemove that linkstaple hub unlinkyes
hub_unregisterDrop one workspace from this machine's liststaple hub unregisteryes
hub_pruneDrop entries whose folder is gone; previews unless applystaple hub pruneyes

Budget and estimates​

ToolWhat it doesCLIWrites
set_estimateChange only the estimate; null clears itstaple estimateyes
compare_plansLabor, estimate coverage and the longest chain of named ticketsstaple compareno
forecastWork left under a ticket, and what it costs your usage limitsstaple forecastno
calibration_cohortsHow long each kind of work takes against its estimatestaple calibrateno
timing_qualityHow much of the recorded time can be trustedstaple timing qualityno
list_attemptsEvery agent session on a ticketstaple attemptsno
get_attemptOne session in detailstaple attempt <id>no
get_budgetEach account's usage limits and pacestaple budgetno
list_budget_samplesOne account's usage readingsstaple budget historyno
record_budget_sampleRecord a usage reading; refused until a person turns capture onstaple budget ingestyes
forget_budget_samplesRemove wrong readings; previews unless confirm: truestaple budget forgetyes

Turning budget capture on is a person's decision and has no tool (Budget and estimates).

Setup and settings​

ToolWhat it doesCLIWrites
initCreate a workspace when a tool reports there is nonestaple inityes
get_settingRead a workspace setting, such as queue.policystaple settings getno
set_settingChange a workspace settingstaple settings setyes
list_statusesThis workspace's statusesstaple statuses lsno
update_statusesAdd, rename, reorder or remove statusesstaple statuses add (and the rest)yes
list_kindsThis workspace's kindsstaple kinds lsno
update_kindsAdd, rename, reorder or remove kindsstaple kinds add (and the rest)yes

Change settings, statuses, kinds or the queue order only because a person asked.

When a tool refuses​

A refusal is a tool result with isError and an object with code, message, detail and retryable. The four an agent meets most:

  • conflict: someone else has it. Pick a different ticket; do not retry.
  • gated: a person must approve first. Pick a different ticket.
  • out_of_order: the plan puts another ticket first. Take detail.expected[0].
  • revision_conflict: someone changed it since you read it. Read again, then retry.

Errors and exit codes lists every code.

Going deeper: the MCP tools in detail has the argument and answer shapes.