Skip to main content
Glama

session_start

Opens a keep-alive managed session on a remote connection for long-running or interactive tasks, auto-selecting tmux, pty-daemon, or setsid; use exec for plain queries.

Instructions

在任意连接(集群/服务器)上开一个保活托管会话。

后端自动选择:远端有 tmux → 交互会话(attach 可回);无 tmux → 部署 pty-daemon 静态守护(可 attach,远端零依赖);部署不可行且给了 command → setsid 后台保活(不可 attach,仅日志)。普通查询任务不要用 本工具,直接用 exec。

Args: connection: 连接 label purpose: 会话用途名(唯一标识,重复会报 exists 或复用) backend: 显式指定 tmux | pty-daemon | setsid(缺省自动) command: setsid 后端必填的后台命令

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": {
      "connection": "<connection>",
      "purpose": "<purpose>"
    },
    "name": "session_start"
  }
}

Input Schema

NameRequiredDescriptionDefault
backendNo
commandNo
purposeYes
connectionYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.7

TDQS

A4.7/5.0
Behavior4/5

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

Goes well beyond annotations by disclosing the backend selection ladder (tmux → pty-daemon → setsid), attachability per backend, remote dependency implications ('远端零依赖'), and that a duplicate purpose yields an exists error or reuse. Missing only operational details like cleanup/lifetime expectations, which is why it is not a 5.

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?

Front-loads the core action and the backend decision tree, then moves to per-argument notes. It runs a bit long across wrapped lines, but nearly every sentence carries decision-relevant content.

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

Completeness5/5

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

For a mutation tool with an output schema already present, this covers what an agent needs: what it creates, how the backend is chosen, what attachability to expect, and what each parameter means. No return-value explanation is required.

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 carries the full burden and does so: connection as a connection label, purpose as a unique identifier with duplicate-handling behavior, backend with the concrete enum values tmux/pty-daemon/setsid that the schema does not encode, and command as required for the setsid backend.

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?

Opens with a specific verb+resource ('开一个保活托管会话') and immediately scopes it to any connection (cluster/server). It then explains the three automatic backend outcomes, which makes it clearly distinct from siblings like exec and session_list.

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?

Explicitly states the negative case: ordinary query tasks must not use this tool and should call exec directly. That names the alternative and the condition that selects it, leaving nothing to inference.

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