Skip to main content
Glama

get_session_analytics

Read-onlyIdempotent

Analyze AI agent session logs to reveal token usage, cost breakdown by tool/server, top files, and models used. Parses Claude Code JSONL logs automatically for read-only session insights.

Instructions

Analyze AI agent session logs: token usage, cost breakdown by tool/server, top files, models used. Parses Claude Code JSONL logs automatically. Read-only. For waste detection use get_optimization_report; for cost trends use get_usage_trends. Returns JSON: { sessions, tokens, cost_usd, tools, models, topFiles }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodNoTime period (default: week)
session_idYesSpecific session ID to analyze

Schema Changelog

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

  1. Changed1 schema field changedv3.3.0
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
  2. Addedv1.41.0
  3. Removedv1.38.0
  4. Changed2 schema fields changedv1.35.1
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / required
      Added value: +[
      +  "session_id"
      +]
  5. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already cover read-only and idempotent behavior, and the description reinforces that with 'Read-only.' It adds context beyond the annotations by disclosing that it parses Claude Code JSONL logs automatically and by specifying the exact returned JSON keys, which is useful since there is no output schema.

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 compact and well-organized: purpose, input-format behavior, safety clarification, routing to siblings, and return shape. Each sentence earns its place, and the most important scope is front-loaded before the routing and return details.

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 read-only, two-parameter tool with a fully documented schema and helpful annotations, the description supplies all remaining contextual essentials: JSON output shape, automatic log parsing, and sibling routing. Nothing needed for correct invocation is missing.

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%, so the parameter meaning is fully documented in the input schema for both session_id and period. The description mentions analysis dimensions and output fields but does not add parameter-specific semantics beyond what the schema already provides, 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 a specific verb and resource: 'Analyze AI agent session logs' and then lists concrete outputs (token usage, cost breakdown by tool/server, top files, models). It also distinguishes itself from sibling tools by directing waste detection to get_optimization_report and cost trends to get_usage_trends.

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?

Explicitly names alternatives and when they should be preferred over this tool: 'For waste detection use get_optimization_report; for cost trends use get_usage_trends.' This gives an agent routing guidance rather than leaving the choice to inference.

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

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/nikolai-vysotskyi/trace-mcp'

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