Skip to main content
Glama

Compare Time Windows

compare_time_windows
Read-onlyIdempotent

Compare LLM usage metrics between two time windows to identify changes in request and token counts, such as week-over-week trends or before/after a deployment.

Instructions

Compare aggregated LLM usage metrics between two time windows.

Runs the same usage aggregation for both ranges and returns the delta - useful for "this week vs last week" or "before/after a deploy" style comparisons of request/token counts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of traces to analyze per range (default: 1000)
range_a_endNoRange A end time in ISO 8601 format
range_b_endNoRange B end time in ISO 8601 format
service_nameNoFilter by service name (applied to both ranges)
gen_ai_systemNoFilter by LLM provider (applied to both ranges)
range_a_startNoRange A start time in ISO 8601 format
range_b_startNoRange B start time in ISO 8601 format
gen_ai_request_modelNoFilter by requested model name (applied to both ranges)
gen_ai_response_modelNoFilter by actual model used (applied to both ranges)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv0.11.0
    • addedInput schema / properties / gen_ai_request_model / description
      Added value: +"Filter by requested model name (applied to both ranges)"
    • addedInput schema / properties / gen_ai_response_model / description
      Added value: +"Filter by actual model used (applied to both ranges)"
    • addedInput schema / properties / gen_ai_system / description
      Added value: +"Filter by LLM provider (applied to both ranges)"
    • addedInput schema / properties / limit / description
      Added value: +"Maximum number of traces to analyze per range (default: 1000)"
    • addedInput schema / properties / range_a_end / description
      Added value: +"Range A end time in ISO 8601 format"
    • addedInput schema / properties / range_a_start / description
      Added value: +"Range A start time in ISO 8601 format"
    • addedInput schema / properties / range_b_end / description
      Added value: +"Range B end time in ISO 8601 format"
    • addedInput schema / properties / range_b_start / description
      Added value: +"Range B start time in ISO 8601 format"
    • addedInput schema / properties / service_name / description
      Added value: +"Filter by service name (applied to both ranges)"
  2. Addedv0.5.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already establish the tool as read-only, idempotent, and non-destructive. The description adds the key behavioral fact that both ranges run through the same aggregation and the result is a delta. It leaves default behavior for null range boundaries unspecified, but it still meaningfully exceeds what annotations alone convey.

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 compact and front-loaded: it states the purpose first, then the mechanics, then concrete use cases. Every sentence earns its place with no redundant filler.

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?

The tool has 9 optional parameters, and the description does not specify the sign/direction of the delta (range A minus range B vs. range B minus range A) or what happens when range boundaries are left null. The schema and output schema cover structure, but these ambiguities could prevent a correct first call.

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 the baseline is 3. The description reinforces that the same aggregation is applied to both ranges and that filters apply to both, but it adds no parameter-level detail beyond what the schema already documents.

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 states a specific verb and resource: 'Compare aggregated LLM usage metrics between two time windows.' It also names the unique outcome, returning a delta, which clearly differentiates it from single-window siblings like get_llm_usage.

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?

The description gives concrete use cases: 'this week vs last week' and 'before/after a deploy.' It does not explicitly name alternative tools or state when not to use this tool, but the provided context is clear enough for an agent to select it appropriately.

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