Skip to main content
Glama

enqueue_task

Queue a coding or execution task in a local SQLite queue for asynchronous execution by a background agy CLI worker; returns a task ID and log path for tracking.

Instructions

将一条编码或执行任务入队,由后台 Worker 异步调用本地 agy CLI 执行。 Enqueue a task into the local agy-bus SQLite queue for asynchronous execution by the background Worker.

Args: prompt: 给 agy 的完整任务指令(建议包含目标、约束与验收标准)。 cwd: 目标工作目录(如 Git 仓库绝对路径);同目录任务会自动串行互斥,不同目录并发执行。 mode: agy 执行权限模式,可选 "accept-edits"(默认)、"auto"、"plan"。 use_sandbox: 是否开启 agy --sandbox 终端限制(默认 True)。 conversation_id: 可选,传入既有会话 ID 以通过 --conversation 续接上下文;留空表示新会话。 model: 可选,指定 agy 使用的模型名称(对应 --model);留空使用默认模型。 effort: 可选,指定推理强度:low / medium / high / xhigh / max(对应 --effort)。 agent: 可选,指定 agy Agent 名称(对应 --agent)。 add_dirs: 可选,附加到工作区的额外目录路径列表(对应可重复的 --add-dir)。

Returns: 包含 task_id、status 与 log_path 的入队回执(毫秒级返回)。

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": {
      "prompt": "<prompt>",
      "cwd": "<cwd>"
    },
    "name": "enqueue_task"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdYes
modeNoaccept-edits
agentNo
modelNo
effortNo
promptYes
add_dirsNo
use_sandboxNo
conversation_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.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 discloses asynchronous execution by a background Worker, immediate return timing, same-directory serialization versus cross-directory concurrency, sandbox default-on, and permission-mode options. It omits failure handling, queue capacity, and any auth/permission prerequisites, which keeps it short of 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-loaded purpose statement followed by an Args block and a Returns line, so an agent can scan it efficiently. The only waste is the bilingual restatement of the opening sentence, which duplicates rather than adds information.

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 9-parameter mutation-ish tool with no annotations and no output schema, the definition covers purpose, every parameter, and even the return payload (task_id, status, log_path). Missing only edge behavior — what happens when the queue is full or the task fails — which is a modest gap given the otherwise thorough coverage.

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 description coverage is 0% across 9 parameters, and the description compensates fully: it enumerates concrete enum values for mode ('accept-edits'/'auto'/'plan') and effort (low–max), explains that conversation_id resumes via --conversation, that add_dirs maps to a repeatable --add-dir, and that same-cwd tasks serialize. That is meaning well beyond the bare titles and defaults in the schema.

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 — 'Enqueue a task into the local agy-bus SQLite queue for asynchronous execution by the background Worker' — which pins down both mechanism (SQLite queue) and execution model (background Worker). This cleanly separates it from the sibling read/cancel tools without needing to name them.

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?

Usage context is implied rather than stated: the '毫秒级返回' millisecond return and async Worker execution signal a fire-and-poll pattern, and 'conversation_id' explains how to continue an existing session. However, it never says when to prefer this over alternatives, nor when not to use it (e.g. short synchronous work, or resuming via a different tool).

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

Deploy Server

Other Tools