Skip to main content
Glama

get_session

Retrieve chronological summaries of LLM calls in an agent session, with status, tokens, cost, latency, and tool names. Optionally include full message bodies for detailed review.

Instructions

Retrieve the LLM calls of an agent session in chronological order. By default each call is a compact summary (index, model, status, error reason, tokens, cost, latency, tool names, sizes) — sessions can be megabytes, so full prompt/response bodies are returned only with include_messages=true, and single calls are better fetched via the explain tool using the action_id from a summary row.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYesThe session ID passed via x-agenticledger-session-id.
include_messagesNoReturn full message bodies for every call. Default false; can be very large.
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses the default summary format (fields like model, status, tokens, cost), the size implication ('sessions can be megabytes'), and the effect of include_messages. It doesn't explicitly state absence of side effects, but 'Retrieve' strongly implies a read operation.

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 a single, dense sentence that front-loads the core purpose, then packs valuable caveats and alternatives without fluff. Every phrase earns its place, and the em-dash structure improves readability.

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 lack of an output schema, the description compensates by enumerating summary fields and the condition for full bodies. It also addresses size concerns and directs to explain for individual calls, making the tool's behavior clear enough for an agent to invoke correctly.

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?

Schema coverage is 100%, so the baseline is 3. The description adds value by explaining why include_messages defaults to false (session size) and what the summary contains, which complements the schema's boolean description. It reinforces the session_id's source but doesn't introduce conflicting semantics.

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 starts with a specific verb-resource pair: 'Retrieve the LLM calls of an agent session' and adds 'in chronological order,' which clearly scopes the operation. It distinguishes from siblings by contrasting with the explain tool for single calls and implying list_sessions for session listing.

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?

The description explicitly states when to use a different tool: 'single calls are better fetched via the explain tool using the action_id from a summary row.' It also provides usage context for the include_messages parameter, warning about large payloads and explaining the default compact summary.

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/ShekharBhardwaj/AgenticLedger'

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