Skip to main content
Glama

Bind runtime identity to caller

bind_runtime_identity

Binds a caller session's agent row to a verified tmux runtime identity by validating PID, TTY, and pane before saving the tmux pane ID.

Instructions

Bind the caller session's agent row to a verified tmux runtime identity. Pass agent to choose the built-in process matcher (codex, claude-code, opencode), or use custom together with process_pattern. Prefer passing ui_pid for the visible agent UI process; the daemon verifies pid → tty → pane before persisting tmux_pane_id. If ui_pid is unavailable, pass ui_tty together with tmux_pane_id for a weaker but still verified binding path. This tool writes registry state; detect_tmux_pane is for debugging only.

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": {
      "agent": "<agent>"
    },
    "name": "bind_runtime_identity"
  }
}

Input Schema

NameRequiredDescriptionDefault
agentYes
ui_pidNo
ui_ttyNo
tmux_pane_idNo
process_patternNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/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 discloses that the operation persists registry state and describes the daemon's verification chain (pid → tty → pane). It does not cover what happens if a binding already exists, whether it overwrites, or how failures surface.

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?

Dense but front-loaded: the purpose comes first, then the preferred path, then the fallback, then the sibling disambiguation. Every sentence adds decision-relevant information with 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?

For a state-mutating tool with no annotations and no output schema, the definition covers inputs and verification behavior thoroughly. It stops short of describing idempotency/rebinding semantics and error outcomes, which an agent would want before retrying.

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

Parameters5/5

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

Schema coverage is 0%, so the description must compensate, and it does: it explains the `agent` enum choices, the `custom`+`process_pattern` pairing, the preferred `ui_pid` path, and the `ui_tty`/`tmux_pane_id` fallback pairing. All five parameters gain meaning beyond the bare schema types.

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 and resource: bind the caller session's agent row to a verified tmux runtime identity. It also distinguishes itself from the debugging sibling by declaring that this tool writes registry state while `detect_tmux_pane` is debug-only.

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?

Gives explicit selection logic: prefer `ui_pid`, fall back to `ui_tty` plus `tmux_pane_id` for a weaker path, and choose `custom` with `process_pattern` when the built-in matchers do not apply. It names the alternative to avoid and why.

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