Skip to main content
Glama
DCx7C5

token-optimization-mcp

by DCx7C5

analyze_context

Analyze chat message token usage to detect bloated prompts, near-full context, and repeated content, returning per-role breakdowns and recommendations.

Instructions

Analyze a list of chat messages ({role, content}) for token usage and issues. Detects bloated system prompts, near-full context windows, and repeated content. Returns per-role breakdown, issues list, and recommendations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNogpt-4o
messagesYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It discloses the analysis outputs (per-role breakdown, issues, recommendations), which adds transparency, but it does not explicitly state whether the tool is read-only or has any side effects. Given typical analysis tools, a score of 3 is adequate but not excellent.

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 concise at three sentences, with the most critical information front-loaded. Every sentence adds value: the first states the action, the second lists specific detections, and the third describes the output. No unnecessary fluff.

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 tool's moderate complexity and the presence of an output schema, the description covers the main functionality well. It does not mention potential limitations like maximum message count or rate limits, but overall it provides sufficient context for an agent to understand when and how to use the tool.

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

Parameters2/5

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

The input schema has 0% description coverage, so the description must compensate. It mentions messages have role and content, which adds some meaning, but it does not describe the 'model' parameter or clarify the structure of messages beyond 'chat messages'. This leaves the agent unclear about parameter formats.

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: analyzing chat messages for token usage and issues such as bloated system prompts, near-full context windows, and repeated content. It distinguishes itself from sibling tools like estimate_tokens (simple token counting) and compress_prompt (compression) by offering a comprehensive analysis with specific detections.

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 does not provide guidance on when to use this tool versus alternatives like estimate_tokens or compress_prompt. Without explicit when-to-use or when-not-to-use instructions, an AI agent may struggle to select the most appropriate tool from the sibling set.

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/DCx7C5/token-optimization-mcp'

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