Skip to main content
Glama

List Sessions

list_sessions
Read-onlyIdempotent

List AI conversation sessions grouped by ID, showing span counts, token usage, and time bounds to analyze multi-turn activity. Filter by time, service, or LLM provider.

Instructions

List conversations/sessions grouped by gen_ai.conversation.id.

Groups spans that carry the gen_ai.conversation.id attribute (a real, cross-industry OTel semantic convention for session/conversation grouping) to surface per-conversation span counts, token usage, and time bounds - useful for understanding multi-turn conversation activity.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum spans to analyze (default: 1000)
end_timeNoEnd time in ISO 8601 format
start_timeNoStart time in ISO 8601 format (e.g., 2024-01-01T00:00:00Z)
service_nameNoFilter by service name
gen_ai_systemNoFilter by LLM provider (openai, anthropic, etc.)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
countYes
messageNo
sessionsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.11.0
    • addedInput schema / properties / end_time / description
      Added value: +"End time in ISO 8601 format"
    • addedInput schema / properties / gen_ai_system / description
      Added value: +"Filter by LLM provider (openai, anthropic, etc.)"
    • addedInput schema / properties / limit / description
      Added value: +"Maximum spans to analyze (default: 1000)"
    • addedInput schema / properties / service_name / description
      Added value: +"Filter by service name"
    • addedInput schema / properties / start_time / description
      Added value: +"Start time in ISO 8601 format (e.g., 2024-01-01T00:00:00Z)"
  2. Addedv0.5.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false. The description adds meaningful behavioral context by explaining the grouping mechanism, the OTel semantic convention, and the per-conversation metrics produced. 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 with the primary action front-loaded. The OTel convention explanation earns its place by clarifying why this attribute is meaningful, and there is no redundant restatement of the schema.

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

Completeness4/5

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

With fully documented parameters, rich annotations, and an output schema, the description is nearly complete. It clearly explains the grouping key and intended use case; a brief cross-reference to get_session_stats would make it fully complete.

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 schema already documents all five parameters. The description adds no parameter-specific meaning beyond identifying the grouping key, so the baseline 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?

States a specific action and resource: list conversations/sessions grouped by gen_ai.conversation.id, and specifies the surfaced outputs (span counts, token usage, time bounds). This clearly distinguishes it from trace- and span-oriented sibling tools.

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?

The description says it is 'useful for understanding multi-turn conversation activity,' which implies when to use it, but it does not name alternatives or state when not to use it (e.g., versus get_session_stats). Guidance is present but only implied.

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