Luxor Sandbox MCP

v0.4.4
io.github.LuxorLabs/tenki-mcp Checked 4 hours ago Published 14 days ago

Disposable 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.

ParameterTypeDescription
code *stringThe code to run.
language *stringInterpreter for the snippet.
envobjectEnvironment variables as a key→value object.
timeout_secondsintegerMax 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.

ParameterTypeDescription
session_id *stringSandbox 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.

ParameterTypeDescription
session_id *stringSandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes.
window_secondsintegerAveraging 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.

ParameterTypeDescription
include_terminatedbooleanInclude terminated sandboxes (default false).
page_sizeintegerRows per page (max 100).
page_tokenstringCursor from a previous response's nextPageToken.
stickybooleanOnly sticky (true) or only non-sticky (false) sandboxes.
tagsarrayOnly sandboxes carrying all of these tags.

tenki_terminate_sandbox Terminate Sandbox

Terminate (destroy) a sandbox. The microVM and its filesystem are gone after this.

ParameterTypeDescription
session_id *stringSandbox 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).

ParameterTypeDescription
session_id *stringSandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes.
asyncbooleanReturn 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.

ParameterTypeDescription
session_id *stringSandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes.
asyncbooleanReturn 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…

ParameterTypeDescription
session_id *stringThe RUNNING sandbox to fork.
countintegerChildren 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_prefixstringChildren are named <name_prefix>-1 … <name_prefix>-<count> (default '<source name>-fork', or 'fork-<first 8 characters of its id>' for an unnamed sandbox).
waitbooleanReturn 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.

ParameterTypeDescription
additional_duration_seconds *integerExtra lifetime to add, in seconds (sent as a Duration string, e.g. 3600s).
session_id *stringThe 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.

ParameterTypeDescription
session_id *stringThe sandbox/session ID to update.
clear_tagsbooleanRemove all tags from the sandbox.
max_duration_secondsintegerNew 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…
namestringNew human-readable name (max 64 chars).
stickybooleantrue = 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…
tagsarrayReplacement 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.

ParameterTypeDescription
session_ids *arrayThe 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).

ParameterTypeDescription
session_id *stringThe 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.

ParameterTypeDescription
include_facetsbooleanAlso return per-state counts for the same filter scope (facets).
include_terminatedbooleanInclude terminated sandboxes (default false).
orderstringDefault order is newest first; STATE_THEN_CREATED groups running, then paused, then terminated (newest first within each). Ignored when sort_by is set.
page_sizeintegerRows per page (max 100).
page_tokenstringCursor from a previous response's nextPageToken.
searchstringFree-text search over name, id, snapshot names/ids and published image refs (max 256 chars).
sort_bystringColumn to sort by (overrides order).
sort_descbooleanSort descending (default ascending).
statestringOnly sandboxes in this one state (combines with states).
statesarrayOnly sandboxes in any of these states (empty = no filter).
stickybooleanOnly sticky (true) or only non-sticky (false) sandboxes.
tagsarrayOnly sandboxes carrying all of these tags.
workspace_idstringWorkspace 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.

ParameterTypeDescription
command *stringExecutable, e.g. 'npm' or 'python3'.
session_id *stringSandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes.
argsarrayArguments.
cwdstringWorking directory (honored in-script).
envobjectEnvironment variables as a key→value object.
max_output_bytesintegerPer-stream inline output cap in bytes (default 65536). Larger output is truncated head+tail and kept in the sandbox at stdoutPath/stderrPath.
timeout_secondsintegerMaximum 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.

ParameterTypeDescription
path *stringAbsolute path inside the sandbox, under /home/tenki.
session_id *stringSandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes.
max_bytesintegerMaximum bytes of content to return (default 65536, max 1048576). Cuts never split a UTF-8 character.
offsetintegerByte 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.

ParameterTypeDescription
content *stringFull text to write; an existing file is overwritten.
path *stringAbsolute path inside the sandbox, under /home/tenki.
session_id *stringSandbox 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.

ParameterTypeDescription
path *stringDirectory path, e.g. /home/tenki
session_id *stringSandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes.
include_hiddenbooleanInclude 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.

ParameterTypeDescription
path *stringAbsolute path under /home/tenki, e.g. /home/tenki/output.txt
session_id *stringSandbox 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).

ParameterTypeDescription
path *stringDirectory path under /home/tenki, e.g. /home/tenki/project/out
session_id *stringSandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes.
modeintegerPermission bits as a number (e.g. 448 for 0700). Default: the sandbox user's umask.
recursivebooleanCreate 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).

ParameterTypeDescription
path *stringPath to delete under /home/tenki.
session_id *stringSandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes.
recursivebooleanRemove 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.

ParameterTypeDescription
from *stringSource path under /home/tenki, e.g. /home/tenki/old.txt
session_id *stringSandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes.
to *stringDestination 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 ...`.

ParameterTypeDescription
repo *stringRepository URL to clone, e.g. https://github.com/octocat/Hello-World.
session_id *stringSandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes.
branchstringBranch or tag to check out after cloning (git clone --branch).
depthintegerCreate a shallow clone with this many commits (git clone --depth).
directorystringDirectory 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.

ParameterTypeDescription
ref *stringBranch, tag or commit to check out, or the name of the branch to create when create is true.
session_id *stringSandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes.
createbooleanCreate ref as a new branch from the current HEAD (git checkout -b). Default false.
directorystringRepository 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.

ParameterTypeDescription
session_id *stringSandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes.
basestringBase ref to diff from (with head: git diff base..head; alone: git diff base).
directorystringRepository directory in the sandbox, e.g. /home/tenki/myrepo (relative paths resolve from /home/tenki). Omit only if the repository is /home/tenki itself.
headstringHead ref to diff to (with base: git diff base..head; alone: git diff head).
pathstringLimit the diff to this file or directory, relative to the repository root.
rangestringRevision 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.

ParameterTypeDescription
session_id *stringSandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes.
directorystringRepository 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_countintegerMaximum number of commits to show (git log --max-count). Set this to keep output small.
pathstringOnly commits touching this file or directory, relative to the repository root.
rangestringRevision 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.

ParameterTypeDescription
port *integerTCP port inside the sandbox (1-65535).
session_id *stringSandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes.
expires_atstringOptional RFC-3339 timestamp at which the preview URL auto-expires. Omit to keep it until the sandbox ends.
slugstringSubdomain 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.

ParameterTypeDescription
session_id *stringSandbox 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.

ParameterTypeDescription
port *integerThe TCP port inside the sandbox to unexpose (1-65535).
session_id *stringThe 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).

ParameterTypeDescription
port *integerThe TCP port inside the sandbox to create a preview URL for (1-65535).
session_id *stringThe sandbox session serving the port.
slug *stringSubdomain slug for the preview URL (3-63 chars, lowercase letters/digits/hyphens, no leading/trailing hyphen).
expires_atstringOptional 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.

ParameterTypeDescription
port *integerThe TCP port inside the sandbox to open a preview for (1-65535, not 22). 7681 opens the web terminal.
session_id *stringThe sandbox serving the port.
expires_atstringOptional 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.

ParameterTypeDescription
include_facetsbooleanAlso return per-state counts for the same filter scope.
page_sizeintegerRows per page (server default 20, max 100).
page_tokenstringCursor from a previous response's nextPageToken.
searchstringFree-text search over slug/id (max 256 chars).
session_idstringOnly preview URLs bound to this sandbox.
sort_bystringColumn to sort by.
sort_descbooleanSort descending (default ascending).
statesarrayOnly 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_idstringWorkspace 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).

ParameterTypeDescription
preview_url_idstringThe preview URL id.
slugstringThe 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.

ParameterTypeDescription
preview_url_id *stringThe 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.

ParameterTypeDescription
preview_token *stringThe 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.

ParameterTypeDescription
port *integerThe port to route the preview URL to.
preview_url_id *stringThe preview URL id to bind.
session_id *stringSandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes.
expires_atstringOptional 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).

ParameterTypeDescription
preview_url_id *stringThe preview URL id to unbind.

tenki_resolve_preview_token Resolve Preview Token

Resolve a preview token to the sandbox/port it points at (advanced).

ParameterTypeDescription
token *stringThe 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.

ParameterTypeDescription
session_id *stringThe sandbox session to snapshot.
asyncbooleanReturn as soon as the snapshot row exists and poll tenki_get_snapshot for READY, instead of blocking until the capture finishes (default false).
expires_atstringRFC-3339 / ISO-8601 timestamp at which the snapshot is auto-deleted. Omit to keep indefinitely.
namestringHuman-readable name for the snapshot.
store_raw_imagebooleanAlso 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.

ParameterTypeDescription
snapshot_id *stringSnapshot 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).

ParameterTypeDescription
page_sizeintegerRows per page.
page_tokenstringCursor from a previous response's nextPageToken.

tenki_list_session_snapshots List Sandbox Snapshots

List the snapshots captured from a specific sandbox session.

ParameterTypeDescription
session_id *stringSandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes.
page_sizeintegerRows per page.
page_tokenstringCursor 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.

ParameterTypeDescription
page_sizeintegerRows per page.
page_tokenstringCursor 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).

ParameterTypeDescription
snapshot_id *stringSnapshot id, from tenki_create_snapshot or tenki_list_snapshots.
clear_expires_atbooleanRemove the expiry so the snapshot is kept indefinitely.
clear_tagsbooleanRemove all tags from the snapshot.
expires_atstringNew RFC-3339 / ISO-8601 auto-delete timestamp.
namestringNew human-readable name (max 64 chars).
tagsarrayReplacement tag list. Pass [] (or clear_tags) to remove all tags.

tenki_delete_snapshot Delete Snapshot

Permanently delete a snapshot by ID.

ParameterTypeDescription
snapshot_id *stringSnapshot 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).

ParameterTypeDescription
snapshot_id *stringSnapshot 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.

ParameterTypeDescription
page_sizeintegerRows per page.
page_tokenstringCursor from a previous response's nextPageToken.
workspace_idstringWorkspace 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.

ParameterTypeDescription
name *stringHuman-readable name for the volume.
size_bytes *integerVolume size in bytes. Must be between 1 MiB (1048576) and 100 GiB (107374182400).
workspace_idstringWorkspace 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.

ParameterTypeDescription
volume_id *stringThe 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.

ParameterTypeDescription
include_facetsbooleanAlso return per-state counts for the same filter scope.
page_sizeintegerMax volumes to return per page (max 100).
page_tokenstringPage token from a previous response's nextPageToken.
searchstringFree-text search over volume name/id (max 256 chars).
sort_bystringColumn to sort by.
sort_descbooleanSort descending (default ascending).
statesarrayOnly volumes in any of these states.
workspace_idstringWorkspace 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.

ParameterTypeDescription
volume_id *stringThe volume id to update.
clear_tagsbooleanRemove all tags from the volume.
namestringNew human-readable name for the volume.
tagsarrayReplacement 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.

ParameterTypeDescription
volume_id *stringThe 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.

ParameterTypeDescription
size_bytes *integerVolume size in bytes. Must be between 1 MiB (1048576) and 100 GiB (107374182400).
volume_id *stringThe 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.

ParameterTypeDescription
mount_path *stringAbsolute path inside the sandbox to mount at, e.g. /mnt/data.
session_id *stringThe sandbox session to attach the volume to.
volume_id *stringThe volume id to attach.
read_onlybooleanMount 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.

ParameterTypeDescription
session_id *stringThe sandbox session to detach the volume from.
volume_id *stringThe volume id to detach.
forcebooleanForce-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).

ParameterTypeDescription
name *stringPolicy name (letters, digits, _ and -; not a UUID). Exact, never trimmed.
allow_cidrsarrayAllowed IPv4 prefixes reachable without a name lookup (≤64; not 0.0.0.0/0).
allow_domainsarrayAllowed hosts: exact names or single-label '*.example.com' wildcards (≤256).
allowed_portsarrayExtra 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_rulesarrayPer-host HTTP method/path rules (≤64; requires intercept_https). On ports 80 and 443 a request matching no rule is refused with 403.
intercept_httpsbooleanTerminate 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_idstringWorkspace (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.

ParameterTypeDescription
expected_revision *integerThe policy's current revision (from tenki_get_egress_policy); a stale revision is refused with ABORTED.
policy_id *stringPolicy ID or name.
allow_cidrsarrayAllowed IPv4 prefixes reachable without a name lookup (≤64; not 0.0.0.0/0).
allow_domainsarrayAllowed hosts: exact names or single-label '*.example.com' wildcards (≤256).
allowed_portsarrayExtra 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_rulesarrayPer-host HTTP method/path rules (≤64; requires intercept_https). On ports 80 and 443 a request matching no rule is refused with 403.
intercept_httpsbooleanTerminate 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_idstringWorkspace (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.

ParameterTypeDescription
policy_id *stringPolicy ID or name.
workspace_idstringWorkspace (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.

ParameterTypeDescription
cursorstringnext_cursor from the previous page.
page_sizeintegerMax policies per page (≤100, default 50).
workspace_idstringWorkspace (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.

ParameterTypeDescription
expected_revision *integerThe policy's current revision (from tenki_get_egress_policy); a stale revision is refused with ABORTED.
policy_id *stringPolicy ID or name.
workspace_idstringWorkspace (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.

ParameterTypeDescription
name *stringHuman-readable template name (1-64 chars).
base_image_idstringBase image ID to build on top of.
builder_specobjectTyped 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_coresintegerDefault vCPUs for sandboxes from this template (1-128; workspace plan may cap lower).
disk_size_gbintegerDefault disk in GB (5-100).
env_varsobjectEnvironment variables as a key→value object.
memory_mbintegerDefault memory in MB (512-524288, even).
parent_imagestringDerive this template from an existing built image reference.
parent_template_idstringDerive this template from an existing template.
setup_scriptstringShell 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_cmdstringCommand run when a sandbox boots from this template.
tagsarrayTags for later filtering (≤20, each ≤32 chars of a-z 0-9 _ : . -).
workspace_idstringWorkspace to create in (defaults to the key's first workspace).

tenki_get_template Get Template

Retrieve one template by ID.

ParameterTypeDescription
template_id *stringThe 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.

ParameterTypeDescription
include_facetsbooleanAlso return per-state counts for the same filter scope.
page_sizeintegerRows per page (max 100).
page_tokenstringCursor from a previous response's nextPageToken.
searchstringFree-text search over template name/id (max 256 chars).
sort_bystringColumn to sort by.
sort_descbooleanSort descending (default ascending).
statesarrayOnly templates whose latest build is in any of these states (UNBUILT = never built).
tagsarrayOnly return templates that carry all of these tags.
workspace_idstringWorkspace 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.

ParameterTypeDescription
template_id *stringThe template ID to update.
base_image_idstringNew base image ID.
builder_specobjectAdvanced structured build spec (TemplateBuildSpec); passed through as-is.
clear_tagsbooleanRemove all tags from the template.
cpu_coresintegerNew default vCPUs (1-128).
disk_size_gbintegerNew default disk in GB (5-100).
env_varsobjectEnvironment variables as a key→value object.
memory_mbintegerNew default memory in MB (512-524288, even).
namestringNew human-readable name.
setup_scriptstringNew build-time provisioning script.
start_cmdstringNew boot command.
tagsarrayReplacement 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.

ParameterTypeDescription
template_id *stringThe template ID to delete.
forcebooleanForce 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.

ParameterTypeDescription
template_id *stringThe template ID to build.
build_envobjectPer-build environment overrides frozen into this build only.
build_secretsobjectBuild-time secrets as a key→value object (not persisted into the image).
image_namestringName 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_imagebooleanPublish 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.

ParameterTypeDescription
build_id *stringThe 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.

ParameterTypeDescription
build_id *stringThe template build ID.

tenki_list_active_template_builds List Active Template Builds

List the currently active (in-progress) builds for a given template.

ParameterTypeDescription
template_id *stringThe 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.

ParameterTypeDescription
template_id *stringThe 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…

ParameterTypeDescription
build_id *stringThe 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.

ParameterTypeDescription
workspace_idstringWorkspace 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.

ParameterTypeDescription
workspace_idstringWorkspace 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.

ParameterTypeDescription
workspace_idstringWorkspace 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.

ParameterTypeDescription
enabled *booleantrue to enable wildcard preview domains, false to disable them.
workspace_idstringWorkspace 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.

ParameterTypeDescription
path *stringDestination path in the sandbox, e.g. /home/tenki/data.bin
session_id *stringSandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes.
content_typestringMIME 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.

ParameterTypeDescription
artifact_id *stringArtifact id (UUID) to download.
session_idstringIgnored — 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).

ParameterTypeDescription
public_keys *arraySSH public keys (ssh-ed25519 …, ssh-rsa …) to authorize. Replaces the current set.
session_id *stringSandbox 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.

ParameterTypeDescription
public_key *stringOpenSSH-format public key to sign into a certificate (e.g. 'ssh-ed25519 AAAA…').
session_id *stringSandbox session id (UUID), from tenki_create_sandbox or tenki_list_sandboxes.
requested_ttl_secondsintegerRequested certificate lifetime in seconds; the server caps it to policy.
source_addressesarrayCIDRs 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.

ParameterTypeDescription
regionstringOnly gateways in this region (e.g. 'us', 'eu'). Omit for all regions.
session_idstringOnly 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.