Skip to main content
Glama
aiterm-mcp
by kitepon

pty_observe

Check a PTY session's existence and observe pane/harness liveness, state, reasons, process identity, screen changes, and CPU activity without returning screen text or raw arguments.

Instructions

指定sessionの存在、paneとharnessの生存、状態と理由、native process identity、画面変化とCPU活動を構造化して観測する。画面本文と生argvは返さない。

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": {
      "session_id": "<session_id>"
    },
    "name": "pty_observe"
  }
}

Input Schema

NameRequiredDescriptionDefault
cursorNo前回のactivity.cursor。省略・session再作成時は活動差分をnullで返す
remoteNo別端末のAitermで実行する時のSSH接続情報。hostだけならssh_configの接続名として使う。Aitermは接続情報を保存・管理しない。passphraseは会話記録に残るため、ssh-agentかpassphrase_env(環境変数名)を推奨する。
session_idYes

Output Schema

NameRequiredDescriptionDefault
stateYes
existsYes
reasonYes
schemaYes
harnessYes
activityYes
launch_idYes
pane_aliveYes
session_idYes
token_hintYes
observed_atYes
pane_processYes
harness_aliveYes
harness_processYes
process_identityYes
parent_deliveriesNo
pending_child_deliveriesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.70.127
    • changedOutput schema / properties / harness / anyOf
      Previous value: -[
      -  {
      -    "enum": [
      -      "claude-code",
      -      "claude-machine",
      -      "codex-cli",
      -      "grok-cli",
      -      "cursor-cli",
      -      "antigravity-cli"
      -    ],
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "enum": [
      +      "claude-code",
      +      "claude-machine",
      +      "codex-cli",
      +      "codex-machine",
      +      "grok-cli",
      +      "grok-machine",
      +      "cursor-cli",
      +      "cursor-machine",
      +      "antigravity-cli",
      +      "antigravity-machine"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  2. Changed1 schema field changedv0.70.112
    • addedInput schema / properties / remote / properties / ssh
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Pinned ssh: {known_hosts_file, host_key_alias?, identity_agent | identity_file, strict_host_key?: true} (absolute paths). Strict host checking against that file with that one identity, no user ssh config. Not combinable with identity_file, ssh_options, passphrase or passphrase_env. Needs Aiterm 0.70.101 on the other computer.",
      +  "properties": {
      +    "host_key_alias": {
      +      "pattern": "^(?!-)[A-Za-z0-9._%:\\[\\]-]{1,255}$",
      +      "type": "string"
      +    },
      +    "identity_agent": {
      +      "pattern": "^(\\/|[A-Za-z]:[\\\\/])[^\\s\"'`]*$",
      +      "type": "string"
      +    },
      +    "identity_file": {
      +      "pattern": "^(\\/|[A-Za-z]:[\\\\/])[^\\s\"'`]*$",
      +      "type": "string"
      +    },
      +    "known_hosts_file": {
      +      "pattern": "^(\\/|[A-Za-z]:[\\\\/])[^\\s\"'`]*$",
      +      "type": "string"
      +    },
      +    "strict_host_key": {
      +      "const": true,
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "known_hosts_file"
      +  ],
      +  "type": "object"
      +}
  3. Changed1 schema field changedv0.70.91
    • changedOutput schema / properties / harness / anyOf
      Previous value: -[
      -  {
      -    "enum": [
      -      "claude-code",
      -      "codex-cli",
      -      "grok-cli",
      -      "cursor-cli",
      -      "antigravity-cli"
      -    ],
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "enum": [
      +      "claude-code",
      +      "claude-machine",
      +      "codex-cli",
      +      "grok-cli",
      +      "cursor-cli",
      +      "antigravity-cli"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  4. Changed1 schema field changedv0.70.60
    • addedOutput schema / properties / activity / properties / background_tasks
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
  5. Changed1 schema field changedv0.70.39
    • changedOutput schema / properties / parent_deliveries / items / properties / child_failure / properties / category / enum
      Previous value: -[
      -  "capacity",
      -  "rate_limited",
      -  "transient",
      -  "other"
      -]New value: +[
      +  "capacity",
      +  "rate_limited",
      +  "transient",
      +  "authentication",
      +  "other"
      +]
  6. Changed4 schema fields changedv0.63.7
    • addedOutput schema / properties / parent_deliveries / items / properties / child_error_kind
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • addedOutput schema / properties / parent_deliveries / items / properties / child_failure
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "boundary": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": false,
      +          "properties": {
      +            "event_cursor": {
      +              "maximum": 9007199254740991,
      +              "minimum": 0,
      +              "type": "integer"
      +            },
      +            "input_id": {
      +              "pattern": "^[a-f0-9]{32}$",
      +              "type": "string"
      +            },
      +            "operation_id": {
      +              "anyOf": [
      +                {
      +                  "type": "string"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            },
      +            "turn_id": {
      +              "anyOf": [
      +                {
      +                  "type": "string"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            }
      +          },
      +          "required": [
      +            "event_cursor",
      +            "operation_id",
      +            "turn_id"
      +          ],
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "category": {
      +      "enum": [
      +        "capacity",
      +        "rate_limited",
      +        "transient",
      +        "other"
      +      ],
      +      "type": "string"
      +    },
      +    "execution": {
      +      "enum": [
      +        "not_started",
      +        "started",
      +        "unknown"
      +      ],
      +      "type": "string"
      +    },
      +    "future_effects": {
      +      "const": "unknown",
      +      "type": "string"
      +    },
      +    "terminal": {
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "category",
      +    "execution",
      +    "boundary",
      +    "terminal",
      +    "future_effects"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / parent_deliveries / items / properties / child_vendor_session_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • changedOutput schema / properties / state / enum
      Previous value: -[
      -  "busy",
      -  "idle",
      -  "blocked",
      -  "dead",
      -  "missing",
      -  "unknown"
      -]New value: +[
      +  "busy",
      +  "idle",
      +  "blocked",
      +  "dead",
      +  "missing",
      +  "unknown",
      +  "hibernated"
      +]
  7. Changed1 schema field changedv0.62.2
    • changedOutput schema / 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"
      +  }
      +]
  8. Changed2 schema fields changedv0.49.0
    • addedOutput schema / properties / activity / properties / post_startup_process_count
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • addedOutput schema / properties / pending_child_deliveries
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
  9. 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"
      +}
  10. Addedv0.35.0

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations, the description must carry behavioral weight; it does disclose a real trait beyond the schema by naming the redacted fields (screen body, raw argv) and framing the call as observation. It does not state that the operation is read-only/non-destructive, nor whether supplying cursor advances any server-side state, nor what auth/preconditions the remote path requires.

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?

Two tight sentences, front-loaded with the verb and the observed facets, then the exclusions. Dense but every clause carries information; no filler.

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?

An output schema exists, so return values need not be described, and the description covers the observable scope plus the redaction boundary for a moderately complex, nested-schema tool. The residual gap is the absence of any usage steering versus pty_read/pty_list.

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

Parameters2/5

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

Schema coverage is a middling 67% and the description never mentions session_id, cursor, or remote. The cursor's delta semantics and the pinned-ssh constraints live only in the schema, so the description adds essentially no meaning beyond it.

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?

States a concrete verb (observe, 観測する) plus the exact resource set: session existence, pane/harness liveness, state and reason, native process identity, screen deltas and CPU activity. The closing sentence '画面本文と生argvは返さない' sharply delimits it from the raw-reading siblings, so an agent can tell it is a structured status probe rather than a content reader.

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

Usage Guidelines3/5

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

The negative statement about what is not returned implies the alternative (use pty_read for screen body / argv), but no sibling is named and there is no explicit 'use this when…' condition. Guidance is inferable rather than stated.

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