Skip to main content
Glama

optimize_prompt

Analyze a prompt to detect ambiguities, compile an optimized version, score quality, and estimate cost across providers, returning a PreviewPack for review.

Instructions

Analyze a raw prompt, detect ambiguities, compile an optimized version, score quality, and estimate cost across providers. Returns a PreviewPack for review.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
raw_promptYesThe raw user prompt to optimize
contextNoOptional context: repo info, file contents, preferences
targetNoOutput target: claude (XML), openai (system/user), generic (markdown)claude
Behavior3/5

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

With no annotations, the description bears full responsibility. It states the tool analyzes, optimizes, scores, and estimates cost, returning a PreviewPack. It does not disclose whether the tool has side effects (e.g., saving or modifying data), but the actions described suggest a read-only analysis. This is adequate but not thorough.

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 a single, well-structured sentence that lists all key actions up front. It is concise and front-loaded, though the list of actions is slightly lengthy. Still, every phrase adds value.

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?

The description mentions the output (PreviewPack) and lists multiple operations, but lacks detail on the return format, usage examples, or how the results integrate with other tools. Given the absence of an output schema, the description could be more complete.

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 100%, with each parameter having a clear description. The tool description adds high-level context but does not enhance parameter-level meaning beyond what the schema provides. Baseline 3 is appropriate.

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 clearly states the tool's purpose: analyzing, optimizing, scoring, and estimating cost for a prompt. It is specific with a verb and resource, but does not explicitly differentiate from sibling tools like refine_prompt or check_prompt, though the combination of actions is unique.

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?

The description provides no guidance on when to use this tool versus alternatives like refine_prompt or check_prompt. It does not mention any conditions, prerequisites, or exclusions, leaving the agent without context for selection.

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/rishi-banerjee1/prompt-control-plane'

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