Skip to main content
Glama
aiterm-mcp
by kitepon

pty_observe

Observe a PTY session to confirm it exists and is alive, then get structured state, process identity, screen-change, and CPU activity data without exposing screen contents or raw arguments.

Instructions

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

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. 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"
      +]
  2. 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"
      +  }
      +]
  3. 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"
      +    }
      +  ]
      +}
  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. Addedv0.35.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it names the observable outputs and sets explicit boundaries on what is withheld (screen text, raw argv), which is meaningful for privacy/safety. It never explicitly states the call is side-effect-free/read-only, which for a zero-annotation tool is a notable omission.

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

Conciseness5/5

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

Two sentences, zero filler, with the positive observation scope front-loaded and the exclusion clause second. Every phrase earns its place.

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 shape need not be explained, yet the description still gives a useful enumeration of the observed categories and their limits. The only real gap is the absence of an explicit statement that the call is non-mutating, which matters given no annotations.

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 coverage is 67% and the schema already documents cursor and the nested remote object (including the SSH passphrase warning). The description adds no parameter-level meaning, and session_id remains undescribed in both places, so the baseline 3 fits.

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?

States a specific verb (observe) plus the resource (a given session) and enumerates exactly what is observed: session existence, pane/harness liveness, state and reason, native process identity, screen-change and CPU activity. The closing sentence explicitly excludes screen body and raw argv, which cleanly separates it from the sibling 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 Guidelines4/5

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

The negative clause ('does not return screen body or raw argv') implicitly routes the agent to pty_read when actual terminal content is needed, and to this tool when only liveness/activity signals are wanted. No explicit when-to-use or when-not statement or named alternative is given, so it falls short of a 5.

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