Skip to main content
Glama

analyze_sessions

Analyze coding-agent sessions to track active time, tokens, tool mix, failing commands, edited files, and friction like retry loops or interruptions. Compare agents on shared topics.

Instructions

Analyze your coding-agent sessions: active time, tokens, tool mix, top and failing commands, most edited files, friction (retry loops, corrections, interrupts, rejected tool calls, compactions) and a directional comparison of agents on shared topics.

project: limit to one repository (omit for all projects). group_by: project | source | day | model.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "analyze_sessions"
  }
}

Input Schema

NameRequiredDescriptionDefault
projectNo
sourcesNoall
group_byNoproject
days_backNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description must carry the full behavioral burden. Naming the metrics and friction categories (retry loops, corrections, interrupts, rejected tool calls, compactions) tells the agent what the analysis surfaces, which is genuinely useful. But it never states that the operation is read-only/non-mutating, nor anything about latency, data scope retention, or cost on large histories, so the agent has no explicit confirmation of side-effect safety.

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 output surface is front-loaded in one dense sentence, then the two parameters that need explanation are listed compactly. No filler, no restatement of the name, and the scoping rule is stated where the agent will look for it.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so the description rightly does not explain return values. The metric enumeration is proportionate to the tool's complexity. The gap is the two unexplained parameters ('sources', 'days_back') and the absence of any routing guidance among the many sibling session tools, which leaves the agent guessing on scope and alternatives.

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 0%, so the description must compensate. It does define 'project' (limit to one repository, omit for all) and, importantly, supplies the enum for 'group_by' (project | source | day | model) that the schema leaves as a free string with only a default. However, 'sources' and 'days_back' — including their defaults ('all' and 30) and accepted formats — are undocumented in both schema and description.

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 gives a specific verb ('Analyze') and resource ('coding-agent sessions') and enumerates the dimensions produced: active time, tokens, tool mix, top/failing commands, edited files, friction signals and a directional agent comparison. That is far more informative than the bare name. It stops short of drawing a bright line against the overlapping sibling compare_sessions, whose territory the 'directional comparison of agents' clause partially enters.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: it is an analytics/rollup tool, and the 'project: limit to one repository (omit for all projects)' note gives a scoping rule. There is no explicit 'use this instead of compare_sessions / list_sessions / get_session' guidance, and no stated prerequisites or cost warnings for an analysis that likely scans a large history.

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