Skip to main content
Glama
aiterm-mcp
by kitepon

pty_list

Lists active PTY sessions with attach state, foreground command, size, and agent details so you can inspect running terminals.

Instructions

握っているセッション一覧(名前 / 現在の前面コマンド / attach 状態 / サイズ / agent 情報)。

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": "pty_list"
  }
}

Input Schema

NameRequiredDescriptionDefault
remoteNo別端末のAitermで実行する時のSSH接続情報。hostだけならssh_configの接続名として使う。Aitermは接続情報を保存・管理しない。passphraseは会話記録に残るため、ssh-agentかpassphrase_env(環境変数名)を推奨する。
env_keysNo帰属確認用の非秘密環境変数名。指定したキーだけを返す

Output Schema

NameRequiredDescriptionDefault
schemaYes
sessionsYes
observed_atYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.63.7
    • addedOutput schema / properties / sessions / items / properties / launch_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "一覧取得時のmanaged起動ID。通常PTYやmetadata不明時はnull、旧remote版は省略。操作時のfresh binding検証の代わりにはしない"
      +}
  2. Changed1 schema field changedv0.62.2
    • changedOutput schema / properties / sessions / items / properties / harness / anyOf
      Previous value: -[
      -  {
      -    "enum": [
      -      "claude-code",
      -      "codex-cli",
      -      "grok-cli",
      -      "cursor-cli"
      -    ],
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "enum": [
      +      "claude-code",
      +      "codex-cli",
      +      "grok-cli",
      +      "cursor-cli",
      +      "antigravity-cli"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  3. Changed1 schema field changedv0.60.1
    • addedOutput schema / properties / sessions / items / properties / vendor_session_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "agent sessionのharness側の会話ID。Claude CodeとGrokは起動時に--session-idで渡した値(席の中で会話を移した後は追わない)、CodexとCursorは分かった後の値。通常PTYと、まだ分からない席はnull"
      +}
  4. 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"
      +}
  5. Changed2 schema fields changedv0.35.0
    • addedInput schema / properties / env_keys
      Added value: +{
      +  "description": "帰属確認用の非秘密環境変数名。指定したキーだけを返す",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "observed_at": {
      +      "type": "string"
      +    },
      +    "schema": {
      +      "const": "aiterm.pty-list-result.v1",
      +      "type": "string"
      +    },
      +    "sessions": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "attached": {
      +            "type": "boolean"
      +          },
      +          "current_command": {
      +            "type": "string"
      +          },
      +          "environment": {
      +            "additionalProperties": {
      +              "anyOf": [
      +                {
      +                  "type": "string"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            },
      +            "propertyNames": {
      +              "type": "string"
      +            },
      +            "type": "object"
      +          },
      +          "harness": {
      +            "anyOf": [
      +              {
      +                "enum": [
      +                  "claude-code",
      +                  "codex-cli",
      +                  "grok-cli",
      +                  "cursor-cli"
      +                ],
      +                "type": "string"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "height": {
      +            "type": "number"
      +          },
      +          "session_id": {
      +            "type": "string"
      +          },
      +          "width": {
      +            "type": "number"
      +          }
      +        },
      +        "required": [
      +          "session_id",
      +          "current_command",
      +          "attached",
      +          "width",
      +          "height",
      +          "harness",
      +          "environment"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "schema",
      +    "observed_at",
      +    "sessions"
      +  ],
      +  "type": "object"
      +}
  6. First observedv0.20.2

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full burden; it usefully discloses the returned per-session fields but never states that the operation is read-only/non-mutating, nor what happens when no sessions exist. The SSH-to-another-Aiterm behavior is left entirely to the schema's remote description.

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?

A single compact sentence with the core resource front-loaded and the field list in a parenthetical. Nothing is redundant, though the field enumeration partially duplicates what the output schema likely already conveys.

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

Completeness3/5

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

An output schema exists, so return-value detail is not strictly required, and the parameters are fully described in-schema. What is missing for an agent to call it confidently is behavioral framing: safe/read-only nature and how remote lists behave relative to local ones.

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% and both parameters (remote, env_keys) are documented in-schema, so the baseline of 3 applies. The description adds no meaning about remote execution or which env keys are surfaced via env_keys.

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

Purpose4/5

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

The description states a specific verb+resource ("握っているセッション一覧" = list of held sessions) and enumerates what each entry contains (name, foreground command, attach state, size, agent info). An agent can tell this is a listing/introspection tool, though it never explicitly contrasts itself with siblings like pty_observe or pty_read.

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

Usage Guidelines2/5

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

There is no guidance on when to use this versus pty_observe, pty_read, or pty_open, and no mention of prerequisites. The listing purpose implies a discovery/pre-check role, but the agent must infer that on its own.

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