Skip to main content
Glama

codebrain_consensus_generate

Generate multiple candidates for a prompt and have Qwen select the best one. Useful for high-variance tasks where single outputs may drift.

Instructions

Generate N candidates, let Qwen pick the best, return the winner.

Runs prompt N times (serial — Ollama serialises on single GPU anyway), then does one additional call where Qwen is shown all candidates and asked to return the best one verbatim. Useful for high-variance tasks where a single shot drifts but majority-vote style sampling tightens quality at the cost of N+1 inference calls.

Args: prompt: The task description or content request. system: Optional system message to steer tone / format / constraints. n: Number of candidates to generate (default 3, clamped to [2, 5]). use_brain: If true, prepend .brain/context.md to the system prompt.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYes
systemNo
nNo
use_brainNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description fully discloses behavior: serial execution, N+1 calls, Qwen selecting the best, clamping of n to [2,5], and use_brain prepending context. It does not cover error handling, but the core behavioral traits are clearly stated.

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 well-structured with a summary sentence, explanation, and Args block. It is slightly verbose but every sentence adds value. It earns a 4 for being clear and organized without excess.

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?

Given the existence of an output schema (not shown), the description does not need to detail return values. It covers the process, parameter usage, and typical use case. The description provides sufficient context for the tool's operation.

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?

Schema coverage is 0%, but the description includes an Args section explaining each parameter: prompt (required), system (optional steering), n (default and clamping), and use_brain (context prepending). This adds full meaning beyond the bare schema.

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 the tool generates N candidates and lets Qwen pick the best, returning the winner. It distinguishes itself from single-shot generation by noting it is for high-variance tasks, making the purpose specific and distinct from siblings like codebrain_generate.

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?

The description explicitly advises using this tool for high-variance tasks where a single shot drifts, and mentions the cost of N+1 inference calls. While it does not list all alternatives, it provides clear context for when to use it, earning a high score.

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/Tschonsen/CodeBrain'

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