Skip to main content
Glama

Duck Iteration

duck_iterate
Read-only

Refines an AI response through alternating rounds between two LLM providers, using refine or critique-improve modes to iteratively improve output quality.

Instructions

Iteratively refine a response between two ducks. One generates, the other critiques/improves, alternating for multiple rounds.

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>",
      "providers": "<providers>",
      "mode": "<mode>"
    },
    "name": "duck_iterate"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeYesrefine: each duck improves the previous response. critique-improve: alternates between critiquing and improving.
promptYesThe initial prompt/task to iterate on
providersYesExactly 2 provider names for the ping-pong iteration
iterationsNoNumber of iteration rounds (default: 3, max: 10)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.20.14
    • removedInput schema / additionalProperties
      Removed value: -false
  2. Addedv1.19.6
  3. Removedv1.19.5
  4. Changed3 schema fields changedv1.2.3
    • addedInput schema / $schema
      Added value: +"http://json-schema.org/draft-07/schema#"
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / providers / items / enum
      Added value: +[
      +  "openai",
      +  "google",
      +  "groq",
      +  "ollama"
      +]
  5. First observedv1.0.0

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered and the description does not contradict it. The description adds the alternation/round behavior, but omits cost-relevant facts an agent would want: this makes many LLM calls, may be slow, and consumes provider quota across two named providers.

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?

Two short sentences, front-loaded with the core action and then the mechanism. It is efficient, though the second sentence's description of duck roles is imprecise enough that it could mislead rather than merely being terse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool that fans out to two providers over up to ten rounds, the description says nothing about relative cost, latency, failure behavior when one provider errors, or what the final result looks like. With no output schema present, some of that burden falls on the description, and it is only partially met.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with enum values and iteration bounds fully documented in the schema, so the baseline is 3. The phrase 'alternating for multiple rounds' loosely gestures at the iterations parameter but adds no format or tuning insight beyond what the schema states.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('iteratively refine') plus a clear mechanism (two ducks alternating generate/critique). It distinguishes the tool from single-duck siblings like ask_duck, but the framing ('one generates, the other critiques/improves') only accurately describes the 'critique-improve' mode and leaves the 'refine' mode unaccounted for.

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

Usage Guidelines2/5

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

There is no guidance on when to pick this over compare_ducks, duck_debate, duck_council, or duck_judge, all of which involve multiple ducks producing/interrogating responses. The description implies usage through its mechanism but names no alternative and states no exclusion condition.

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