Skip to main content
Glama
Platano78

Smart-AI-Bridge

dual_iterate

Generates code with automated review loop: writes, scores against quality threshold, and iterates until accepted. Reduces token cost for complex single-file tasks.

Instructions

Code generation with an internal review loop: a generator backend writes code, a reviewer backend scores it against quality_threshold, the generator fixes flagged issues, and the cycle repeats until the threshold is met or max_iterations runs out. The whole loop runs inside SAB; Claude sees only the final accepted code (~1 turn of output instead of 3-5). Use for complex single-file generation where you would otherwise pay the token cost of reviewing iterations in-chat. For multi-agent TDD with parallelism + tests, use parallel_agents. For one-shot generation without iteration, use generate_file. Read-only: returns the generated code to the caller; does NOT write to disk (pass the result to write_files_atomic to persist). Returns: {success, code (final accepted code as a string), mode (the iteration mode used), iterations (number actually run), execution_time_ms, metadata:{task_preview, code_length, timestamp}, history (full per-iteration log, only when include_history:true), final_review:{status, notes}, self_review_applied}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskYesCode generation task description (e.g., "Write a function that validates email addresses")
max_iterationsNoMaximum review iterations before accepting result (default: 3)
include_historyNoInclude iteration history in response (useful for debugging)
quality_thresholdNoMinimum reviewer score (0.5–1.0) needed to accept and stop iterating. 0.7 (default) = balanced. 0.85+ = strict (more iterations, better code, may exhaust `max_iterations`). 0.5 = lenient (returns first plausible attempt). The loop also stops at `max_iterations` regardless of threshold.
Behavior5/5

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

With no annotations, the description fully discloses the internal loop behavior, read-only nature, return format including history, and that it does not write to disk. It fully satisfies the transparency burden.

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 that front-loads the core mechanism, but the return format details at the end could be slightly trimmed or separated. Nonetheless, it is efficient and well-structured.

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 compensates fully by detailing the return format. It explains the iterative process, parameter effects, and usage context. All relevant information for tool selection and invocation is present.

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?

The description adds significant value beyond the schema by explaining quality_threshold values (0.7 balanced, 0.85+ strict, 0.5 lenient) and their implications, and clarifies the interaction of include_history. Schema coverage is 100%, but the description elaborates meaningfully.

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 clearly states it is a code generation tool with an internal review loop, explicitly contrasting with siblings like parallel_agents and generate_file, and specifies the resource (complex single-file generation).

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?

The description provides explicit when-to-use guidance (complex single-file generation where token cost is high) and when-not-to-use (multi-agent TDD use parallel_agents; one-shot use generate_file), plus instructs to use write_files_atomic to persist.

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/Platano78/Smart-AI-Bridge'

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