Skip to main content
Glama

run_thronglet

Run a coding agent (Claude Code, Codex, OpenCode) on a task in a directory and return its final message as JSON. Supports background execution.

Instructions

Runs a coding agent (Claude Code, Codex, OpenCode) on a task in cwd and returns its final message as JSON {session_id, text, stop_reason, usage, duration_s, warnings?}; with schema, structured replaces text. description names the thronglet for listings. With background: true the call returns {session_id, state, queued} as soon as the turn runs; collect the result with wait_thronglet.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdYesAbsolute path; the agent works in this tree
agentYes<harness>/<model>[:<effort>], e.g. claude/opus[1m]:max, codex/gpt-6-sol:xhigh; valid values: list_harnesses
promptYesTask for the agent
schemaNoJSON Schema (draft-07 or 2020-12) for structured output: the agent submits a matching result, returned as `structured` instead of `text`
timeout_sNoWall-clock limit for the run in seconds; default from config (21600)
backgroundNoReturn as soon as the turn is running (or queued behind the session's current turn); collect the result with wait_thronglet
descriptionYesWhat this thronglet is for, in a few words; shown in session listings

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/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 real work: it discloses the JSON return shape ({session_id, text, stop_reason, usage, duration_s, warnings?}), the structured-output substitution, and the background return contract ({session_id, state, queued}). It implies filesystem impact via "the agent works in this tree" but never states permissions, reversibility, or that the run mutates cwd.

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?

Everything is front-loaded into one dense paragraph with no filler, and the return contract comes first. The semicolon-chained clauses make it slightly harder to parse than a clean multi-sentence structure, but nothing is wasted.

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?

No output schema exists, and the description compensates by documenting both the sync and background return shapes plus the structured-output path, which is exactly what an agent needs. It stops short of noting cancel_thronglet as a lifecycle alternative or any failure/timeout behavior beyond the default config value.

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 description coverage is 100%, so the baseline is 3; the description earns above that by tying parameters to behavior the schema doesn't state — schema replaces text with structured, background returns early, and description feeds session listings. It adds meaning beyond the field-level docs.

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 states a specific verb ("Runs a coding agent") with named harnesses and the execution context (cwd), and it distinguishes this tool from the sibling wait_thronglet by explaining the async handoff. An agent can tell what this does without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives clear conditional usage for the background: true path and names wait_thronglet as the collection mechanism. It doesn't explicitly state when to prefer this over alternatives like send_message to an existing thread, but the sync/async guidance is concrete.

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