Skip to main content
Glama

knitbrain_run_loop

Runs one cycle of an autonomous goal loop driven by a verify command, returning a directive for the next fix until the goal is met or iteration cap reached.

Instructions

Autonomous goal loop (ONE cycle per call). Runs your verify_cmd as the REAL hard gate, tracks iteration across calls, and drives until the goal is met or max_iters. HONEST: the HOST AGENT does the actual work BETWEEN cycles — this tool does NOT edit code. Each call runs the verify gate; if not met it returns a per-cycle directive telling you to make the smallest fix and call again. Stops at grade-pass (met=true) or max_iters (met=false).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
goalYesWhat 'done' means — an actionable brief, not a vague wish.
rubricNoAdvisory checklist you self-verify each cycle; the verify_cmd is the hard gate.
max_itersNoCap on cycles across calls (default 6).
verify_cmdYesShell command that is the hard gate — exit 0 = pass (e.g. 'npm test').
deadline_msNoOptional wall-clock budget in ms. Loop stops with met=false, stopped='deadline' once elapsed since the first cycle exceeds it. Either cap (deadline or max_iters) ends the loop; a real met=true ends it early.
Behavior5/5

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

With no annotations, the description fully discloses important behaviors: the tool does NOT edit code, the host agent does work between cycles, each call runs one cycle, and it stops at grade-pass or max_iters. The mention of 'HONEST' and explicit warning about no code editing adds transparency.

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 description is a single paragraph, dense but efficient. Every sentence adds value without redundancy. It could be slightly more structured (e.g., bullet points for conditions and return values), but it is well front-loaded and concise overall.

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?

Given no output schema, the description sufficiently explains return values (per-cycle directive, met status) and loop mechanics covering all five parameters and stopping conditions. It provides enough information for an agent to use the tool correctly.

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. Description adds meaning beyond schema by explaining that verify_cmd is the 'REAL hard gate', stating default max_iters=6, and detailing deadline_ms behavior. This context helps the agent use parameters correctly.

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?

Description clearly identifies the tool as an autonomous goal loop that runs one cycle per call, using verify_cmd as the hard gate. It specifies that the host agent does work between cycles, distinguishing it from other knitbrain tools like search, classify, or compose.

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?

Description explains when to use each call: run the verify gate, get a directive if not met, and call again until goal or max_iters. It provides clear context but does not explicitly state when not to use this tool or list alternatives such as knitbrain_run or knitbrain_self_check.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PDgit12/knitbrain'

If you have feedback or need assistance with the MCP directory API, please join our Discord server