Skip to main content
Glama

optimize_prompt

Analyze workflow step failures and generate optimized prompt variants from inference logs. Returns up to 5 ranked suggestions for better prompts.

Instructions

Analyze recent failures and generate optimized prompt variants for a workflow step.

Uses LLM-powered analysis of inference logs to suggest better prompts. Returns up to 5 variants ranked by estimated improvement.

Args: workflow_id: UUID of the workflow step_id: UUID of the step to optimize

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflow_idYes
step_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations, the description bears full burden for behavioral disclosure. It mentions LLM-powered analysis and returns up to 5 variants, but does not clarify if the tool has side effects, requires prior runs, or has latency/cost implications. Key behavioral traits are missing.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise and well-structured: an initial summary sentence, a second sentence on methodology, a line on output count, and a clear Args block. Every sentence serves a purpose with no wasted words.

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 presence of an output schema, the description covers the essential: inputs, output count (up to 5 variants), and ranking. It does not mention error conditions or prerequisites (e.g., workflow must have failures), but for a tool with an output schema, this level of completeness is adequate.

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

Parameters4/5

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

Despite 0% schema description coverage, the description provides meaningful parameter documentation in the Args section, explaining that workflow_id is the UUID of the workflow and step_id is the UUID of the step. This adds crucial context beyond the bare schema, compensating for the gap.

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's purpose: analyze recent failures and generate optimized prompt variants for a workflow step. It uses specific verbs ('analyze', 'generate') and resources ('prompt variants', 'workflow step'), distinguishing it from sibling tools like 'apply_prompt_optimization' which likely applies variants.

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?

The description implies use after failures ('analyze recent failures') but does not explicitly state when to use this tool vs. alternatives like 'apply_prompt_optimization'. No exclusions or conditional guidance are provided, leaving the agent to infer context.

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/beee003/vynn-mcp'

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