Skip to main content
Glama

Time buckets for charts

time_buckets
Read-onlyIdempotent

Split a time range into minute, hour, day, week, month, quarter or year buckets with exact start and end times in a time zone. DST-aware (23- and 25-hour days, repeated and skipped hours), ISO or Sunday/Saturday weeks, fiscal quarters, partial first and last buckets flagged or clipped. Up to 1,000 buckets (500 for weeks and longer). Use for chart axes, time-series grouping and filling empty periods in dashboards. First 25 calls per day are free, then $0.001 per call (x402).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "from": "<from>",
      "to": "<to>"
    },
    "name": "time_buckets"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYesRange end, exclusive (same formats)
clipNoClip the first and last buckets to [from, to) instead of returning whole buckets flagged partial
fromYesRange start: YYYY-MM-DD (local midnight), local YYYY-MM-DDTHH:MM, or ISO 8601 with offset. Years 1000–9999
sizeNominute: 1,2,3,4,5,6,10,12,15,20,30; hour: 1,2,3,4,6,8,12. Other buckets: 1
bucketNoPlurals and daily/weekly/monthly also workday
timezoneNoIANA time zone, e.g. America/New_York (default UTC)
week_startNoFirst day of the week. monday = ISO weeks (labels like 2026-W46)monday
fiscal_year_startNoMonth the fiscal year starts (1 = January). Quarters, halves and years follow it; fiscal years are named by the calendar year they end in (start 7: FY2027 = July 2026 – June 2027)

Output Schema

NameRequiredDescriptionDefault
toYes
fromYes
sizeYes
countYes
bucketYes
bucketsYes
timezoneYes
week_startNo
fiscal_year_startNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / bucket / description
      Added value: +"Plurals and daily/weekly/monthly also work"
    • changedInput schema / properties / from / description
      Previous value: -"Range start: YYYY-MM-DD (local midnight), local YYYY-MM-DDTHH:MM, or ISO 8601 with offset"New value: +"Range start: YYYY-MM-DD (local midnight), local YYYY-MM-DDTHH:MM, or ISO 8601 with offset. Years 1000–9999"
  2. Added

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already cover the safety profile (readOnly, idempotent, closed-world), but the description still adds real behavioral detail: DST edge cases, partial-bucket flagging vs clipping, bucket caps (1,000 / 500), and a rate limit plus x402 pricing. It does not describe the response shape, though an output schema exists.

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?

Four tight sentences, front-loaded with what the tool produces, then edge-case semantics, then limits, then pricing. No filler; each sentence carries distinct information.

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 an eight-parameter bucketing tool, it covers the full behavior needed to call it correctly: granularity, time zone, week and fiscal conventions, clipping, caps, and cost. Return values are covered by the output schema, so their absence from the description is not a gap.

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%, so all eight parameters are already documented, and the description mostly restates what the schema covers (ISO vs Sunday weeks, fiscal quarters). Its only added meaning is that partial edge buckets are flagged by default, which explains the purpose of the clip parameter.

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?

States a concrete verb (split a time range) plus the exact bucket granularities and time-zone semantics, which is far more specific than the title alone. It also implicitly distinguishes itself from plain range-listing siblings by emphasizing bucketing/aggregation for chart axes.

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?

Gives clear intended use cases: chart axes, time-series grouping, and filling empty periods in dashboards. It does not say when not to use it or point to a specific alternative for plain ranges, so it stops short of full routing guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.