Skip to main content
Glama

session_open

Open or reuse an Agent Bridge hosted Pi or Claude session by directory and purpose; create and register a new one when no live session exists.

Instructions

get-or-create:按 (engine, cwd, purpose) 查登记册;命中且会话还在就复用,否则用 hosted.create 新建(非空启动偏好显式传;空值不传,交给 CLI 默认),自动打 MCP 标签、标题 MCP · ,并写入登记册。cwd 必须在 bridge 托管白名单内(远程设备不能 addDir)。

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": {
      "cwd": "<cwd>",
      "purpose": "<purpose>"
    },
    "name": "session_open"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdYesbridge 托管白名单内的绝对路径(本机 agent 的工作目录)
modelNo主模型;缺省取 profile.model
titleNo可选:覆盖默认标题 MCP · <purpose>
engineNo托管引擎;缺省取 profile.engine
purposeYes用途线短名,同一 (engine,cwd,purpose) 复用同一会话
thinkingNo主思考等级;缺省取 profile.thinking
subagentModelNo子代理模型;缺省取 profile.subagentModel
subagentThinkingNo子代理思考等级;缺省取 profile.subagentThinking

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does substantial work: it discloses the registry write, the automatic MCP tagging and 'MCP · <purpose>' title, the rule that non-empty startup preferences are passed explicitly while empty ones defer to CLI defaults, and the hard cwd whitelist restriction (remote devices cannot addDir). It stops short of describing permissions, failure modes when cwd is outside the whitelist, or concurrency behavior on simultaneous creates.

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?

The get-or-create contract is front-loaded in the first clause, with creation details following and the hard cwd constraint last. It is a single dense sentence-chain with no filler, though the semicolon-and-parenthetical packing makes it harder to scan than it needs to be.

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?

For a session-creation tool with no annotations and no output schema, the description covers identity, reuse, defaults, tagging, and the whitelist constraint well. However, it never says what comes back — a session handle, id, or object — which matters for a get-or-create tool whose caller must use the result in follow-up calls such as session_send or session_wait.

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%, so every parameter including the profile fallbacks is already documented. The description reinforces only two points beyond the schema — the cwd whitelist constraint and the purpose-keyed reuse semantics — and adds nothing about the optional model/thinking overrides. Baseline 3 is appropriate when the schema does the heavy lifting.

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 opens with an explicit compound verb, 'get-or-create', names the resource (session) and the exact identity key (engine, cwd, purpose), then spells out both branches: reuse a live match or create via hosted.create. An agent can distinguish this from siblings like session_adopt or session_list without opening any schema.

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?

It explains the internal reuse-vs-create condition clearly, which implies when to call it (when you want a session for a purpose line and don't care whether it's new). But it never states when to prefer session_adopt, session_list, or session_read instead, and gives no exclusion beyond the cwd whitelist constraint. Usage is implied rather than directed.

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