Skip to main content
Glama
dambinhtu-nhuy

claude-code-session-mcp

Read one session in detail

session_stats
Read-only

Retrieve full stats for a single Claude Code session: duration, turns, prompts, subagent turns, damaged lines, and model token usage. Returns aggregated counts only, never message content.

Instructions

Full counts for a single session id: duration in seconds, turns, prompts, subagent turns, damaged lines, per-model token usage and the combined totals. Take the id from list_sessions. Returns counts only, never the text of any message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYesThe session id, which is the transcript filename without the .jsonl suffix.
Behavior4/5

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

Annotations already declare readOnlyHint=true, so the read-only nature is covered. The description adds valuable context that it returns counts only and never message text, clarifying privacy and data handling beyond the annotations. No contradiction with 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?

Two concise sentences pack all essential information: content of the return value, source for the parameter, and an explicit exclusion. There is no wasteful or repetitive text.

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 a simple one-parameter tool with no output schema, the description fully enumerates the return fields (duration, turns, prompts, token usage, etc.) and behavior. It is complete given the tool's complexity.

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% and the schema already explains session_id as a transcript filename without .jsonl. The description adds 'Take the id from list_sessions', which is extra guidance on how to obtain the correct value, raising it above the baseline of 3.

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 uses a specific verb ('Read') and identifies a unique resource ('one session') with a detailed list of what counts are included. It clearly distinguishes itself from list_sessions (which lists sessions) and tool_usage (broader usage stats).

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?

It instructs the agent to take the id from list_sessions, giving a direct prerequisite workflow. It also sets an explicit boundary by stating 'never the text of any message', helping the agent decide when not to use it. It doesn't explicitly name alternative tools for when not to use, but the guidance is clear.

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/dambinhtu-nhuy/claude-code-session-mcp'

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