Skip to main content
Glama
itential

Itential MCP Server

Official
by itential

Get Agent Session Token Usage

get_agent_session_token_usage
Read-onlyIdempotent

Retrieve per-session token usage for a specific agent, sorted chronologically. Optional time filters and inclusion of failed sessions provide detailed usage tracking.

Instructions

List per-session token usage for a single agent, sorted chronologically.

Fetches agent sessions filtered to the given agent name and returns one row per matching session (no aggregation), useful for time-series inspection of an agent's usage. Only COMPLETE sessions are included by default — see include_failed to also include FAILED sessions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_nameYesFilter to agent names containing this substring (case-insensitive)
started_afterNoISO 8601 timestamp — only include sessions started at or after this time
include_failedNoBy default only COMPLETE sessions count toward usage (finished, billable work). Set true to also include FAILED sessions, which can still have consumed real tokens. Non-terminal statuses (PENDING, RUNNING, PAUSED, ...) are always excluded either way, since their totals aren't final.
started_beforeNoISO 8601 timestamp — only include sessions started at or before this time

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYesResponse model for the per-session agent token usage endpoint. Wraps a list of AgentSessionTokenUsageElement objects for a single agent, sorted by started_at ascending. Attributes: root: List of AgentSessionTokenUsageElement objects with per-session token usage and timing metadata.
Behavior5/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, and the description adds substantial behavioral context: one row per session, chronological order, no aggregation, default inclusion of only COMPLETE sessions, and clarify that 'include_failed' extends to FAILED sessions while non-terminal statuses are always excluded. This covers key edge cases without contradicting any 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?

The description is three sentences, with the core purpose front-loaded in the first sentence. The second sentence expands with scope and use case, and the third addresses the key filtering behavior. Every word earns its place, and the structure flows naturally.

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?

Given the rich schema, clear annotations, and the presence of an output schema, the description fully covers what an agent needs to select the tool and understand its data scope. It explains the per-session granularity, filtering default, inclusion of failed sessions, and non-terminal exclusion, leaving no significant gaps.

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%, and each parameter (agent_name, started_after, include_failed, started_before) already has a thorough description covering substring matching, ISO timestamps, defaults, and semantics. The tool description only references include_failed conceptually and adds no new parameter-level information beyond the schema, so the baseline of 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 'List per-session token usage for a single agent' — a specific verb and resource, and explicitly notes 'no aggregation', which distinguishes it from sibling tools like get_agent_token_usage that likely aggregate. It also states 'sorted chronologically', further clarifying the exact nature of the result.

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 clearly situates the tool's use case: 'useful for time-series inspection of an agent's usage.' It also conveys that this is the per-session variant, implying aggregated alternatives exist. It doesn't explicitly name an alternative or state when not to use it, but the context is strong enough for an agent to choose correctly.

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/itential/itential-mcp'

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