Skip to main content
Glama
kitepon
by kitepon

pty_open

ローカル永続端末(POSIXはtmux、Windows nativeはpsmux 3.3.8以上)を1個開き、session_id を返す。backend server常駐ゆえ本サーバや クライアントが再起動してもセッションは生存する。リモート操作は専用ツールにせず、開いた端末の中で pty_send(session_id, "ssh host") と打って入る。

Instructions

ローカル永続端末(POSIXはtmux、Windows nativeはpsmux 3.3.8以上)を1個開き、session_id を返す。backend server常駐ゆえ本サーバや クライアントが再起動してもセッションは生存する。リモート操作は専用ツールにせず、開いた端末の中で pty_send(session_id, "ssh host") と打って入る。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoセッション名(省略時は t1, t2... を自動採番)
shellNo起動シェル(既定 bash)bash
remoteNo別端末のAitermで実行する時のSSH接続情報。hostだけならssh_configの接続名として使う。Aitermは接続情報を保存・管理しない。passphraseは会話記録に残るため、ssh-agentかpassphrase_env(環境変数名)を推奨する。
env_varsNosessionへ登録する環境変数名(値は現在のMCP processから読む。pty_listのenv_keysで読める)。端末の環境は、名指ししなくても現在のMCP processの環境を継ぐ

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.60.1
    • changedInput schema / properties / env_vars / description
      Previous value: -"現在のMCP processからsessionへ継承する環境変数名"New value: +"sessionへ登録する環境変数名(値は現在のMCP processから読む。pty_listのenv_keysで読める)。端末の環境は、名指ししなくても現在のMCP processの環境を継ぐ"
  2. Changed1 schema field changedv0.39.1
    • addedInput schema / properties / remote
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "別端末のAitermで実行する時のSSH接続情報。hostだけならssh_configの接続名として使う。Aitermは接続情報を保存・管理しない。passphraseは会話記録に残るため、ssh-agentかpassphrase_env(環境変数名)を推奨する。",
      +  "properties": {
      +    "host": {
      +      "pattern": "^(?!-)[A-Za-z0-9._%:\\[\\]-]{1,255}$",
      +      "type": "string"
      +    },
      +    "identity_file": {
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "passphrase": {
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "passphrase_env": {
      +      "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
      +      "type": "string"
      +    },
      +    "port": {
      +      "maximum": 65535,
      +      "minimum": 1,
      +      "type": "integer"
      +    },
      +    "ssh_options": {
      +      "items": {
      +        "pattern": "^[A-Za-z][A-Za-z0-9]*=[^\\r\\n]*$",
      +        "type": "string"
      +      },
      +      "maxItems": 32,
      +      "type": "array"
      +    },
      +    "user": {
      +      "pattern": "^(?!-)[A-Za-z0-9._@\\\\-]{1,128}$",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "host"
      +  ],
      +  "type": "object"
      +}
  3. Changed1 schema field changedv0.35.0
    • addedInput schema / properties / env_vars
      Added value: +{
      +  "description": "現在のMCP processからsessionへ継承する環境変数名",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  4. First observedv0.20.2

TDQS

A4.1/5.0
Behavior4/5

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

No annotations are provided, so the description carries the burden, and it discloses non-obvious behavior: the backend server is resident so sessions survive restarts of this server or clients, and the OS-specific dependency (tmux, or psmux 3.3.8+ on Windows native). It does not cover failure modes, resource limits, or cleanup expectations, which is the remaining gap.

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?

Three sentences, front-loaded with the action and return value, then persistence behavior, then remote routing. No filler, though the SSH guidance sentence is dense and could be split for readability.

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

Completeness4/5

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

For a 4-parameter tool with a nested remote object, no output schema, and no annotations, the description covers what the tool does, what it returns (session_id), platform prerequisites, session lifetime, and how to handle remote work. It stops short of describing concurrency limits or what happens to an existing session with the same name.

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?

Schema description coverage is 100%, including detailed notes on the nested remote object (passphrase logging warning, passphrase_env recommendation) and env_vars inheritance. So the baseline of 3 applies; the description adds little parameter-level meaning beyond what the schema already documents.

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 names a specific verb and resource ('ローカル永続端末を1個開き') and states the return value (session_id), plus the platform-specific backing (tmux / psmux 3.3.8+). It also explicitly distinguishes itself from the pty_send sibling by declaring that remote access is not a separate tool but is done via ssh inside the opened terminal.

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 clear context for when this tool applies (opening a local persistent terminal) and an explicit when-not/alternative pattern: remote work should be done by typing `ssh host` inside the session rather than through a dedicated tool. It doesn't spell out ordering relative to siblings like pty_send/pty_read, but the routing decision for the ambiguity that matters (remote) is stated.

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