Skip to main content
Glama

auth_cli_pair

Mint a short-lived smt_ API key for ephemeral environments (hosted coding environments, sandboxes, containers). somewhere auth set takes the returned key through standard input or the command environment as SOMEWHERE_TOKEN. The CLI verifies and stores it, so the session can use the CLI without a browser login. Positional tokens are refused; the key does not belong in command arguments or chat.

Returns: { id, key: "smt_...", prefix, name, kind: "cli_pair", expires_at, ttl_seconds }. Key auto-expires in 24h; the next session takes a new key. No refresh token is returned here: the pairing response omits the long-lived refresh credential. somewhere auth login gives a CLI session that renews itself; it stores its credentials directly in the CLI config.

For a shell without CLI credentials. The CLI is the scoped package @somewhere-cloud/cli (npm i -g @somewhere-cloud/cli). After pairing, first-class CLI commands cover routine work and somewhere call <tool> '<json>' covers the complete platform tool catalog. Without a shell, the MCP tools are the path.

Security note: scoped to the same user as the caller. Auditable as kind='cli_pair' separately from your main developer key, so a stolen ephemeral token is revocable on its own.

Example flow (run once per session):

1. Call auth_cli_pair() → { key: "smt_...", expires_at: "..." }
2. Set SOMEWHERE_TOKEN to the returned key in the command environment.
3. Run: somewhere auth set   // reads SOMEWHERE_TOKEN
4. Run: somewhere whoami     // confirms identity
5. somewhere deploy          // deploy raw source

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "auth_cli_pair"
  }
}

Input Schema

NameRequiredDescriptionDefault
labelNoOptional short label that ends up in the key name for audit trail (e.g. "web-sandbox", "codespace-1234"). Defaults to "ephemeral". Max 40 chars; non-alphanumeric stripped.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior3/5

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

Annotations declare a non-read-only, non-destructive, non-idempotent mutation, and the description adds genuinely useful context: 24h auto-expiry, no refresh token returned, same-user scoping, revocability, and auditing as kind='cli_pair'. However, it omits any note about rate limits or whether repeated calls accumulate outstanding keys, which matters for a non-idempotent minting operation.

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

Conciseness4/5

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

The core instruction and security/return details are front-loaded and well organized, with a clear example flow. A few lines are expendable for an agent-facing tool, notably the npm install command and the 'complete platform tool catalog' aside, which dilute the minting instructions.

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, but the description fully enumerates the response fields (id, key, prefix, name, kind, expires_at, ttl_seconds) plus TTL and absence of a refresh token. Together with the step-by-step handoff to `somewhere auth set` and `SOMEWHERE_TOKEN`, an agent has everything needed to invoke and use the result.

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% and the description adds meaning beyond the schema by showing the audit role of the key name and by demonstrating usage through the example flow. It never mentions the `label` parameter explicitly, though, so the default 'ephemeral' naming and the 40-char truncation must be read from the schema.

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 first clause states a specific verb and resource: 'Mint a short-lived `smt_` API key for ephemeral environments.' It also distinguishes itself from the sibling auth_login by noting that login produces a self-renewing CLI session stored in CLI config, whereas this mints a disposable key.

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

Usage Guidelines5/5

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

Explicit gating conditions are given: 'For a shell without CLI credentials' and 'Without a shell, the MCP tools are the path.' The alternative (auth_login) is named along with the tradeoff of no refresh token, so the agent can pick correctly without opening another schema.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources