Agent tools
Lists the tools of the Kode agent tool set, with the arguments and the route of each.
Last updated
On this page
- Conventions
- Waits and hand-off
- Scopes
- read
- write
- edit
- glob
- grep
- exec
- process
- watch
- container_build
- container_push
- workspace
- workspace_vars
- worktree
- packages
- desk
- env
- service
- intercept
- volume
- snapshot
- quota
- requests_list
- request_get
- request_create
- regions
- download
- MCP resources
- transfer
- devices
- capsule
- pipeline
- webhook_rotate
- run
- secret_set
- secret_list
- secret_delete
- connector_list
- status
- workspace_ask
- question
- main_tell
- task
Conventions
- A workspace id starts with
ws-, an environment id withenv-. An id or a name works. Thelistactions give both. - Most tools are one per resource. The
actionargument picks the verb, and the Actions table of a tool lists the verbs. A call without anactionthat the tool has is refused with the names of the valid ones. - A call that lacks an argument of its action is refused with the schema of that action.
- A workspace that
workspacemakes withactionset tocreatein a desk is managed: the desk deletes it when the desk is deleted. - The actions
create,start, andrestoreofworkspaceandenv,startofrunanddesk,createofcapsule, andaddandupdateofservicetakewait: true. They answer when the object has settled, or atsoft_ms(25 000 by default, 600 000 at most) with a hand-off. See Waits and hand-off. - The
waitactions taketimeout_ms(25 000 by default, 900 000 at most) and wait for an object that already exists. At the limit they answer the object withtimed_out: true; call them again. A service withfailing: truedoes not come up by waiting: read itsmessage, fix the cause, and change the service again. secret_setnever prints the value back. The agent sets, lists, and deletes secrets withsecret_set,secret_list, andsecret_delete. It can use them in variables, but no tool reads a value.servicewithactionset tologstakestail(default 200, maximum 2000),sincein seconds (maximum 86400), andpreviousfor the run before a crash. It starts an idle-stopped environment first. When an intercept holds the service, the answer names the workspace that serves it.volumeactionsgetanddeletetake theidof a volume, never its name. Read theidfrom thelistaction, or from thevolumefield of the workspace or the environment.- The first snapshot of a volume gives
volume, its name. Restore and copy take a reference insnapshot_id:name,name@N, or a snapshot id. A snapshot answer names its volume involume. See Names and versions. - When
envwithactionset torestoreanswers409withlost, the agent names services indiscardonly after the developer accepts the loss. - A command or build that runs longer than
soft_ms(25 seconds by default) inexecorcontainer_buildis promoted to a process. Follow it as the Waits and hand-off paragraph says. processwithactionset towaiton an id that ended more than 10 minutes ago, or never existed, answersstate: "gone"and ahint. It is not an error.
Waits and hand-off
A call that waits never blocks for long. At soft_ms it answers {promoted: true, id, kind, next, next_err} and the work goes on. The kind says how to resume it.
kind | Calls that answer it | Resume with |
|---|---|---|
process | exec, container_build | process wait with id, and since and since_err set to next and next_err. |
workspace | workspace create, restore, start | workspace wait. |
env | env create, start, restore; service add, update; intercept start | env wait. |
capsule | capsule create | capsule wait. |
run | run start | run wait. |
desk | desk start | desk get. |
Both MCP doors speak the 2026-07-28 revision and 2025-era clients. A client that declares the io.modelcontextprotocol/tasks extension gets a task for a call that runs past 10 seconds and polls tasks/get; it never sees promoted. Other clients keep the loop above.
For a platform object the platform does the work, and next and next_err are 0. A wait action ends at timeout_ms with timed_out: true.
Scopes
An agent does not hold every tool. The tools that it holds depend on where it runs.
| Scope | Held by | Tools |
|---|---|---|
| Desk | kode mcp, the Claude Code plugin, the remote connector, and the main desk of the harness | The desk, workspace, env, volume, and account tools, the capsule, pipeline, run, secret, and connector tools, with the board. The main desk of the harness has no code tools. |
| Workspace | The desk of one workspace in the harness | The code, package, container, and environment tools of its own workspace, with no workspace argument, and main_tell and subagent. |
kode mcp serves the tools of both scopes in one list, and each tool takes the workspace or env that it acts on. The harness splits them:
- The main desk creates, starts, stops, and deletes workspaces and environments. It holds
packageswithlistbut no other package action, and nointercept. - The desk of a workspace holds the code tools,
packages,intercept,service, andworkspacewithstopandsnapshot. It reports to the main desk withmain_tell. - A subagent runs in a clone of a workspace. It holds the tools of that workspace without
workspacestop,intercept, the board,workspace_ask,main_tell, andsubagent.
read
Reads text files of a workspace, with line numbers.
A PNG, JPEG, GIF, or WebP file comes back as an image that the agent sees: an MCP image block on the laptop and remote doors, an image in the tool result of a desk's own agent. The tool server decides the type from the first bytes of the file, not from its name. The limit is 5 MB of base64 for one image, and for all the images of one paths call. A PNG or JPEG over it is downscaled to fit, and the answer says downscaled_from. A GIF or WebP over it answers its size, mime, and a hint. Any other binary file answers its size and mime.
Route: tool server.
| Argument | Type | Required | Meaning |
|---|---|---|---|
workspace | string | yes | The workspace id (ws-…). |
tree | string | no | Which worktree to use; omit for the main one. |
path | string | no | One file to read. |
paths | array of string | no | Up to 50 files: path strings or {path, offset, limit}. |
offset | integer | no | First line to read, 1-based. |
limit | integer | no | How many lines to read. |
write
Creates or overwrites one file of a workspace.
Route: tool server.
| Argument | Type | Required | Meaning |
|---|---|---|---|
workspace | string | yes | The workspace id (ws-…). |
tree | string | no | Which worktree to use; omit for the main one. |
path | string | yes | The file to create or overwrite. |
content | string | no | The whole new file content, as text. |
content_b64 | string | no | The whole new file content as base64, for a binary file. Give content or content_b64, not both. |
The limit is 10 MiB of file content. To copy a larger file, or any file from another workspace, use transfer: its bytes go from one tool server to the other and never through the agent.
edit
Replaces exact text in the files of a workspace. If one edit does not apply, none is written.
Route: tool server.
| Argument | Type | Required | Meaning |
|---|---|---|---|
workspace | string | yes | The workspace id (ws-…). |
tree | string | no | Which worktree to use; omit for the main one. |
path | string | no | The file to edit (with edits). |
edits | array | no | Replacements for path: {old, new, replace_all}; old must occur once unless replace_all. |
files | array | no | Several files at once: {path, edits}, up to 50, all or nothing. |
glob
Lists the files of a workspace that match a glob.
Route: tool server.
| Argument | Type | Required | Meaning |
|---|---|---|---|
workspace | string | yes | The workspace id (ws-…). |
tree | string | no | Which worktree to use; omit for the main one. |
pattern | string | yes | The glob, for example src/**/*.rs. |
cwd | string | no | Directory to search under; default is the tree root. |
grep
Searches the contents of the files of a workspace with a regular expression.
Route: tool server.
| Argument | Type | Required | Meaning |
|---|---|---|---|
workspace | string | yes | The workspace id (ws-…). |
tree | string | no | Which worktree to use; omit for the main one. |
pattern | string | yes | The regex to search for. |
cwd | string | no | Directory to search under; default is the tree root. |
glob | string | no | Only search files that match this glob. |
mode | string | no | content (default) lists matching lines, files lists file names, count counts matches. |
context | integer | no | Lines of context around each match. |
ignore_case | boolean | no | Match without regard to case. |
max | integer | no | Stop after this many matches. |
exec
Runs a command in a workspace and returns its output and exit code, or starts it as a detached process.
Route: tool server.
The extra argument notify is never, on_failure (the default), or always. It sets when the desk reports the end of a detached or promoted process as a notice. The tool server does not see it.
Any tool answer can start with notices, a list of sentences about processes that ended since the last answer. A process that crashed arrives there with its command and the last lines of its stderr. A process that a restart killed arrives there with the restart time. The notices ride as a second content item of the answer, after the result, and each arrives once.
A process that exits on its own is never restarted; the desk reports it. A detached process that a workspace stop or restart killed starts again with the workspace, with the same id. Its output then opens with [restarted <time>: <reason>]. relaunch: false on exec opts one process out: after a restart it is listed as killed_by_restart instead. A workspace that is restored or cloned relaunches no process of its source.
| Argument | Type | Required | Meaning |
|---|---|---|---|
workspace | string | yes | The workspace id (ws-…). |
tree | string | no | Which worktree to use; omit for the main one. |
cmd | string or array of string | yes | The command: a shell string, or an argv array that runs without a shell. |
cwd | string | no | Working directory inside the tree; default is the tree root. |
env | object | no | Extra environment variables, name to value. |
soft_ms | integer | no | Wait this long (default 25000; a remote connector gets default 5000, maximum 20000) before answering {promoted, id} for a command still running. |
head | integer | no | Keep only the first N lines of each output stream. |
tail | integer | no | Keep only the last N lines of each output stream. |
quiet | boolean | no | Omit stdout and stderr from the answer when the command exits 0. |
detach | boolean | no | Run in the background and answer {id} at once; read it with process. |
relaunch | boolean | no | With detach: start the process again after a workspace stop or restart (default true). |
pty | boolean | no | Not supported; true is refused. |
process
Controls the detached processes of a workspace. A long exec job becomes one.
Route: tool server.
A process that a workspace restart killed and that did not start again is answered with state: "killed_by_restart" and restarted_at. list shows it for an hour, and wait and output answer it with a hint to run the command again.
| Action | Route | Meaning |
|---|---|---|
list | tool server | Lists the detached processes. |
output | tool server | Reads the output of a process from a byte offset. |
wait | tool server | Waits until a process exits or the wait runs out, and reads its output since an offset. |
write | tool server | Writes to the input of a process. |
close_stdin | tool server | Closes the input of a process. |
kill | tool server | Stops a process and its children. |
| Argument | Type | Required | Meaning |
|---|---|---|---|
action | string | yes | One of list, output, wait, write, close_stdin, kill. |
workspace | string | yes | The workspace id (ws-…) or name. |
tree | string | no | Which worktree to use; omit for the main one. Read by list, output, wait, write, close_stdin, kill. |
id | string | no | The process id from exec or process list. Read by output, wait, write, close_stdin, kill. |
since | integer | no | Byte offset into stdout; pass back next. Read by output, wait. |
since_err | integer | no | Byte offset into stderr; pass back next_err. Read by output, wait. |
timeout_ms | integer | no | How long to wait for exit (default and at most 20000). Read by wait. |
data | string | no | Text to write to stdin. Read by write. |
data_base64 | string | no | Bytes to write to stdin, standard base64; use instead of data. Read by write. |
signal | string | no | TERM (default; KILL follows after 5 s) or KILL at once. Read by kill. |
watch
Watches files of a workspace, or a command, for changes.
Route: tool server.
| Action | Route | Meaning |
|---|---|---|
start | tool server | Starts a watch and returns its id. With paths and cmd, it runs cmd after each change batch. The event holds cmd_exit and output_tail. |
poll | tool server | Reads the events that a watch has seen since an index. |
stop | tool server | Stops a watch. |
| Argument | Type | Required | Meaning |
|---|---|---|---|
action | string | yes | One of start, poll, stop. |
workspace | string | yes | The workspace id (ws-…) or name. |
paths | array of string | no | Files or directories whose changes to report. Read by start. |
cmd | string or array of string | no | A command whose output lines are the events; with paths, run after each change batch. Read by start. |
pattern | string | no | Regex that output lines must match to count as events. Read by start. |
once | boolean | no | End the watch at the first event. Read by start. |
tree | string | no | Which worktree to use; omit for the main one. Read by start. |
id | string | no | The watch id from watch. Read by poll, stop. |
since | integer | no | Event index to read from; 0 is the start. Read by poll. |
container_build
Builds a container image from the files of a workspace and pushes it to your registry. The image carries no provenance or SBOM attestation.
Route: tool server.
With no connected registry the tool fails with error: "no_registry", a hint to connect one in the console under Connectors, and registries. A registry that is not connected fails with error: "unknown_registry", the name, and registries.
| Argument | Type | Required | Meaning |
|---|---|---|---|
workspace | string | yes | The workspace id (ws-…). |
tree | string | no | Which worktree to use; omit for the main one. |
tags | string or array of string | yes | Image names to build and push, each name[:tag]. |
registry | string | no | The registry connector to push to; optional with one connector. |
context | string | no | The build context directory; default is the tree root. |
file | string | no | The Dockerfile path. |
build_args | string or array of string | no | Build arguments, KEY=value. |
platform | string | no | Target platform, for example linux/amd64. |
no_cache | boolean | no | Build without the layer cache. |
soft_ms | integer | no | Wait this long (default 25000; a remote connector gets default 5000, maximum 20000) before answering {promoted, id} for a build still running. |
head | integer | no | Keep only the first N lines of output. |
tail | integer | no | Keep only the last N lines of output. |
container_push
Copies an image that the registry holds to more names, without a build.
Route: tool server.
| Argument | Type | Required | Meaning |
|---|---|---|---|
workspace | string | yes | The workspace id (ws-…). |
tree | string | no | Which worktree to use; omit for the main one. |
registry | string | no | The registry connector; optional with one connector. |
src | string | yes | The image the registry already holds, name:tag. |
dst | string or array of string | yes | The new names to copy it to. |
workspace
Creates, runs, copies, and removes workspaces.
Route: by action.
| Action | Route | Meaning |
|---|---|---|
list | GET /v1/workspaces | Lists the workspaces. |
get | GET /v1/workspaces/{id} | Shows the state, packages, volume, and restart_required. Also restarts, the last five restarts, each with at, reason (requested, env-changed, idle, evicted, node-lost), by (user, agent, system) and, for an idle stop, a detail sentence, and packages_missing, the declared packages that have no binary on the path. |
create | POST /v1/desks/{id}/workspaces in a desk, else POST /v1/workspaces. With source: POST /v1/workspaces/{id}/clone | Creates an empty workspace, or a copy of source. With device, a device workspace on that machine. A workspace made in a desk, and a copy made by a desk caller, joins the desk. |
restore | POST /v1/workspaces/restore | Makes a standalone workspace from a snapshot. |
start | POST /v1/workspaces/{id}/start | Starts a stopped workspace. |
stop | POST /v1/workspaces/{id}/stop | Stops a workspace and answers stopped. |
restart | POST /v1/workspaces/{id}/restart, then GET /v1/workspaces/{id} until the record lands (20 s) | Restarts a workspace so that it reads new variables. Answers the workspace with restart, the new restarts entry (null with a hint when it has not landed yet). A restart that the agent asked for records by: agent. |
delete | DELETE /v1/desks/{id}/workspaces/{workspace} in a desk, else DELETE /v1/workspaces/{id} | Deletes a workspace for good. |
wait | GET /v1/workspaces/{id}, repeated | Waits until the workspace is ready, stopped, error, or deleted. |
ttl | PUT /v1/workspaces/{id}/ttl | Sets or clears the unused-time limit. |
snapshot | POST /v1/workspaces/{id}/snapshots | Takes a snapshot of the workspace volume. |
| Argument | Type | Required | Meaning |
|---|---|---|---|
action | string | yes | One of list, get, create, restore, start, stop, restart, delete, wait, ttl, snapshot. |
team | string | no | The team slug. Omit it for your own. |
workspace | string | for get, start, stop, restart, delete, wait, ttl, snapshot | The workspace id (ws-…) or name. |
name | string | for create, restore | The workspace name: 1 to 40 lowercase letters, digits, or -. |
image | string | no | The container image. |
packages | array of string | no | Top-level nixpkgs attribute names such as python3 or nodejs_22, optionally attr@version. Nested paths such as python3Packages.x are refused; install Python libraries with pip. |
source | string | no | A workspace (id or name) to copy instead of creating an empty one. |
device | string | no | A device id (dev-…, from kode devices list): make a device workspace on that machine. The device must be online and active in the team. |
snapshot | string | no | With source a device workspace: the id (dsnap-…) of the snapshot to clone. |
access | array of string | no | Device workspaces only: names of extra sandbox access, such as xcode or android, defined on the person's machine. An undefined name keeps the workspace from starting. |
task | string | no | What the copy is for. Use at most 200 characters. |
wait | boolean | no | Return when the object has settled instead of at once. |
soft_ms | number | no | With wait: milliseconds before the call hands off with promoted: true. Default 25000, maximum 600000; a remote connector gets default 5000, maximum 20000. |
timeout_ms | number | no | For wait: milliseconds to wait. Default 25000, maximum 900000; a remote connector gets default 5000, maximum 20000. At the limit the answer has timed_out: true. |
snapshot_id | string | for restore | The snapshot to restore: a volume name, name@N, or a snapshot id. |
ttl_secs | integer | no | Seconds of unused time before the object is deleted, 600 to 2592000. |
clear | boolean | no | For ttl: remove the limit instead of setting ttl_secs. |
message | string | no | A note for the snapshot. |
volume | string | no | The volume name. Required on the first push of a volume. |
workspace_vars
Reads and sets the variables of a workspace.
Route: by action.
| Action | Route | Meaning |
|---|---|---|
get | GET /v1/workspaces/{id}/env | Shows the stored variables. A secret shows as its reference. |
set | PUT /v1/workspaces/{id}/env | Merges variables into the set, or replaces the set with replace. |
| Argument | Type | Required | Meaning |
|---|---|---|---|
action | string | yes | One of get, set. |
workspace | string | yes | The workspace id (ws-…) or name. |
variables | object | for set | Variable name to value. A value of exactly ${{ secrets.NAME }} reads a secret. |
replace | boolean | no | Replace the whole set instead of merging. {} clears it. |
restart_on_change | boolean | no | Restart the workspace whenever its variables change from now on. |
worktree
Adds or drops a worktree of a workspace.
Route: by action.
| Action | Route | Meaning |
|---|---|---|
add | POST /v1/workspaces/{id}/trees | Adds a second branch checkout to the workspace and waits for it to be ready. The answer gives the path of the worktree and a note on how to reach it. |
drop | DELETE /v1/workspaces/{id}/trees/{name} | Drops a worktree. |
| Argument | Type | Required | Meaning |
|---|---|---|---|
action | string | yes | One of add, drop. |
workspace | string | yes | The workspace id (ws-…) or name. |
name | string | yes | The worktree name. |
soft_ms | number | no | With wait: milliseconds before the call hands off with promoted: true. Default 25000, maximum 600000; a remote connector gets default 5000, maximum 20000. |
packages
Reads and changes the packages of a workspace.
Route: by action.
| Action | Route | Meaning |
|---|---|---|
list | GET /v1/workspaces/{id} | Lists the packages, and missing, the entries that have no binary on the path. |
add | GET /v1/workspaces/{id}, then PATCH /v1/workspaces/{id} | Adds entries. An entry with the same attr is replaced. |
remove | GET /v1/workspaces/{id}, then PATCH /v1/workspaces/{id} | Removes entries. |
update | POST /v1/workspaces/{id}/packages/update | Resolves the pinned versions again. |
| Argument | Type | Required | Meaning |
|---|---|---|---|
action | string | yes | One of list, add, remove, update. |
workspace | string | yes | The workspace id (ws-…) or name. |
packages | array of string | for add, remove | Top-level nixpkgs attribute names such as python3 or nodejs_22, optionally attr@version. Nested paths such as python3Packages.x are refused; install Python libraries with pip. add replaces the same attr. |
desk
Shows, picks, creates, and manages desks.
Route: by action.
| Action | Route | Meaning |
|---|---|---|
list | GET /v1/desks | Lists your desks, each with its id, name, team, and environment. Needs no desk. |
create | POST /v1/desks | Creates a desk, with an environment if environment is set. It moves nothing. Needs no desk. |
connect | PUT /v1/desks/{id}/environment | Sets the environment of desk; environment set to null disconnects it. Answers the desk's id, name, and environment. |
start | POST /v1/desks/{id}/start | Starts the members of a desk. |
stop | POST /v1/desks/{id}/stop | Stops the members of a desk. |
delete | DELETE /v1/desks/{id} | Deletes a desk. |
ttl | PUT /v1/desks/{id}/ttl | Sets or clears the unused-time limit. |
| Argument | Type | Required | Meaning |
|---|---|---|---|
action | string | yes | One of list, create, connect, start, stop, delete, ttl. |
team | string | no | The team slug. Omit it for your own. |
name | string | for create | The desk name for create. |
environment | string or null | for connect | An environment id or name of the desk's team. null disconnects. With create, connects it to the new desk. |
ttl_secs | integer | no | Seconds of unused time before the object is deleted, 600 to 2592000. |
desk | string | for connect, start, stop, delete, ttl | The desk id, name, or team/name. |
wait | boolean | no | Return when the object has settled instead of at once. |
soft_ms | number | no | With wait: milliseconds before the call hands off with promoted: true. Default 25000, maximum 600000; a remote connector gets default 5000, maximum 20000. |
clear | boolean | no | For ttl: remove the limit instead of setting ttl_secs. |
env
Creates, runs, copies, and removes environments.
Route: by action.
| Action | Route | Meaning |
|---|---|---|
list | GET /v1/environments | Lists the environments. |
get | GET /v1/environments/{id} | Shows the services, state, interceptedBy, proxy, restart_required, and volume. |
create | POST /v1/environments. With source: POST /v1/environments/{id}/clone | Creates an environment, or a copy of source. A clone shares its source's volume and history: its snapshots appear there and take the source's volume name. |
start | POST /v1/environments/{id}/start | Starts an environment. |
stop | POST /v1/environments/{id}/stop | Stops an environment. |
delete | DELETE /v1/environments/{id} | Deletes an environment. |
wait | GET /v1/environments/{id}, repeated | Waits until every service is ready, a service is failing, or the state is error or deleted. |
ttl | PUT /v1/environments/{id}/ttl | Sets or clears the unused-time limit. |
snapshot | POST /v1/environments/{id}/snapshots | Takes a snapshot of the environment volume. A clone shares its source's volume and history: its snapshots appear there and take the source's volume name. |
restore | POST /v1/environments/{id}/restore | Puts the environment back to a snapshot in place. It creates no environment and overwrites the current data; name is not used. A 409 with lost lists the services that lose data. The snapshot is the argument source. |
| Argument | Type | Required | Meaning |
|---|---|---|---|
action | string | yes | One of list, get, create, start, stop, delete, wait, ttl, snapshot, restore. |
team | string | no | The team slug. Omit it for your own. |
env | string | for get, start, stop, delete, wait, ttl, snapshot, restore | The environment id (env-…) or name. |
name | string | for create | The environment name. |
snapshot_id | string | for restore | The snapshot to restore: a volume name, name@N, or a snapshot id. |
services | array of object | no | The services, each {name, image, ports, env, mounts, command}. |
region | string | no | The region of the environment. |
source | string | no | For create: an environment (id or name) to copy live, or a snapshot id to grow a new environment from. |
wait | boolean | no | Return when the object has settled instead of at once. |
soft_ms | number | no | With wait: milliseconds before the call hands off with promoted: true. Default 25000, maximum 600000; a remote connector gets default 5000, maximum 20000. |
timeout_ms | number | no | For wait: milliseconds to wait. Default 25000, maximum 900000; a remote connector gets default 5000, maximum 20000. At the limit the answer has timed_out: true. |
ttl_secs | integer | no | Seconds of unused time before the object is deleted, 600 to 2592000. |
clear | boolean | no | For ttl: remove the limit instead of setting ttl_secs. |
message | string | no | A note for the snapshot. |
volume | string | no | The volume name. Required on the first push of a volume. |
discard | array of string | no | Names of the services in the 409 lost list whose data you accept losing. |
service
Adds, changes, removes, and reads the logs of environment services.
Route: by action.
| Action | Route | Meaning |
|---|---|---|
add | GET /v1/environments/{id}, then PATCH /v1/environments/{id} | Adds one service. |
update | GET /v1/environments/{id}, then PATCH /v1/environments/{id}. With restart: POST /v1/environments/{id}/services/{service}/restart | Merges the fields of service into the service of that name. env: {X: null} removes the key X. With restart, restarts it. |
remove | GET /v1/environments/{id}, then PATCH /v1/environments/{id} | Removes the service name. |
logs | GET /v1/environments/{id}/services/{service}/logs | Reads the logs of the service name. It starts an idle-stopped environment first. |
| Argument | Type | Required | Meaning |
|---|---|---|---|
action | string | yes | One of add, update, remove, logs. |
env | string | yes | The environment id (env-…) or name. |
service | object | for add, update | The service object. Its command, env, and mounts default to empty. |
wait | boolean | no | Return when the object has settled instead of at once. |
soft_ms | number | no | With wait: milliseconds before the call hands off with promoted: true. Default 25000, maximum 600000; a remote connector gets default 5000, maximum 20000. |
restart | boolean | no | Restart the service after the change so it reads its current variables and secrets. |
name | string | for remove, logs | The service name. |
tail | number | no | Keep the last N lines. The default is 200 and the maximum is 2000. |
since | number | no | Only the last N seconds. The maximum is 86400. |
previous | boolean | no | Read the run before a crash. |
intercept
Sends the traffic of an environment service to a workspace, or gives it back.
Route: by action.
| Action | Route | Meaning |
|---|---|---|
start | POST /v1/environments/{id}/intercepts | Sends the traffic of the service to the workspace. |
stop | DELETE /v1/environments/{id}/intercepts/{service} | Gives the service back to its own program. |
| Argument | Type | Required | Meaning |
|---|---|---|---|
action | string | yes | One of start, stop. |
env | string | yes | The environment id (env-…) or name. |
service | string | yes | The service. |
workspace | string | for start | The workspace id (ws-…) or name that receives the traffic. |
ports | array of object | no | For start: port remaps. service is the port callers dial on the environment service, workspace the port the workspace listens on. Omit to forward each port to the same number. |
wait | boolean | no | For start: return when the proxy is ready instead of at once. |
soft_ms | number | no | With wait: milliseconds before the call hands off with promoted: true. Default 25000, maximum 600000; a remote connector gets default 5000, maximum 20000. |
volume
Lists, reads, and deletes volumes.
Route: by action.
| Action | Route | Meaning |
|---|---|---|
list | GET /v1/volumes | Lists the volumes with ids and names. Each row carries used_by, the workspaces and environments that use the volume. |
get | GET /v1/volumes/{name}/history, GET /v1/volumes/{name}/refs | Shows the snapshots of a volume, its refs, and working. refs.latest is the newest push by time. working shows where each working copy stands: its base, its head, and its state. Each snapshot carries working_copies. A clone's first push has the latest push of its source at clone time as its parent. |
delete | DELETE /v1/volumes/{name} | Deletes a detached volume. |
| Argument | Type | Required | Meaning |
|---|---|---|---|
action | string | yes | One of list, get, delete. |
kind | string | no | Only volumes of this kind. |
owner | string | no | Only volumes of this owner. |
volume | string | for get, delete | The volume id from volume list. |
snapshot
Deletes a snapshot of a volume.
Route: by action.
| Action | Route | Meaning |
|---|---|---|
delete | DELETE /v1/volumes/{name}/snapshots/{id} | Deletes one snapshot. |
| Argument | Type | Required | Meaning |
|---|---|---|---|
action | string | yes | One of delete. |
volume | string | yes | The volume name or id. A clone shares its source's volume and history: its snapshots appear there and take the source's volume name. |
snapshot | string | yes | The snapshot id. |
quota
Shows the ceilings and the current use of an owner.
Route: GET /v1/quota.
| Argument | Type | Required | Meaning |
|---|---|---|---|
owner | string | no | The owner: a person handle or a team slug. |
requests_list
Lists the requests of the person and of their teams.
Route: GET /v1/requests.
| Argument | Type | Required | Meaning |
|---|---|---|---|
owner | string | no | The owner: a person handle or a team slug. |
request_get
Shows one request and its decision.
Route: GET /v1/requests/{id}.
| Argument | Type | Required | Meaning |
|---|---|---|---|
id | string | yes |
request_create
Asks an administrator for quota, access, a region, or anything else. The decision comes later.
Route: POST /v1/requests.
| Argument | Type | Required | Meaning |
|---|---|---|---|
owner | string | no | The team slug. Omit it for the person's own. |
kind | string, one of quota, access, region, other | yes | The kind. |
reason | string | yes | Why the person asks. |
quota | object | no | The new ceilings that you want. Give only the dimensions that change. |
access | object | no | |
region | string | no | The region the team moves to (only while the team has nothing). |
title | string | for other | The title. Without it the call answers 422 title is required for kind other. |
body | string | for other | The text. Without it the call answers 422 body is required for kind other. |
regions
Lists the regions in which a team can live.
Route: GET /v1/regions.
No arguments.
download
Hands one file of a workspace to the person. Only the owner of the workspace gets an answer, and the file is at most 200 MB. Nothing in the answer is a credential.
urlopens the file in the Kode console. The person must be signed in as the owner. Images, PDFs and text show in the browser; other files download.- On an MCP door the answer also has a
resource_linkblock withuri. The client reads the file withresources/readon its own connection, at most 7.5 MB that way.
The bytes go from the tool server to the browser or the client when they are read, never through the agent. A device workspace is read from its machine at that time, so the machine must be online.
Route: POST /v1/workspaces/{id}/file-link.
| Argument | Type | Required | Meaning |
|---|---|---|---|
workspace | string | yes | The workspace id or name. |
path | string | yes | The file, relative to the workspace. |
tree | string | no | Which worktree; omit for the main one. |
Answer: {url, uri, name, size, mime, note}, and a resource_link content block on an MCP door.
MCP resources
Every MCP door (/mcp and kode mcp) declares the resources capability. resources/templates/list answers one template, kode://workspace/{workspace}/file/{path} (?tree=NAME for a worktree); resources/list answers none. resources/read answers contents: [{uri, mimeType, text}] for a text file and [{uri, mimeType, blob}] (base64) for any other. It reads as the connection's own person, owner only, in the teams the connection may act in, and takes no desk. A file over 7.5 MB (10 MB of base64) is refused with a sentence that names download.
transfer
Copies one file from a workspace to another workspace of yours, or to another path of the same workspace. The file is at most 200 MB and can hold any bytes. The bytes go from the tool server of the source to the tool server of the destination, in ranges of 4 MiB, and never through the agent or the MCP client. The destination appears whole when the last range is written, or not at all. A destination that exists is refused unless overwrite is true. Both workspaces must be ready; a device workspace's machine must be online.
Route: tool server, both workspaces, found through GET /v1/workspaces/{id}/tools. That route answers the owner alone, so a workspace of another person is 404.
| Argument | Type | Required | Meaning |
|---|---|---|---|
from | object | yes | {workspace, path, tree?}: the file to copy. |
to | object | yes | {workspace, path, tree?}: where it goes. Parent folders are made. |
overwrite | boolean | no | Replace the destination when it exists. |
Answer: {from: {workspace, path}, to: {workspace, path, created}, bytes}. A refusal starts with from: or to: to say which side refused.
devices
Lists your own machines, the devices that run device workspaces. The id is what workspace create takes as device. Each row has id, name, os, arch, enabled, account (a handle or a team), online, last_seen_at and the workspaces the device reports. It never lists a token or the hardware id. Starting, connecting and removing a device are done on the machine.
Route: GET /v1/devices.
No arguments.
capsule
Runs one command in an isolated container.
Route: by action.
| Action | Route | Meaning |
|---|---|---|
create | POST /v1/desks/{id}/capsules in a desk, else POST /v1/capsules | Creates a capsule that runs command and ends when it exits. |
get | GET /v1/capsules/{id} | Shows phase, reason, exit_code, and message. |
list | GET /v1/capsules | Lists the capsules, each with its stage. |
wait | POST /v1/capsules/{id}/wait, repeated | Waits until the capsule is terminated. The answer carries stage, such as pulling image or installing packages. |
logs | GET /v1/capsules/{id}/logs | Reads the output. An ended capsule keeps its last 256 KiB. |
delete | POST /v1/capsules/{id}/terminate, then DELETE /v1/capsules/{id} | Ends a running capsule, then removes its record. |
| Argument | Type | Required | Meaning |
|---|---|---|---|
action | string | yes | One of create, get, list, wait, logs, delete. |
command | string or array of string | for create | A shell string, run with sh -c, or an argv array. |
image | string | no | The container image. |
packages | array of string | no | Top-level nixpkgs attribute names such as python3 or nodejs_22, optionally attr@version. Nested paths such as python3Packages.x are refused; install Python libraries with pip. |
variables | object | no | Environment variables for the command. A value of exactly ${{ secrets.NAME }} reads a secret. |
lifetime_s | integer | no | The hard lifetime in seconds, 10 to 86400. The default is 300. |
team | string | no | The team slug. In a desk its own team is used. |
from_workspace | string | no | A workspace of yours (id, name, or team/name) whose current files the capsule starts as, uncommitted work included. |
from_snapshot | string | no | A snapshot id or name@N whose files the capsule starts as. A snapshot of an environment is mounted at ~/volumes/<folder>, and the create answer says so in note. |
wait | boolean | no | Return when the object has settled instead of at once. |
soft_ms | number | no | With wait: milliseconds before the call hands off with promoted: true. Default 25000, maximum 600000; a remote connector gets default 5000, maximum 20000. |
timeout_ms | number | no | For wait: milliseconds to wait. Default 25000, maximum 900000; a remote connector gets default 5000, maximum 20000. At the limit the answer has timed_out: true. |
capsule | string | for get, wait, logs, delete | The capsule id (cap-…) or name. |
state | string | no | Only capsules in this state: waiting, running, ended, stopped, timed-out, or failed. |
q | string | no | Only capsules whose id, image, packages, or command contain this text. |
limit | integer | no | The maximum number of rows. |
tail | integer | no | Keep the last N lines. The default is 200 and the maximum is 2000. |
head | integer | no | Keep the first N lines. It applies before tail. |
pipeline
Saves, reads, and deletes pipelines and their versions.
Route: by action.
| Action | Route | Meaning |
|---|---|---|
list | GET /v1/pipelines/{owner} | Lists the pipelines with the latest version and the triggers. |
get | GET /v1/pipelines/{owner}/{name}. With version: GET /v1/pipelines/{owner}/{name}/versions/{version} | Shows the pipeline with its versions, or one definition. |
save | POST /v1/pipelines/{owner} for a new pipeline, else PUT /v1/pipelines/{owner}/{name} | Saves a definition as the next version. |
delete | DELETE /v1/pipelines/{owner}/{name}. With version: DELETE /v1/pipelines/{owner}/{name}/versions/{version} | Deletes the pipeline, or one old version. |
| Argument | Type | Required | Meaning |
|---|---|---|---|
action | string | yes | One of list, get, save, delete. |
owner | string | yes | The owner: your handle or a team slug. |
pipeline | string | for get, delete | The pipeline name. |
version | integer | no | get: that version. delete: only that version, not the latest and not one that a run reads. |
definition | object | for save | The pipeline definition (JSON). Its name names the pipeline. An equal definition saves nothing. A save that turns the webhook on answers webhookUrl once. |
webhook_rotate
Makes a new webhook secret for a pipeline. The old URL stops at once. The answer holds the new webhookUrl once.
Route: POST /v1/pipelines/{owner}/{name}/webhook/rotate.
| Argument | Type | Required | Meaning |
|---|---|---|---|
owner | string | yes | Your handle, or a team slug. |
pipeline | string | yes | The pipeline name. |
run
Starts, reads, waits for, and cancels pipeline runs.
Route: by action.
| Action | Route | Meaning |
|---|---|---|
start | POST /v1/pipelines/{owner}/{pipeline}/runs | Starts a run and answers its id. |
list | GET /v1/pipelines/{owner}/{pipeline}/runs, else GET /v1/pipelines/{owner}/runs | Lists the runs. |
get | GET /v1/pipelines/{owner}/{pipeline}/runs/{id} | Shows the state, jobs, failedStep, and exitCode. A cancelled job carries no failedStep; its detail names the step that was running. |
wait | GET /v1/pipelines/{owner}/{pipeline}/runs/{id}, repeated | Waits until the run ends. |
logs | GET /v1/pipelines/{owner}/{pipeline}/runs/{id}/jobs/{index}/logs | Reads a page of a job log. |
cancel | POST /v1/pipelines/{owner}/{pipeline}/runs/{id}/cancel | Cancels a run. |
| Argument | Type | Required | Meaning |
|---|---|---|---|
action | string | yes | One of start, list, get, wait, logs, cancel. |
owner | string | yes | The owner: your handle or a team slug. |
pipeline | string | for start, get, wait, logs, cancel | The pipeline name. |
inputs | object | no | String values by input name. |
version | integer | no | The version to run. The default is the newest. |
key | string | no | A retry key. A second start with the same key answers the first run. |
wait | boolean | no | Return when the object has settled instead of at once. |
soft_ms | number | no | With wait: milliseconds before the call hands off with promoted: true. Default 25000, maximum 600000; a remote connector gets default 5000, maximum 20000. |
timeout_ms | number | no | For wait: milliseconds to wait. Default 25000, maximum 900000; a remote connector gets default 5000, maximum 20000. At the limit the answer has timed_out: true. |
state | string | no | Only runs in this state: queued, running, success, failure, or cancelled. |
limit | integer | no | The maximum number of rows. |
run | string | for get, wait, logs, cancel | The run id from run list or start. |
job | integer | no | The index of the job in the run. The default is 0. |
offset | integer | no | A byte offset into the job output. logs: the page from there, with next and complete. wait: also answers that page as output. |
tail | integer | no | Keep the last N lines. The default is 200 and the maximum is 2000. |
head | integer | no | Keep the first N lines. It applies before tail. |
secret_set
Stores a secret value and replaces an existing one. The value is never printed back. The answer holds name and updatedAt only. A workspace or service reads the secret through an environment value that is exactly ${{ secrets.NAME }}. The harness keeps each desk transcript and stores this call with value replaced by ***; the model's context still holds the value for the turn.
Route: PUT /v1/secrets/{owner}/{name}, or PUT /v1/secrets/{owner}/mine/{name} with mine.
| Argument | Type | Required | Meaning |
|---|---|---|---|
owner | string | yes | Your handle, or a team slug. A team secret needs a team admin. |
name | string | yes | A-Z, 0-9, and _, not starting with a digit. |
value | string | yes | The value, at most 64 KiB. |
mine | boolean | no | Store your own secret in the team. |
secret_list
Lists the names of the secrets of an owner, with the date and the author of the last change. It never shows a value.
Route: GET /v1/secrets/{owner}, or GET /v1/secrets/{owner}/mine with mine.
| Argument | Type | Required | Meaning |
|---|---|---|---|
owner | string | yes | Your handle, or a team slug. |
mine | boolean | no | List your own secrets in the team. |
secret_delete
Deletes one secret. The call answers 409, and names the referrers, while a workspace, capsule, service, or pipeline uses it.
Route: DELETE /v1/secrets/{owner}/{name}, or DELETE /v1/secrets/{owner}/mine/{name} with mine.
| Argument | Type | Required | Meaning |
|---|---|---|---|
owner | string | yes | Your handle, or a team slug. |
name | string | yes | The secret name. |
mine | boolean | no | Delete your own secret in the team. |
connector_list
Lists the connectors of an owner, with the provider, the kind, the account, and the state of each. It is read only. Connecting happens in the web console.
Route: GET /v1/connectors.
| Argument | Type | Required | Meaning |
|---|---|---|---|
owner | string | no | Your handle, or a team slug. The default is your own. |
status
Answers the notices not yet delivered on this connection, and a short summary of what runs. It lists the workspaces of the desk and their processes. It also gives lifecycle notices: a restart, a stop, an error, and a change of the environment. A restarted bench still reports the idle stops and evictions it missed. Call it once at the start of each turn, before other work.
No route. The tool reads the desk's notice queue, GET /v1/workspaces, the desk's environment and process_list of every workspace a tool touched in the last hour.
| Argument | Type | Required | Meaning |
|---|---|---|---|
all | boolean | no | Also list the notices already delivered (the last 50). |
Result: {notices, workspaces: [{name, state}], environment: {name, state} | null, processes: [{workspace, id, cmd}]}. A notice is delivered once: a second call without all does not repeat it. Notices also ride on any other tool answer, as before.
workspace_ask
Gives a goal to the desk of a workspace. The answer arrives later as a message.
No route. The tool sends a message to the desk of the workspace.
| Argument | Type | Required | Meaning |
|---|---|---|---|
workspace | string | yes | The workspace id (ws-…). |
request | string | yes | |
for | string | no | The id of your own board task this ask serves. |
question
Asks the developer a question and waits for the answer.
No route. The tool puts the question on the card of the desk and returns the option that the developer selects.
| Argument | Type | Required | Meaning |
|---|---|---|---|
question | string | yes | The question to ask. |
options | array of string | yes | The answers that the developer can select. Give 2 to 5. |
main_tell
Tells the main desk that a task is done, blocked, or needs something.
No route. The tool sends a message to the main desk. Use it from the desk of a workspace.
| Argument | Type | Required | Meaning |
|---|---|---|---|
kind | string | yes | One of done, blocked, need. |
text | string | yes | The report. For blocked, say what would unblock you. |
task
Keeps the board of the agent, which the developer follows.
No route. The tool reads and writes the board of the agent.
| Action | Route | Meaning |
|---|---|---|
list | none | Lists the tasks. With workspace, lists the board of that workspace; * lists every workspace board. |
add | none | Adds a task. |
update | none | Changes a task. Set it to running before you start it and to done when its check passes. |
| Argument | Type | Required | Meaning |
|---|---|---|---|
action | string | yes | One of list, add, update. |
workspace | string | no | A workspace id whose board list shows. You cannot change it. |
title | string | for add | The title. |
id | string | for update | The task id. |
priority | integer | no | Lower runs first. |
depends_on | array of string | no | The ids of the tasks that must be done first. |
state | string | no | One of queued, running, blocked, done, failed. |
note | string | no | A note. |
summary | string | no | For done: what changed and where. Use at most 2000 characters. |
verified | string | no | For done: the check that passed, with its result. |