Skip to main content
Glama

optimize_prompt

Score and optimize LLM prompts using multi-framework analysis. Returns improved prompt versions with detailed breakdowns across 8 quality dimensions including PEEM, RAGAS, G-Eval, and MT-Bench criteria.

Instructions

Score AND optimize any LLM prompt using PQS. Returns the original score, an optimized version of the prompt, and dimension-by-dimension breakdown across 8 quality dimensions based on PEEM, RAGAS, G-Eval, and MT-Bench frameworks. Costs $0.025 USDC via x402. Use this when you want to improve a prompt before running it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesThe prompt to optimize
verticalNoThe domain context for optimization. Defaults to general.
api_keyYesPQS API key for authentication. Get one at pqs.onchainintel.net
Behavior4/5

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

No annotations provided, so description carries full burden. Discloses return structure ('Returns the original score, an optimized version...'), cost destructor, and evaluation frameworks (PEEM, RAGAS, etc.). Lacks rate limiting or retry behavior details.

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?

Three efficient sentences with zero waste: action/returns first, cost second (critical barrier), usage guideline third. Front-loads the dual capability immediately.

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?

Dense description adequately compensates for missing output schema by detailing return values (score, optimized version, breakdown). Covers cost and methodology. Could briefly define PQS or explain error states for full marks.

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%, establishing baseline 3. Description focuses on tool behavior rather than expanding parameter semantics, which is appropriate since schema fully documents 'prompt', 'vertical', and 'api_key'.

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?

Clear specific verbs ('Score AND optimize') and resource ('LLM prompt'). Capitalized 'AND' effectively distinguishes from sibling 'score_prompt' by emphasizing the dual action. Mentions specific methodology (PQS) and frameworks.

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?

Explicit when-to-use clause ('Use this when you want to improve a prompt before running it'). Critically includes cost warning ('Costs $0.025 USDC via x402') which acts as a guideline for when NOT to use or to prepare payment.

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/OnChainAIIntel/pqs-mcp-server'

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