Luxor Sandbox MCP
v0.4.4Disposable microVM sandboxes for AI agents: run code, read/write files, git, preview URLs.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
tenki_whoami Show Current Identity
Return the identity and workspaces for the current API key. Cheap credential test.
tenki_run_code Run Code in a Throwaway Sandbox
Boot a throwaway microVM, run a snippet (shell/python/javascript), return its stdout/stderr/exit code, and tear the sandbox down. Cost-guarded and self-terminating. Use this for one-shot execution when you don't need a persistent sandbox. Output over ~64KB per stream is truncated head+tail — and the sandbox is gone, so for large output use tenki_create_sandbox + tenki_exec and page through the retained file.
| Parameter | Type | Description |
|---|---|---|
code * | string | The code to run. |
language * | string | Interpreter for the snippet. |
env | object | Environment variables as a key→value object. |
timeout_seconds | integer | Max seconds for the run (default 30). |
tenki_create_sandbox Create Sandbox
Create a persistent sandbox microVM, optionally from a snapshot or template image. Returns the session (id, state), its data-plane endpoint, and any `warnings` the API attached (e.g. a max duration that was capped or overridden by sticky). Boots in ~2s. Use tenki_exec / tenki_read_file / tenki_write_file against the returned session id.
tenki_get_sandbox Get Sandbox
Fetch a sandbox's current state and metadata.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. |
tenki_get_sandbox_metrics Get Sandbox Metrics
Get a sandbox's CPU and memory usage averaged over a recent window (default 5 minutes; 1 minute to 30 days): average cores / percent of limit, average bytes / percent of limit, sample count and coverage. Use to right-size a sandbox or spot a runaway process.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. |
window_seconds | integer | Averaging window in seconds ending now: 60 (1 minute) to 2592000 (30 days). Omit for the API default (5 minutes). |
tenki_list_sandboxes List Sandboxes
List the credential's sandboxes (workspace scope is inferred from the API key), optionally filtered by tags or stickiness. Paginated: a nextPageToken in the response means more pages exist.
| Parameter | Type | Description |
|---|---|---|
include_terminated | boolean | Include terminated sandboxes (default false). |
page_size | integer | Rows per page (max 100). |
page_token | string | Cursor from a previous response's nextPageToken. |
sticky | boolean | Only sticky (true) or only non-sticky (false) sandboxes. |
tags | array | Only sandboxes carrying all of these tags. |
tenki_terminate_sandbox Terminate Sandbox
Terminate (destroy) a sandbox. The microVM and its filesystem are gone after this.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. |
tenki_pause_sandbox Pause Sandbox
Pause a sandbox (snapshot + suspend) so it can be resumed later. By default the call blocks until the pause checkpoint is saved on the sandbox's host (replication to storage continues in the background); pass async to return as soon as the pause is accepted and poll tenki_get_sandbox for PAUSED. A sandbox attached to a tailnet cannot be paused yet (failed_precondition).
| Parameter | Type | Description |
|---|---|---|
session_id * | string | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. |
async | boolean | Return once the pause is accepted instead of waiting for it to finish (default false). |
tenki_resume_sandbox Resume Sandbox
Resume a previously paused sandbox. By default the call blocks until the sandbox is RUNNING (or the resume fails, as aborted with the reason); pass async to return as soon as the resume is accepted and poll tenki_get_sandbox for RUNNING. Calling it while a resume is already in progress joins that resume instead of failing.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. |
async | boolean | Return once the resume is accepted instead of waiting for RUNNING (default false). |
tenki_fork_sandbox Fork Sandbox
Fork a RUNNING sandbox: snapshot its memory and disk, then start child sandboxes that continue from that state while the source keeps running. Children get the source's size, lifetime limits, inbound/outbound and egress settings and tags, plus fork_of_session_id / fork_snapshot_id metadata; they do not copy its tailnet attachment (they join the workspace's default Tailscale connection, if one is set). Returns snapshotId and the child sessions. Refused while volumes are attached (failed_precondition; detach them first) or when forking is disabled for the workspace (permission_denied). The fork…
| Parameter | Type | Description |
|---|---|---|
session_id * | string | The RUNNING sandbox to fork. |
count | integer | Children to create (default 1). The workspace caps children per request (10 by default; Tenki staff can change it; more is resource_exhausted) and each child counts toward the concurrent-sandbox limit… |
name_prefix | string | Children are named <name_prefix>-1 … <name_prefix>-<count> (default '<source name>-fork', or 'fork-<first 8 characters of its id>' for an unnamed sandbox). |
wait | boolean | Return only once every child is RUNNING (or has ended) instead of as soon as each is created (default false). |
tenki_extend_sandbox Extend Sandbox Lifetime
Extend a running sandbox's wall-clock lifetime by N seconds so it isn't auto-terminated at its max-duration cap.
| Parameter | Type | Description |
|---|---|---|
additional_duration_seconds * | integer | Extra lifetime to add, in seconds (sent as a Duration string, e.g. 3600s). |
session_id * | string | The sandbox/session ID to extend. |
tenki_update_sandbox Update Sandbox
Update mutable fields on an existing sandbox: name, tags, sticky flag, or max duration. The idle timeout is NOT updatable after creation (UpdateSession has no such field). max_duration_seconds requires an explicit sticky value on the wire: when you pass it without `sticky` the tool checks the sandbox and sends sticky=false only if it is not already sticky (a sticky sandbox is refused, to avoid silently revoking stickiness); sticky=true discards max_duration with a warning. The response carries any `warnings` the API returned.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | The sandbox/session ID to update. |
clear_tags | boolean | Remove all tags from the sandbox. |
max_duration_seconds | integer | New hard lifetime cap in seconds (sent as a Duration string, e.g. 3600s). Sends sticky=false for a non-sticky sandbox unless sticky is given; refused on a sticky sandbox without an explicit sticky val… |
name | string | New human-readable name (max 64 chars). |
sticky | boolean | true = keep the sandbox alive with no hard lifetime cap (not allowed for service credentials). false = ordinary lifetime: pass max_duration_seconds with it, otherwise the API resets the cap to the wor… |
tags | array | Replacement tag list. Pass [] (or clear_tags) to remove all tags. |
tenki_terminate_sandboxes Terminate Multiple Sandboxes
Terminate MULTIPLE sandboxes in one call (bulk, max 100 per call). IRREVERSIBLE — every listed sandbox and its filesystem is destroyed. The response lists `sessions` that were terminated and `failures` with a reason per id that was not. Use tenki_terminate_sandbox for a single one.
| Parameter | Type | Description |
|---|---|---|
session_ids * | array | The sandbox/session IDs to terminate (1-100). |
tenki_report_sandbox_activity Report Sandbox Activity
Report client-side activity on a sandbox to reset its idle timer and keep it from being reaped as idle (a keep-alive heartbeat).
| Parameter | Type | Description |
|---|---|---|
session_id * | string | The sandbox/session ID to mark as active. |
tenki_list_workspace_sandboxes List Workspace Sandboxes
List every sandbox belonging to a specific workspace (defaults to the API key's workspace) with server-side search (name, id, snapshot names/ids, image refs), state/tag/sticky filters, sorting and optional state-count facets — useful for finding a sandbox by name or spotting leaked, still-billing ones. NOTE: the underlying RPC (ListWorkspaceSandboxes) is marked deprecated upstream, but it is the only list with search/sort; tenki_list_sandboxes is the plain credential-scoped list.
| Parameter | Type | Description |
|---|---|---|
include_facets | boolean | Also return per-state counts for the same filter scope (facets). |
include_terminated | boolean | Include terminated sandboxes (default false). |
order | string | Default order is newest first; STATE_THEN_CREATED groups running, then paused, then terminated (newest first within each). Ignored when sort_by is set. |
page_size | integer | Rows per page (max 100). |
page_token | string | Cursor from a previous response's nextPageToken. |
search | string | Free-text search over name, id, snapshot names/ids and published image refs (max 256 chars). |
sort_by | string | Column to sort by (overrides order). |
sort_desc | boolean | Sort descending (default ascending). |
state | string | Only sandboxes in this one state (combines with states). |
states | array | Only sandboxes in any of these states (empty = no filter). |
sticky | boolean | Only sticky (true) or only non-sticky (false) sandboxes. |
tags | array | Only sandboxes carrying all of these tags. |
workspace_id | string | Workspace to list (defaults to the key's first workspace). |
tenki_exec Run Command in Sandbox
Run a command in an existing sandbox and return stdout, stderr, and exit code inline. Streams over max_output_bytes (default 64KB) come back as a head+tail preview with the full output retained at stdoutPath/stderrPath in the sandbox.
| Parameter | Type | Description |
|---|---|---|
command * | string | Executable, e.g. 'npm' or 'python3'. |
session_id * | string | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. |
args | array | Arguments. |
cwd | string | Working directory (honored in-script). |
env | object | Environment variables as a key→value object. |
max_output_bytes | integer | Per-stream inline output cap in bytes (default 65536). Larger output is truncated head+tail and kept in the sandbox at stdoutPath/stderrPath. |
timeout_seconds | integer | Maximum seconds the command may run before it is stopped; omit to use the API's default. |
tenki_read_file Read File
Read a UTF-8 text file from a sandbox (paths under /home/tenki). Returns at most max_bytes (default 65536) starting at offset, plus the file's totalBytes; when more remains the response has truncated: true and nextOffset — pass it as offset to read the next part.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path inside the sandbox, under /home/tenki. |
session_id * | string | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. |
max_bytes | integer | Maximum bytes of content to return (default 65536, max 1048576). Cuts never split a UTF-8 character. |
offset | integer | Byte offset to start reading at (default 0). Use nextOffset from a truncated response. |
tenki_write_file Write File
Write a UTF-8 text file to a sandbox (paths under /home/tenki), creating it or replacing its entire contents.
| Parameter | Type | Description |
|---|---|---|
content * | string | Full text to write; an existing file is overwritten. |
path * | string | Absolute path inside the sandbox, under /home/tenki. |
session_id * | string | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. |
tenki_list_files List Directory
List a directory in a sandbox, including dotfiles (.git, .env, .gitignore) by default — set include_hidden false to omit them.
| Parameter | Type | Description |
|---|---|---|
path * | string | Directory path, e.g. /home/tenki |
session_id * | string | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. |
include_hidden | boolean | Include dot-prefixed entries (default true). The data plane omits them unless asked, which hides .git/.env from a listing. |
tenki_stat_path Get Path Info
Get metadata (size, mode, type, timestamps) for a file or directory in a sandbox. Use to check whether a path exists or inspect it before reading/removing.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path under /home/tenki, e.g. /home/tenki/output.txt |
session_id * | string | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. |
tenki_make_dir Create Directory
Create a directory in a sandbox. Set recursive to also create any missing parent directories (mkdir -p).
| Parameter | Type | Description |
|---|---|---|
path * | string | Directory path under /home/tenki, e.g. /home/tenki/project/out |
session_id * | string | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. |
mode | integer | Permission bits as a number (e.g. 448 for 0700). Default: the sandbox user's umask. |
recursive | boolean | Create parent directories as needed (default false). |
tenki_remove_path Delete File or Directory
Delete a file or directory in a sandbox. Set recursive to remove a non-empty directory and its contents (rm -r).
| Parameter | Type | Description |
|---|---|---|
path * | string | Path to delete under /home/tenki. |
session_id * | string | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. |
recursive | boolean | Remove a directory and its contents (default false). |
tenki_move_path Move or Rename Path
Move or rename a file or directory within a sandbox. Both paths are under /home/tenki.
| Parameter | Type | Description |
|---|---|---|
from * | string | Source path under /home/tenki, e.g. /home/tenki/old.txt |
session_id * | string | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. |
to * | string | Destination path under /home/tenki, e.g. /home/tenki/new.txt |
tenki_git_clone Clone Git Repository
Clone a git repository into a sandbox and return git's output. The target directory must not already exist or must be empty. For other git commands (status, add, commit, push, ...) use tenki_exec with `git ...`.
| Parameter | Type | Description |
|---|---|---|
repo * | string | Repository URL to clone, e.g. https://github.com/octocat/Hello-World. |
session_id * | string | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. |
branch | string | Branch or tag to check out after cloning (git clone --branch). |
depth | integer | Create a shallow clone with this many commits (git clone --depth). |
directory | string | Directory to clone into, e.g. /home/tenki/myrepo. Defaults to the repository name under /home/tenki. |
tenki_git_checkout Check Out Git Ref
Check out a branch, tag or commit in a repository inside a sandbox (git checkout), optionally creating a new branch. Changes the files in the working tree.
| Parameter | Type | Description |
|---|---|---|
ref * | string | Branch, tag or commit to check out, or the name of the branch to create when create is true. |
session_id * | string | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. |
create | boolean | Create ref as a new branch from the current HEAD (git checkout -b). Default false. |
directory | string | Repository directory in the sandbox, e.g. /home/tenki/myrepo (relative paths resolve from /home/tenki). Omit only if the repository is /home/tenki itself. |
tenki_git_diff Show Git Diff
Show a diff for a repository inside a sandbox (git diff): unstaged working-tree changes by default, or between refs. Read-only. Output over 65536 bytes is truncated.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. |
base | string | Base ref to diff from (with head: git diff base..head; alone: git diff base). |
directory | string | Repository directory in the sandbox, e.g. /home/tenki/myrepo (relative paths resolve from /home/tenki). Omit only if the repository is /home/tenki itself. |
head | string | Head ref to diff to (with base: git diff base..head; alone: git diff head). |
path | string | Limit the diff to this file or directory, relative to the repository root. |
range | string | Revision range, e.g. main..feature or HEAD~3. Cannot be combined with base/head. |
tenki_git_log Show Git Log
Show commit history for a repository inside a sandbox (git log). Read-only. Output over 65536 bytes is truncated.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. |
directory | string | Repository directory in the sandbox, e.g. /home/tenki/myrepo (relative paths resolve from /home/tenki). Omit only if the repository is /home/tenki itself. |
max_count | integer | Maximum number of commits to show (git log --max-count). Set this to keep output small. |
path | string | Only commits touching this file or directory, relative to the repository root. |
range | string | Revision range, e.g. main..feature. |
tenki_expose_port Expose Port
Expose a port from a sandbox and get a public preview URL (a slug is auto-generated unless you pass one). Useful when an agent starts a web server it wants to show. Requires allow_inbound. The API marks ExposePort deprecated in favour of CreatePreviewUrl — if you already have a slug, prefer tenki_create_preview_url; to take the URL down use tenki_unbind_preview_url / tenki_delete_preview_url with the returned previewUrlId.
| Parameter | Type | Description |
|---|---|---|
port * | integer | TCP port inside the sandbox (1-65535). |
session_id * | string | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. |
expires_at | string | Optional RFC-3339 timestamp at which the preview URL auto-expires. Omit to keep it until the sandbox ends. |
slug | string | Subdomain slug for the preview URL (3-63 chars, lowercase letters/digits/hyphens, no leading/trailing hyphen). |
tenki_list_exposed_ports List Exposed Ports
List the ports currently exposed from a sandbox. DEPRECATED upstream (ListExposedPorts): prefer tenki_list_preview_urls with session_id, which lists the same bindings with their ids, slugs and expiry.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. |
tenki_unexpose_port Unexpose Port
Remove an inbound port exposure from a sandbox, unbinding EVERY preview URL on that port and taking them offline. DEPRECATED upstream (UnexposePort): to take one specific preview URL offline use tenki_unbind_preview_url or tenki_delete_preview_url with its id.
| Parameter | Type | Description |
|---|---|---|
port * | integer | The TCP port inside the sandbox to unexpose (1-65535). |
session_id * | string | The sandbox session whose port to unexpose. |
tenki_create_preview_url Create Preview URL
Create a shareable public preview URL for a port in a sandbox. The sandbox must have inbound networking enabled (create it with allow_inbound).
| Parameter | Type | Description |
|---|---|---|
port * | integer | The TCP port inside the sandbox to create a preview URL for (1-65535). |
session_id * | string | The sandbox session serving the port. |
slug * | string | Subdomain slug for the preview URL (3-63 chars, lowercase letters/digits/hyphens, no leading/trailing hyphen). |
expires_at | string | Optional RFC-3339 timestamp at which the preview URL auto-expires. Omit to keep it until the sandbox ends. |
tenki_open_preview Open Authenticated Preview
Open a viewer-token-gated preview of a port in a sandbox and return its URL and viewer token; unlike tenki_expose_port and tenki_create_preview_url, the URL is not public. Port 7681 is the sandbox's browser web terminal (ttyd, in the standard images). Requires a sandbox created with allow_inbound; port 22 is reserved. Opening the same port again replaces its earlier preview URL.
| Parameter | Type | Description |
|---|---|---|
port * | integer | The TCP port inside the sandbox to open a preview for (1-65535, not 22). 7681 opens the web terminal. |
session_id * | string | The sandbox serving the port. |
expires_at | string | Optional RFC-3339 timestamp at which the preview auto-expires. Omit to keep it until the sandbox ends. |
tenki_list_preview_urls List Preview URLs
List the workspace's preview URLs with server-side search, binding-state filter, sorting and optional state-count facets; each row carries the bound sandbox's sessionState and sessionName. Pass session_id to list only the ones bound to that sandbox. Paginated: a nextPageToken in the response means more pages exist.
| Parameter | Type | Description |
|---|---|---|
include_facets | boolean | Also return per-state counts for the same filter scope. |
page_size | integer | Rows per page (server default 20, max 100). |
page_token | string | Cursor from a previous response's nextPageToken. |
search | string | Free-text search over slug/id (max 256 chars). |
session_id | string | Only preview URLs bound to this sandbox. |
sort_by | string | Column to sort by. |
sort_desc | boolean | Sort descending (default ascending). |
states | array | Only preview URLs in any of these binding states (OFFLINE = bound to a non-running sandbox, ORPHANED = bound to a sandbox that no longer exists). |
workspace_id | string | Workspace to list (defaults to the key's first workspace). |
tenki_get_preview_url Get Preview URL
Fetch a specific preview URL's details by id OR by slug (pass exactly one).
| Parameter | Type | Description |
|---|---|---|
preview_url_id | string | The preview URL id. |
slug | string | The preview URL's slug (alternative to preview_url_id). |
tenki_delete_preview_url Delete Preview URL
Delete a preview URL by id, taking it permanently offline.
| Parameter | Type | Description |
|---|---|---|
preview_url_id * | string | The preview URL id to delete. |
tenki_touch_preview Keep Preview Alive
Refresh (keep-alive) a live preview by its preview token so it isn't torn down as idle.
| Parameter | Type | Description |
|---|---|---|
preview_token * | string | The preview token (from create_preview_url / open_preview). |
tenki_bind_preview_url Bind Preview URL
Bind a named preview URL to a sandbox session and port (advanced routing). A URL whose expiry has lapsed can only be re-bound with a new expires_at.
| Parameter | Type | Description |
|---|---|---|
port * | integer | The port to route the preview URL to. |
preview_url_id * | string | The preview URL id to bind. |
session_id * | string | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. |
expires_at | string | Optional RFC-3339 timestamp replacing the URL's expiry deadline (required when re-binding a lapsed URL). |
tenki_unbind_preview_url Unbind Preview URL
Unbind a named preview URL from its current session/port (advanced routing).
| Parameter | Type | Description |
|---|---|---|
preview_url_id * | string | The preview URL id to unbind. |
tenki_resolve_preview_token Resolve Preview Token
Resolve a preview token to the sandbox/port it points at (advanced).
| Parameter | Type | Description |
|---|---|---|
token * | string | The preview token to resolve. |
tenki_create_snapshot Create Snapshot
Capture a running sandbox's disk and memory as a reusable snapshot (attached volumes are NOT captured); boot a new sandbox from it later with tenki_create_sandbox + snapshot_id.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | The sandbox session to snapshot. |
async | boolean | Return as soon as the snapshot row exists and poll tenki_get_snapshot for READY, instead of blocking until the capture finishes (default false). |
expires_at | string | RFC-3339 / ISO-8601 timestamp at which the snapshot is auto-deleted. Omit to keep indefinitely. |
name | string | Human-readable name for the snapshot. |
store_raw_image | boolean | Also store the raw disk image alongside the snapshot (needed to download it later). |
tenki_get_snapshot Get Snapshot
Fetch one snapshot's status and metadata by ID.
| Parameter | Type | Description |
|---|---|---|
snapshot_id * | string | Snapshot id, from tenki_create_snapshot or tenki_list_snapshots. |
tenki_list_snapshots List Snapshots
List the saved snapshots for the workspace (owner inferred from the API key).
| Parameter | Type | Description |
|---|---|---|
page_size | integer | Rows per page. |
page_token | string | Cursor from a previous response's nextPageToken. |
tenki_list_session_snapshots List Sandbox Snapshots
List the snapshots captured from a specific sandbox session.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. |
page_size | integer | Rows per page. |
page_token | string | Cursor from a previous response's nextPageToken. |
tenki_list_dangling_snapshots List Dangling Snapshots
List dangling snapshots — those whose source session no longer exists — for the workspace, useful for cleanup.
| Parameter | Type | Description |
|---|---|---|
page_size | integer | Rows per page. |
page_token | string | Cursor from a previous response's nextPageToken. |
tenki_update_snapshot Update Snapshot
Update a snapshot's mutable metadata: name, expiry (set or clear), and tags. An expired snapshot can no longer be updated, and a pause snapshot's expiry is managed by its sandbox (both failed_precondition).
| Parameter | Type | Description |
|---|---|---|
snapshot_id * | string | Snapshot id, from tenki_create_snapshot or tenki_list_snapshots. |
clear_expires_at | boolean | Remove the expiry so the snapshot is kept indefinitely. |
clear_tags | boolean | Remove all tags from the snapshot. |
expires_at | string | New RFC-3339 / ISO-8601 auto-delete timestamp. |
name | string | New human-readable name (max 64 chars). |
tags | array | Replacement tag list. Pass [] (or clear_tags) to remove all tags. |
tenki_delete_snapshot Delete Snapshot
Permanently delete a snapshot by ID.
| Parameter | Type | Description |
|---|---|---|
snapshot_id * | string | Snapshot id, from tenki_create_snapshot or tenki_list_snapshots. |
tenki_get_snapshot_download_url Get Snapshot Download URL
Get a short-lived, pre-signed URL to download a snapshot's raw disk image (requires the snapshot to have been created with store_raw_image).
| Parameter | Type | Description |
|---|---|---|
snapshot_id * | string | Snapshot id, from tenki_create_snapshot or tenki_list_snapshots. |
tenki_list_workspace_snapshots List Workspace Snapshots
List all snapshots in a workspace (defaults to the key's first workspace). Supports pagination. NOTE: the underlying RPC (ListWorkspaceSnapshots) is deprecated upstream in favour of the credential-scoped tenki_list_snapshots; prefer that unless you need an explicit workspace_id.
| Parameter | Type | Description |
|---|---|---|
page_size | integer | Rows per page. |
page_token | string | Cursor from a previous response's nextPageToken. |
workspace_id | string | Workspace to list (defaults to the key's first workspace). |
tenki_create_volume Create Volume
Create a workspace-scoped persistent volume — durable block storage that survives sandbox teardown. Defaults the workspace to the API key's first; override with workspace_id.
| Parameter | Type | Description |
|---|---|---|
name * | string | Human-readable name for the volume. |
size_bytes * | integer | Volume size in bytes. Must be between 1 MiB (1048576) and 100 GiB (107374182400). |
workspace_id | string | Workspace to create the volume in (defaults to the key's first workspace). |
tenki_get_volume Get Volume
Fetch a single volume's metadata and current state by its id.
| Parameter | Type | Description |
|---|---|---|
volume_id * | string | The volume id, e.g. vol_…. |
tenki_list_volumes List Volumes
List persistent volumes in a workspace (defaults to the key's first workspace) with server-side search, state filter, sorting and optional state-count facets. Supports pagination.
| Parameter | Type | Description |
|---|---|---|
include_facets | boolean | Also return per-state counts for the same filter scope. |
page_size | integer | Max volumes to return per page (max 100). |
page_token | string | Page token from a previous response's nextPageToken. |
search | string | Free-text search over volume name/id (max 256 chars). |
sort_by | string | Column to sort by. |
sort_desc | boolean | Sort descending (default ascending). |
states | array | Only volumes in any of these states. |
workspace_id | string | Workspace to list volumes from (defaults to the key's first workspace). |
tenki_update_volume Update Volume
Update a volume's name and/or tags (pass at least one). To change a volume's size use tenki_resize_volume instead.
| Parameter | Type | Description |
|---|---|---|
volume_id * | string | The volume id to update. |
clear_tags | boolean | Remove all tags from the volume. |
name | string | New human-readable name for the volume. |
tags | array | Replacement tag list. Pass [] (or clear_tags) to remove all tags. |
tenki_delete_volume Delete Volume
Permanently delete a volume and destroy its data. Fails with VolumeInUse if the volume is still attached to a session — detach it first.
| Parameter | Type | Description |
|---|---|---|
volume_id * | string | The volume id to delete. |
tenki_resize_volume Resize Volume
Change a volume's size in bytes (1 MiB … 100 GiB). Only a volume that has never been attached can be resized; once attached its size is fixed (failed_precondition), so create a new volume for a different size.
| Parameter | Type | Description |
|---|---|---|
size_bytes * | integer | Volume size in bytes. Must be between 1 MiB (1048576) and 100 GiB (107374182400). |
volume_id * | string | The volume id to resize. |
tenki_attach_volume Attach Volume
Mount a volume into a running sandbox at an absolute path. Set read_only to mount without write access.
| Parameter | Type | Description |
|---|---|---|
mount_path * | string | Absolute path inside the sandbox to mount at, e.g. /mnt/data. |
session_id * | string | The sandbox session to attach the volume to. |
volume_id * | string | The volume id to attach. |
read_only | boolean | Mount the volume read-only (default false = read-write). |
tenki_detach_volume Detach Volume
Unmount a volume from a sandbox session and sync it back to storage. A volume whose sync back is still pending (SYNC_PENDING) cannot be detached, even with force (failed_precondition): wait for the upload to finish or ask Tenki support to recover it. Set force to unplug an attached volume the guest cannot unmount — writes the guest has not flushed are lost.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | The sandbox session to detach the volume from. |
volume_id * | string | The volume id to detach. |
force | boolean | Force-unplug an ATTACHED volume (default false). Unflushed guest writes are lost. Never releases a SYNC_PENDING attachment; on a host that cannot force detach yet the API returns failed_precondition. |
tenki_create_egress_policy Create Egress Policy
Save a named egress policy (allowed domains/CIDRs, optional HTTPS interception, per-host HTTP rules and extra ports) in the workspace, for tenki_create_sandbox's egress_policies to pin by name. Sandboxes cannot pin policies (failed_precondition) if session egress policies are disabled for the workspace (on by default; Tenki staff can turn it off).
| Parameter | Type | Description |
|---|---|---|
name * | string | Policy name (letters, digits, _ and -; not a UUID). Exact, never trimmed. |
allow_cidrs | array | Allowed IPv4 prefixes reachable without a name lookup (≤64; not 0.0.0.0/0). |
allow_domains | array | Allowed hosts: exact names or single-label '*.example.com' wildcards (≤256). |
allowed_ports | array | Extra public TCP ports to open besides 80/443 (≤64; requires intercept_https). They skip HTTP inspection but still reach only allowed destinations, so 22 permits git over SSH, including pushes. |
http_rules | array | Per-host HTTP method/path rules (≤64; requires intercept_https). On ports 80 and 443 a request matching no rule is refused with 403. |
intercept_https | boolean | Terminate port-443 TLS with the sandbox's managed CA so each request's Host is checked; requires at least one allowed domain. With interception on, public egress is limited to TCP 80/443 through the p… |
workspace_id | string | Workspace (defaults to the key's workspace). |
tenki_update_egress_policy Replace Egress Policy
Replace a named egress policy's rules (the whole body; omitted fields are cleared). Requires the current revision. Sandboxes created earlier keep the rules they were created with.
| Parameter | Type | Description |
|---|---|---|
expected_revision * | integer | The policy's current revision (from tenki_get_egress_policy); a stale revision is refused with ABORTED. |
policy_id * | string | Policy ID or name. |
allow_cidrs | array | Allowed IPv4 prefixes reachable without a name lookup (≤64; not 0.0.0.0/0). |
allow_domains | array | Allowed hosts: exact names or single-label '*.example.com' wildcards (≤256). |
allowed_ports | array | Extra public TCP ports to open besides 80/443 (≤64; requires intercept_https). They skip HTTP inspection but still reach only allowed destinations, so 22 permits git over SSH, including pushes. |
http_rules | array | Per-host HTTP method/path rules (≤64; requires intercept_https). On ports 80 and 443 a request matching no rule is refused with 403. |
intercept_https | boolean | Terminate port-443 TLS with the sandbox's managed CA so each request's Host is checked; requires at least one allowed domain. With interception on, public egress is limited to TCP 80/443 through the p… |
workspace_id | string | Workspace (defaults to the key's workspace). |
tenki_get_egress_policy Get Egress Policy
Get one named egress policy by ID or name: its rules, current revision, and how many non-terminated sandboxes pinned it.
| Parameter | Type | Description |
|---|---|---|
policy_id * | string | Policy ID or name. |
workspace_id | string | Workspace (defaults to the key's workspace). |
tenki_list_egress_policies List Egress Policies
List the workspace's named egress policies, ordered by name. Pass next_cursor back as cursor for the next page.
| Parameter | Type | Description |
|---|---|---|
cursor | string | next_cursor from the previous page. |
page_size | integer | Max policies per page (≤100, default 50). |
workspace_id | string | Workspace (defaults to the key's workspace). |
tenki_delete_egress_policy Delete Egress Policy
Delete a named egress policy (requires its current revision). New sandboxes can no longer pin it; sandboxes that already pinned it keep its rules.
| Parameter | Type | Description |
|---|---|---|
expected_revision * | integer | The policy's current revision (from tenki_get_egress_policy); a stale revision is refused with ABORTED. |
policy_id * | string | Policy ID or name. |
workspace_id | string | Workspace (defaults to the key's workspace). |
tenki_create_template Create Template
Create a custom-image template (a reusable sandbox-image spec: base image + setup script + default resources). Build it into a bootable image later with tenki_build_template. NOTE: only a TYPED template (created with builder_spec, no legacy fields) can build a named, publishable image (image_name) that tenki_create_sandbox boots via its `image` arg.
| Parameter | Type | Description |
|---|---|---|
name * | string | Human-readable template name (1-64 chars). |
base_image_id | string | Base image ID to build on top of. |
builder_spec | object | Typed template spec, passed through as-is — e.g. {specVersion:'tenki.template.v1', base:{image:'sandbox'}, workdir:'/home/tenki', steps:[{run:{command:'...'}}], resources:{cpuCores,memoryMb,diskSize… |
cpu_cores | integer | Default vCPUs for sandboxes from this template (1-128; workspace plan may cap lower). |
disk_size_gb | integer | Default disk in GB (5-100). |
env_vars | object | Environment variables as a key→value object. |
memory_mb | integer | Default memory in MB (512-524288, even). |
parent_image | string | Derive this template from an existing built image reference. |
parent_template_id | string | Derive this template from an existing template. |
setup_script | string | Shell script run at build time to provision the image. Required for a from-scratch template (the API rejects a create without it unless you derive from a parent template/image). |
start_cmd | string | Command run when a sandbox boots from this template. |
tags | array | Tags for later filtering (≤20, each ≤32 chars of a-z 0-9 _ : . -). |
workspace_id | string | Workspace to create in (defaults to the key's first workspace). |
tenki_get_template Get Template
Retrieve one template by ID.
| Parameter | Type | Description |
|---|---|---|
template_id * | string | The template ID. |
tenki_list_templates List Templates
List templates for the workspace with server-side search, build-state filter, tag filter, sorting and optional state-count facets.
| Parameter | Type | Description |
|---|---|---|
include_facets | boolean | Also return per-state counts for the same filter scope. |
page_size | integer | Rows per page (max 100). |
page_token | string | Cursor from a previous response's nextPageToken. |
search | string | Free-text search over template name/id (max 256 chars). |
sort_by | string | Column to sort by. |
sort_desc | boolean | Sort descending (default ascending). |
states | array | Only templates whose latest build is in any of these states (UNBUILT = never built). |
tags | array | Only return templates that carry all of these tags. |
workspace_id | string | Workspace to list from (defaults to the key's first workspace). |
tenki_update_template Update Template
Update mutable fields on a template. Only the fields you provide are changed; pass clear_tags to remove all tags.
| Parameter | Type | Description |
|---|---|---|
template_id * | string | The template ID to update. |
base_image_id | string | New base image ID. |
builder_spec | object | Advanced structured build spec (TemplateBuildSpec); passed through as-is. |
clear_tags | boolean | Remove all tags from the template. |
cpu_cores | integer | New default vCPUs (1-128). |
disk_size_gb | integer | New default disk in GB (5-100). |
env_vars | object | Environment variables as a key→value object. |
memory_mb | integer | New default memory in MB (512-524288, even). |
name | string | New human-readable name. |
setup_script | string | New build-time provisioning script. |
start_cmd | string | New boot command. |
tags | array | Replacement tag list. Pass [] (or clear_tags) to remove all tags. |
tenki_delete_template Delete Template
Delete a template by ID. Pass force to delete even when builds or dependents exist.
| Parameter | Type | Description |
|---|---|---|
template_id * | string | The template ID to delete. |
force | boolean | Force deletion despite dependents (default false). |
tenki_build_template Build Template
Trigger a build for a template, producing a bootable image. Returns the created build — poll it with tenki_get_template_build until READY; the ready build's imageDigestRef is what tenki_create_sandbox's `image` arg takes.
| Parameter | Type | Description |
|---|---|---|
template_id * | string | The template ID to build. |
build_env | object | Per-build environment overrides frozen into this build only. |
build_secrets | object | Build-time secrets as a key→value object (not persisted into the image). |
image_name | string | Name for the resulting image (^[a-z][a-z0-9-]{0,63}$). Requires a TYPED template (created with builder_spec) — the API rejects it for legacy setup-script templates. |
publish_raw_image | boolean | Publish the raw rootfs image alongside the build snapshot. |
tenki_cancel_template_build Cancel Template Build
Cancel an in-progress template build by its build ID.
| Parameter | Type | Description |
|---|---|---|
build_id * | string | The template build ID to cancel. |
tenki_get_template_build Get Template Build
Retrieve one template build by its build ID (state, progress, and result image). A READY build's imageDigestRef is the reference tenki_create_sandbox's `image` arg takes.
| Parameter | Type | Description |
|---|---|---|
build_id * | string | The template build ID. |
tenki_list_active_template_builds List Active Template Builds
List the currently active (in-progress) builds for a given template.
| Parameter | Type | Description |
|---|---|---|
template_id * | string | The template ID whose active builds to list. |
tenki_list_template_builds List Template Builds
List every build of a template (not just active ones) with what each image holds in workspace storage: version, state, imageBytes, isCurrent, isLaunchable, and deleteBlockedReason (empty when tenki_delete_template_build can free it). Also returns the template-level storage totals.
| Parameter | Type | Description |
|---|---|---|
template_id * | string | The template ID whose builds to list. |
tenki_delete_template_build Delete Template Build
Delete one template build's image to free workspace storage and retire the build (irreversible; a published image version carrying this build is removed with it). Refused with failed_precondition when the image cannot be freed, e.g. the build is still running, its image is still being written or deleted, the template is published from it, a sandbox that is not terminated (running or paused) still uses it, or an image tag, share, snapshot variant or derived template references it — check deleteBlockedReason via tenki_list_template_builds first (empty = deletable). Deleting the template's curr…
| Parameter | Type | Description |
|---|---|---|
build_id * | string | The template build ID to delete. |
tenki_get_workspace_usage Get Workspace Usage
Get a workspace's sandbox usage against its plan limits (concurrent sandboxes, snapshots, templates, volumes, storage bytes, preview URLs) — each row has current + max. Use this for quota and cost visibility; the limits themselves come from the plan and are not editable through the API.
| Parameter | Type | Description |
|---|---|---|
workspace_id | string | Workspace to report on. Omit to use the API key's first workspace. |
tenki_list_ci_runner_sizes List CI Runner Sizes
List the Linux x64 runner sizes Tenki CI can run for a workspace — each runs-on label with its vCPUs and memory in GiB, smallest first, limited to the workspace's job-size limits — and defaultRunsOnLabel, the size a job gets when its runs-on names none. Use it to pick a runs-on label for a GitHub Actions workflow.
| Parameter | Type | Description |
|---|---|---|
workspace_id | string | Workspace to list sizes for. Omit to use the API key's first workspace. |
tenki_get_workspace_preview_domains Get Wildcard Preview Domains
Read whether wildcard preview domains are enabled for a workspace, the per-region wildcard hostnames and their certificate readiness, and how many existing preview URLs use the wildcard scheme. Explains the `wildcard`/`wildcardStatus` fields on expose/preview responses.
| Parameter | Type | Description |
|---|---|---|
workspace_id | string | Workspace to read. Omit to use the API key's first workspace. |
tenki_update_workspace_preview_domains Update Wildcard Preview Domains
Enable or disable wildcard preview domains for a workspace. Enabling provisions one wildcard certificate per region and is limited to Pro-tier workspaces. DISABLING releases the certificates and existing wildcard-scheme preview URLs stop serving with a valid certificate — check wildcardPreviewUrlCount via tenki_get_workspace_preview_domains first.
| Parameter | Type | Description |
|---|---|---|
enabled * | boolean | true to enable wildcard preview domains, false to disable them. |
workspace_id | string | Workspace to update. Omit to use the API key's first workspace. |
tenki_get_upload_url Get File Upload URL
Get a short-lived signed URL to upload (HTTP PUT) a binary file to a path inside a sandbox. Use for non-text payloads too large or binary for tenki_write_file.
| Parameter | Type | Description |
|---|---|---|
path * | string | Destination path in the sandbox, e.g. /home/tenki/data.bin |
session_id * | string | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. |
content_type | string | MIME type of the upload, e.g. application/octet-stream. |
tenki_get_download_url Get Artifact Download URL
Get a short-lived signed URL to download (HTTP GET) an artifact by its artifact id (e.g. the artifactId returned by tenki_get_upload_url, or a template build's buildLogArtifactId). The API supports download-by-artifact-id only, not download-by-path.
| Parameter | Type | Description |
|---|---|---|
artifact_id * | string | Artifact id (UUID) to download. |
session_id | string | Ignored — kept for backwards compatibility; the API addresses artifacts by id alone. |
tenki_update_ssh_keys Set SSH Authorized Keys
Set the SSH authorized public keys on a running sandbox, enabling direct SSH access for the given keys. Replaces the current set (at least one key is required — the API has no 'clear' operation).
| Parameter | Type | Description |
|---|---|---|
public_keys * | array | SSH public keys (ssh-ed25519 …, ssh-rsa …) to authorize. Replaces the current set. |
session_id * | string | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. |
tenki_issue_ssh_cert Issue SSH Certificate
Issue a short-lived SSH certificate for a public key, authorizing SSH access to a sandbox via the SSH gateway. Returns the certificate, the CA public key (caPub) for known_hosts, expiry, a renewal hint, and pinHostKey — when true, verify the gateway host certificate against caPub (e.g. a `@cert-authority` known_hosts line) rather than trusting on first use.
| Parameter | Type | Description |
|---|---|---|
public_key * | string | OpenSSH-format public key to sign into a certificate (e.g. 'ssh-ed25519 AAAA…'). |
session_id * | string | Sandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes. |
requested_ttl_seconds | integer | Requested certificate lifetime in seconds; the server caps it to policy. |
source_addresses | array | CIDRs bound into the cert's source-address critical option; SSH refuses the cert from any other source IP. |
tenki_list_ssh_gateways List SSH Gateways
List the currently active SSH gateways (id, region, public endpoint, health). Filter by region, or pass session_id to get only the gateways that can reach that sandbox's host. Gateways are fleet-wide, not per workspace.
| Parameter | Type | Description |
|---|---|---|
region | string | Only gateways in this region (e.g. 'us', 'eu'). Omit for all regions. |
session_id | string | Only gateways that can reach this sandbox's host. |
tenki_auth_status Check Credential Status
Report whether the server has a usable Tenki credential, which kind (API key vs OAuth session token), and the endpoint it targets — verified with a live identity probe. Call this first when other tools fail with auth errors, or when this is the only tool available (which means no credential is configured). Reports status only; it does not log in and never returns the token.