Skip to main content
Glama

Get sessions

get_sessions
Read-onlyIdempotent

Sessions in range with calls, bytes and cost per session, plus the most recent ones. Counted by start time rather than summed per day, so a session crossing midnight stays one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoEnd date, inclusive, YYYY-MM-DD (UTC).
mcpYesThe MCP, by name or id. Names are matched case-insensitively; call list_mcps if unsure.
fromNoStart date, YYYY-MM-DD (UTC).
limitNoRecent sessions to return. Default 100.
clientsNoNarrow to these client names — `claude-desktop`, `cursor`, `unknown`. Omit for every client. Read the per-client split from get_overview first: one model failing where another succeeds is a tool-description problem, and the server-wide average is what hides it.
last_daysNoWindow ending today, in days — 7 for the last week, 30 for the last month. Ignored when from/to are given.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
rangeYesThe window these figures cover, echoed back.
totalsYes
sessionsYesThe most recent sessions, newest first. Counted by start time, so a session crossing midnight stays one.

Schema Changelog

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

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

The readOnly and idempotent annotations already cover side effects, so the description does not need to repeat that. It does disclose the counting rule (start time) and implies a default limit through the schema. No hidden side effects or pagination behavior is mentioned, but that's adequately handled by the output schema and parameter descriptions.

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?

The description is two sentences and reasonably concise. The first sentence is slightly awkward ('Sessions in range with calls, bytes and cost per session, plus the most recent ones') but conveys the essential idea without unnecessary fluff. It trades a small amount of clarity for brevity, which is acceptable.

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 presence of a complete output schema and per-parameter descriptions, the tool description provides enough context for an agent to invoke it correctly. It explains the counting semantics and hints at the recent-session feature. It does not explicitly specify sorting order (e.g., most recent first), but the 'limit' parameter description implies recency, so this is a minor omission.

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

Parameters4/5

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

The schema covers 100% of parameters with descriptions, so the baseline is 3. The tool description adds the key nuance that sessions are counted by start time, which affects interpretation of the date-range parameters (from, to, last_days). It also reinforces the 'clients' guidance already given in the schema. No parameter description conflicts with the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool returns sessions in a date range with per-session metrics (calls, bytes, cost) and mentions a 'most recent' aspect. It differentiates from aggregated tools like get_overview by emphasizing session-level detail and start-time counting, though 'Sessions in range' is slightly ambiguous about the exact response shape.

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 provides a direct usage hint for the 'clients' parameter, instructing the agent to read get_overview first to identify per-client splits. It also clarifies the counting semantics (by start time vs. per day), which helps distinguish this tool from day-summarizing alternatives. However, it does not explicitly contrast with get_usage or get_digest.

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.

Resources