Skip to main content
Glama

spawn_and_observe

Start background tasks or long-running services non-blockingly, returning a session ID and log handle while waiting for readiness markers and capturing error patterns for verified process completion.

Instructions

启动后台任务或常驻服务(输出落盘到 log_base 对应的 .out/.err 文件,立即返回 session_id 与 log_base 句柄不阻塞)。适用于需要等待就绪标记(ready_marker——回溯热窗口,快输出竞态安全)、自动捕获错误模式(error_pattern——命中即收摊)并在结束后用 stop_and_verify 核实进程终态与退出码的场景。若只需持续流式查看实时输出(如 tail -f / 监控日志)并按游标翻页续读,请改用 observe_stream + read_stream。

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": {
      "command": "<command>"
    },
    "name": "spawn_and_observe"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNo会话名(人读前缀)
layerNo目标层名(缺省=默认层)
commandYes长跑命令
ready_markerNo就绪标记(如 'listening on')
error_patternNo错误模式(命中即收摊)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does well: it discloses non-blocking behavior, log file artifacts via log_base, ready_marker hot-window backtracking to avoid fast-output races, and that error_pattern causes early termination. It doesn't cover permission requirements or what a missing marker timeout looks like, so it falls just short of full transparency.

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: parenthetical covers return behavior and file artifacts immediately, then the scenario, then the alternative-tool routing. 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?

For a 5-parameter background-spawn tool with no annotations and no output schema, the description covers blocking behavior, artifacts, marker semantics, and verification handoff. It omits cleanup/lifecycle expectations (e.g. whether sessions must be closed) and failure modes, a minor gap given sibling stop_and_verify exists.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3; the description adds real semantics beyond the schema by explaining that ready_marker is matched against a retroactive hot window (race-safe) and error_pattern terminates the session on hit. It doesn't explain layer or name semantics beyond the schema, so not a 5.

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?

State a specific verb+resource (启动后台任务或常驻服务), plus the distinct mechanics: output written to .out/.err files and immediate return of session_id and log_base without blocking. It explicitly distinguishes itself from observe_stream + read_stream for streaming use, so an agent can separate it from siblings.

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 an explicit when-to-use scenario (need ready_marker, error_pattern, and post-hoc verification via stop_and_verify) and an explicit when-to-use-something-else rule naming the alternative tools. Nothing is left to inference.

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