Skip to main content
Glama

get_optimization_report

Read-onlyIdempotent

Detect token-wasting patterns in AI agent sessions—repeated reads, grep searches, oversized file access, unused tools—and receive estimated savings to optimize costs.

Instructions

Detect token waste patterns in AI agent sessions: repeated file reads, Bash grep instead of search, large file reads, unused trace-mcp tools. Provides savings estimates. Read-only. For usage/cost overview use get_session_analytics; for A/B savings comparison use get_real_savings. Returns JSON: { patterns: [{ type, description, savings_estimate }], total_waste }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodNoTime period (default: week)

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changedv3.3.0
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
  2. Addedv1.41.0
  3. Removedv1.38.0
  4. Changed1 schema field changedv1.35.1
    • removedInput schema / additionalProperties
      Removed value: -false
  5. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, so the safety type is covered. The description adds value beyond annotations by describing the JSON return format ({ patterns: [{ type, description, savings_estimate }], total_waste }) and stating it 'Provides savings estimates.' No contradiction with annotations.

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 sentences, each earning its place: the first names specific waste patterns, the second covers read-only safety and savings estimates, the third gives the return shape and sibling routing. No filler or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-optional-parameter tool with no output schema, the description provides the return JSON structure, the tool's scope, and explicit sibling alternatives. Nothing needed to invoke it correctly is missing.

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?

The input schema covers 100% of the single parameter, including enum values and default. The description does not add any parameter-level detail, so the schema carries the full burden. Baseline 3 applies.

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 opens with a specific verb and resource: 'Detect token waste patterns in AI agent sessions,' then lists concrete pattern types (repeated file reads, Bash grep instead of search, large file reads, unused trace-mcp tools). It also provides the return shape and distinguishes itself from siblings by naming their use cases.

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?

Explicitly routes to alternatives with conditions: 'For usage/cost overview use get_session_analytics; for A/B savings comparison use get_real_savings.' This tells the agent when not to use this tool and which sibling to pick instead.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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/nikolai-vysotskyi/trace-mcp'

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