Skip to main content
Glama

open_session

Opens a persistent SSH shell session on a host you already have access to and returns a sessionId for running commands. Request host access first, or it fails.

Instructions

SSH into a remote server. Opens a new persistent, PTY-less shell session on a host you already have access to (see request_host_access). Fails with HOST_ACCESS_REQUIRED if you do not — this tool never prompts the user itself, request access first. The returned session stays open (and visible to the user in a read-only terminal tab) until close_session, an idle timeout, or the MCP connection drops; use the returned sessionId with run_command.

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": {
      "hostId": "<hostId>"
    },
    "name": "open_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
hostIdYesThe opaque id of the host to connect to, as returned by list_hosts or request_host_access.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full load and does so well: PTY-less, persistent/stateful lifetime, user-visible read-only terminal tab, no interactive prompting, and a named error code. That is exactly the behavioral context an agent needs before opening a session.

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 action and prerequisite are front-loaded, and lifecycle/error details follow in a compact package. It is dense and somewhat run-on with parentheticals, but no sentence is filler.

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 tells the agent what comes back (a sessionId) and how long it lives, covering the stateful complexity of a session-creation tool. Nothing needed to call it correctly is missing.

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

Parameters3/5

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

Only one parameter and schema description coverage is 100%, so the schema fully documents hostId. The description adds nothing parameter-specific beyond the error case, which is the expected baseline when the schema does the work.

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?

Opens with a precise verb+resource: 'SSH into a remote server' and 'Opens a new persistent, PTY-less shell session'. It is clearly differentiable from siblings like close_session, request_host_access and run_command, which are named or implied by their roles.

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?

Explicitly states the prerequisite (existing host access, via request_host_access), the failure mode (HOST_ACCESS_REQUIRED) and the required remedy, and names the follow-up tool (run_command with sessionId) plus the terminating alternatives (close_session, idle timeout, connection drop).

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