Skip to main content
Glama
pozii
by pozii

optimize_prompt

Shorten verbose prompts while preserving original intent, reducing token usage by 30-65% through selectable optimization levels.

Instructions

Shorten a verbose or redundant prompt/system prompt while preserving intent. Typical savings: 30–65%. Run once on system prompts that accumulate over iterations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesThe prompt text to optimize.
optimization_levelNo"light" removes obvious filler, "medium" restructures, "aggressive" rewrites minimally.medium
preserve_constraintsNoNever remove sentences with "never/must/always/do not".
output_formatNo"prose" for flowing text, "bullets" for a bulleted list.prose
modelNoUsed for token counting.gpt-4o

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

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

No annotations provided, so description carries full burden. It mentions preserving intent and typical savings, but lacks details on safety, rate limits, or side effects. The description of the model parameter indicates token counting, but overall limited behavioral disclosure.

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?

Two sentences: first states purpose, second gives usage context and typical savings. Concise and front-loaded with no fluff.

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?

With 5 parameters, good schema, and an output schema, the description is adequate but does not fully explain when to use this vs siblings like compress_context, nor the exact return format (though output schema exists).

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 description coverage is 100%, so baseline 3. The description adds minimal extra meaning beyond param descriptions; it provides context like 'run once' and typical savings, but most parameter info is in the schema.

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?

Description clearly states 'Shorten a verbose or redundant prompt/system prompt while preserving intent', using a specific verb ('shorten') and resource. It also provides typical savings (30–65%), distinguishing it from siblings like compress_context.

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

Usage Guidelines4/5

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

Explicitly says 'Run once on system prompts that accumulate over iterations', giving clear context. However, it does not mention when not to use or alternatives among siblings.

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/pozii/tokensaver'

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