Skip to main content
Glama

Fix a bad AI answer

fix_bad_answer
Read-onlyIdempotent

When an AI answer goes wrong (it made up a source or a number, ignored an instruction, came back too long or in the wrong shape, sounded robotic or generic, changed every time, refused, or lost track of a long chat), find the likely cause and the exact line to add to the prompt. Draws on the thinkhard.si troubleshooter of 33 common problems. Describe what went wrong in plain words.

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": {
      "problem": "<problem>"
    },
    "name": "fix_bad_answer"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoOptional: how many likely causes to return, best match first (1 to 5, default 3).
problemYesWhat went wrong, in plain words, for example "it invented a statistic" or "it keeps ignoring my word limit".

Output Schema

NameRequiredDescriptionDefault
matchesYesBest match first. Empty when nothing matches.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / limit / description
      Added value: +"Optional: how many likely causes to return, best match first (1 to 5, default 3)."
  2. Added

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so safety and repeatability are covered without the description. The description adds genuine context by naming its knowledge base ('the thinkhard.si troubleshooter of 33 common problems') and the shape of the answer (likely causes plus an exact prompt line), but says nothing about limits, confidence, or what happens when no cause matches.

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 sentences, with the trigger condition leading and the action following, which is the right order for an agent scanning for applicability. The long parenthetical of failure modes is useful for matching but is bulky and could have been trimmed to a few canonical examples.

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?

With an output schema present and annotations covering the safety profile, the description only needs to convey intent and input framing, which it does. Minor gap: it does not hint at what to do with multiple returned causes or whether the suggested prompt line should be applied verbatim.

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%, so both problem and limit are already documented with examples and bounds. The description reinforces the problem field with 'Describe what went wrong in plain words' but adds nothing about limit or about how specific vs. vague phrasing changes results, so the baseline 3 applies.

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?

Concrete verb phrase ('find the likely cause and the exact line to add to the prompt') tied to a specific failure scenario, and the parenthetical enumeration of failure modes makes the tool's domain unmistakable. It never names the nearest sibling (grade_prompt), so an agent must infer the difference between grading a prompt and diagnosing a bad answer.

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 trigger condition is explicit and front-loaded: 'When an AI answer goes wrong (it made up a source..., refused, or lost track of a long chat)'. That trigger list doubles as the entry criterion, but there is no statement of when NOT to use it or which sibling to pick instead.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources