Skip to main content
Glama

ai_fix_request

Sends an API request and, when it returns a 4xx/5xx error, uses AI to diagnose the failure and suggest fixes such as missing headers, bad auth, or incorrect body shape.

Instructions

Send a request, and if it fails (4xx/5xx), use AI to diagnose what's wrong and suggest fixes — missing headers, bad auth, wrong body shape, etc.

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": {
      "request_id": "<request_id>"
    },
    "name": "ai_fix_request"
  }
}

Input Schema

NameRequiredDescriptionDefault
confirmedNoSet to true to confirm sending to an external URL after reviewing it
request_idYes
environment_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.6-beta

TDQS

B3/5.0
Behavior2/5

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

No annotations exist, so the description carries the full burden. It reveals that an actual external request is sent and that 4xx/5xx triggers a diagnosis step, which is useful, but it omits whether this is a retry of a prior send or a fresh send, whether the request can fire twice, and how the diagnosis is returned. Nothing about the confirmation gate that the schema's 'confirmed' parameter implies is surfaced.

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?

A single front-loaded sentence that describes the action and its failure condition, with a short illustrative list at the end. No wasted phrasing, though the em-dash example list is somewhat ornamental.

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 3-parameter tool with no output schema and no annotations, the description covers the conceptual flow but is thin on the mechanics that matter: which request is targeted, what the diagnosis response contains, and whether confirmation is required before any external send. Adequate as an overview, not sufficient to drive a correct first call.

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

Parameters2/5

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

Schema coverage is only 33% — just 'confirmed' is documented — and the description compensates for none of it: the required request_id is never mentioned, environment_id is unaddressed, and the two-step confirmed flow (review URL, then re-call) is not explained. An agent must infer all of this from the schema alone.

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 names a concrete two-part action (send a request, then AI-diagnose a 4xx/5xx failure) and enumerates the failure classes it targets (headers, auth, body shape). It is distinguishable from send_request because of the AI diagnosis layer, though it never names the request being operated on (request_id) as the input.

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

Usage Guidelines3/5

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

It implies the condition for use — after/instead of a plain send when a failure needs explanation — but never states when to choose this over the sibling send_request or send_http_request, nor whether it should only be used after those tools fail. No exclusions or prerequisites are given.

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