Skip to main content
Glama
Platano78

Smart-AI-Bridge

by Platano78

dual_iterate

Generate production-ready code by iteratively reviewing and fixing until a quality threshold is met, saving tokens by returning only the final accepted version.

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 provided, the description carries the full burden, and it excels. It discloses that the tool is 'Read-only: returns the generated code to the caller; does NOT write to disk' and explains the internal loop, the fact that Claude sees only the final accepted code, and the meaning of return fields like `history` and `self_review_applied`. It also details the stopping conditions and the role of `quality_threshold`. This is comprehensive behavioral 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?

The description is long but every sentence earns its place. It is front-loaded with the core mechanism, then covers usage, alternatives, read-only behavior, and return format. Despite the length, it is densely informative and structured logically. No fluff or repetition of schema details; it adds value throughout.

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 the tool's complexity (internal loop, 4 parameters, no output schema), the description is remarkably complete. It explains the full process, the return object structure (including `success`, `code`, `mode`, `iterations`, `execution_time_ms`, `metadata`, `history`, `final_review`, `self_review_applied`), the read-only nature, and how to persist results via `write_files_atomic`. It also addresses the user-facing benefit (reduced token output). Nothing critical is missing.

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 adds meaningful context beyond the schema: it explains the effect of `quality_threshold` with concrete ranges ('0.7 (default) = balanced. 0.85+ = strict... 0.5 = lenient') and clarifies that the loop stops at `max_iterations` regardless of threshold. It also links `include_history` to the return value. This enriches parameter understanding without redundancy, so 4 is appropriate.

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 opens with a specific verb and resource: 'Code generation with an internal review loop,' and clearly explains the iterative process. It distinguishes itself from siblings by naming alternatives: 'For multi-agent TDD with parallelism + tests, use `parallel_agents`. For one-shot generation without iteration, use `generate_file`.' This fully clarifies what the tool does and when it is unique.

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?

Explicit usage guidance is provided: 'Use for complex single-file generation where you would otherwise pay the token cost of reviewing iterations in-chat.' It also states when not to use it by pointing to alternatives: `parallel_agents` for multi-agent TDD and `generate_file` for one-shot generation. This gives clear when/when-not/alternatives, exceeding the minimum.

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