Skip to main content
Glama

Configure sandbox SSH key

add_ssh_key

Authorizes an OpenSSH public key on a running sandbox so you can SSH in as user and set up reverse tunnels; returns the machine IP for port 22.

Instructions

Configure sandbox SSH key. Adds an OpenSSH public key to the running sandbox so the caller can SSH as user user. The response carries machineIp, which is the host to connect to on port 22.

This is also how you reach your own machine from inside a sandbox without the CLI: authorize the key, then open a reverse tunnel with stock OpenSSH, and a port on your machine answers at 127.0.0.1:<port> inside the sandbox for as long as the ssh process runs.

ssh -o ExitOnForwardFailure=yes -i ~/.ssh/id_ed25519 -N -R 7777:127.0.0.1:7777 user@<machineIp>

boat forward <id> --reverse --local 7777 is the same tunnel with the key handling and redial done for you.

On a sandbox with network.inbound boat-only, the route answers 403 inbound_closed when the sandbox has no inbound list. A sandbox takes SSH over IPv4 and over IPv6, and boat sees only the address of this API request. When the list has entries, the route answers 403 inbound_not_allowed, with the address in error.details.address, only when the list does not cover the caller's address and holds no entry of the other IP version. In every other case the route answers normally, and the host accepts or drops the SSH connection by its real source address. With ?include=caller, the answer then holds caller.address and caller.listed.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sandboxId": "<sandboxId>",
      "key": "<key>"
    },
    "name": "add_ssh_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyYesPublic SSH key in OpenSSH format. Private keys are rejected.
includeNoOptional fields of the answer. `caller`: on a sandbox with an inbound list, the answer holds `caller.address` and `caller.listed`. Without it, the answer has the fields that it had before.
sandboxIdYesPublic Sandbox id returned by create/list/get sandbox calls.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.0

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only say non-read-only, non-destructive, non-idempotent, open-world; the description goes well beyond by disclosing the exact failure modes (`403 inbound_closed`, `403 inbound_not_allowed` with `error.details.address`), the IPv4/IPv6 evaluation rules, and the fact that the host still accepts or drops by real source address. It also clarifies the key is for user `user` and the tunnel lasts as long as the ssh process runs, which is behavior no annotation conveys.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and the tunnel example are front-loaded and well structured, and the shell snippet earns its space. However, the long final paragraph on inbound-list evaluation, dual-stack address handling, and `error.details.address` is dense and largely duplicates the `include` parameter documentation, giving the definition more low-value text than an add-key tool needs.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, yet the description names the return fields an agent needs (`machineIp`, `caller.address`, `caller.listed`) and explains the conditions under which they appear. Combined with the annotations covering the safety profile, nothing essential for a correct call is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds meaning the schema does not: it explains what `include=caller` yields under the inbound-list conditions beyond the schema's brief note, and ties the key to the `user` account and port 22. The `sandboxId` and `key` semantics are already fully documented in the schema, so the added value is partial rather than complete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb+resource: it 'adds an OpenSSH public key to the running sandbox so the caller can SSH as user `user`', and it states the response field and expected port (22). An agent can immediately tell this is about granting SSH access, not about creating or modifying the sandbox itself.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives a concrete use scenario (reaching your own machine from inside a sandbox) with a worked SSH reverse-tunnel example and names the equivalent CLI command `boat forward <id> --reverse --local 7777`. What it does not do is state exclusions or prerequisites relative to sibling tools (e.g., which sandbox states this works in), so it falls short of an explicit when/when-not guide.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.