Skip to main content
Glama

Improve a tested prompt

improve_prompt

Use this when a finished test has failures and someone wants the prompt to fail less, keep to a format or be more reliable. Rewrites the prompt from the failures and any ratings, then tests the new version on the same cases, checks and models, so the two can be compared. Spends credit. Each call starts a new paid run: to follow it, call get_test, not this again.

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": {
      "test_id": "<test_id>"
    },
    "name": "improve_prompt"
  }
}

Input Schema

NameRequiredDescriptionDefault
test_idYes
max_spend_usdNoLimit for this run. Default 50, or 2 from a chat app, never above the credit left.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / max_spend_usd
      Added value: +{
      +  "description": "Limit for this run. Default 50, or 2 from a chat app, never above the credit left.",
      +  "type": "number"
      +}
  2. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=false, destructiveHint=false and openWorldHint=true; the description adds the crucial traits an agent cannot infer — the call spends credit, each invocation starts a new paid run, and re-running is not how you track progress. That cost and idempotency disclosure goes well beyond the structured fields.

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?

Three tight sentences, front-loaded with the trigger and ending with the anti-pattern correction. 'Keep to a format or be more reliable' is a slightly loose phrasing but it still carries information about the failure classes it fixes.

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 only two parameters, no output schema and annotations present, the description covers cost, comparison basis and follow-up well. The remaining gap is whether the original prompt is overwritten or a new version is produced, which matters for an agent deciding whether this is safe to repeat.

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 coverage is 50%: max_spend_usd is already fully documented in the schema, so the description adds nothing there. It does implicitly constrain test_id to a 'finished test' with failures, which is meaning beyond a bare string, but it never explains more precisely than that. Baseline 3 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?

States a specific verb and resource — rewrites the prompt from failures and ratings, then re-tests it on the same cases, checks and models. That is a distinct operation from siblings like test_prompt or run_loaded_prompt, and the agent can tell them apart without opening any schema.

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?

Opens with an explicit trigger condition ('when a finished test has failures and someone wants the prompt to fail less') and closes with an explicit routing instruction: call get_test to follow progress, not this tool again. Both when-to-use and when-not-to-use are stated.

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.