Skip to main content
Glama

list_agent_sessions

Read-onlyIdempotent

Retrieve an agent's recent conversations, newest first, with active or archived status and pagination. Use filters for roots, consumer, and control mode to review sessions.

Instructions

List recent conversations with an agent, newest first; status selects active (default) or archived sessions. Members see their own sessions; operators see tenant sessions. message_count and last_message_preview cover up to 50 recent messages, while total counts all matching sessions. offset must be a multiple of limit.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "agent_id": "<agent_id>"
    },
    "name": "list_agent_sessions"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum results; defaults to 20, maximum 100
offsetNoPagination offset; must be a multiple of limit
statusNoConversation status: active (default) or archived
agent_idYesAgent UUID
roots_onlyNotrue returns root sessions only, excluding sub-agent sessions
consumer_keyNoFilter sessions by consumer identity
control_modeNoFilter by session control mode

Output Schema

NameRequiredDescriptionDefault
totalNo
successNo
sessionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv2.2.4
    • changedInput schema / properties / agent_id / description
      Previous value: -"UUID do agente"New value: +"Agent UUID"
    • changedInput schema / properties / consumer_key / description
      Previous value: -"Filtra pelas sessões de um consumidor específico"New value: +"Filter sessions by consumer identity"
    • changedInput schema / properties / control_mode / description
      Previous value: -"Filtra por modo de controle da sessão (Sprint 72)"New value: +"Filter by session control mode"
    • changedInput schema / properties / limit / description
      Previous value: -"Limite de resultados (default: 20, max: 100)"New value: +"Maximum results; defaults to 20, maximum 100"
    • changedInput schema / properties / offset / description
      Previous value: -"Offset para paginação (múltiplo de limit)"New value: +"Pagination offset; must be a multiple of limit"
    • changedInput schema / properties / roots_only / description
      Previous value: -"true = só sessões raiz (exclui sessões de subagentes, #227)"New value: +"true returns root sessions only, excluding sub-agent sessions"
    • addedInput schema / properties / status
      Added value: +{
      +  "description": "Conversation status: active (default) or archived",
      +  "enum": [
      +    "active",
      +    "archived"
      +  ],
      +  "type": "string"
      +}
  2. Changed2 schema fields changedv2.2.3
    • changedInput schema / properties / offset / description
      Previous value: -"Offset para paginação"New value: +"Offset para paginação (múltiplo de limit)"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "anyOf": [
      +    {
      +      "required": [
      +        "success",
      +        "sessions"
      +      ]
      +    },
      +    {
      +      "properties": {
      +        "error": {
      +          "additionalProperties": true,
      +          "properties": {
      +            "code": {
      +              "type": "string"
      +            },
      +            "message": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "code",
      +            "message"
      +          ],
      +          "type": "object"
      +        },
      +        "success": {
      +          "const": false
      +        }
      +      },
      +      "required": [
      +        "success",
      +        "error"
      +      ],
      +      "type": "object"
      +    }
      +  ],
      +  "properties": {
      +    "sessions": {
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "success": {
      +      "type": "boolean"
      +    },
      +    "total": {
      +      "type": "integer"
      +    }
      +  },
      +  "type": "object"
      +}
  3. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so the bar is lower, and the description still adds real behavior: result ordering, caller-dependent visibility scoping, and the fact that message_count and last_message_preview only cover up to 50 recent messages while total counts all matches. It stops short of describing pagination mechanics or the response envelope, but that is largely covered by the 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is a short, front-loaded block with no filler sentences, and the most decision-relevant facts (ordering, status default, visibility) come first. The semicolon-chained packing makes it dense but it remains readable and every clause carries information.

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 rich annotations, full schema coverage and an output schema, the definition is close to complete: an agent knows ordering, default status, scope by caller role, and the 50-message truncation caveat. The remaining gap is the absence of routing guidance versus sibling session-listing tools, which matters given how many list_* siblings exist.

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 baseline is 3. The description's parameter-related statements ('status selects active (default) or archived', 'offset must be a multiple of limit') largely restate what the schema already says; the more valuable clarifications (message_count, last_message_preview, total) concern output fields rather than the inputs, and roots_only, consumer_key and control_mode receive no elaboration in the 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 opens with a specific verb and resource ('List recent conversations with an agent, newest first'), which immediately tells an agent what it returns and in what order. It does not, however, distinguish itself from the closely named sibling list_consumer_sessions, so an agent still has to reason about which listing tool applies to a consumer-scoped request.

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?

Useful context is given: status defaults to active, and 'Members see their own sessions; operators see tenant sessions' tells the caller what scope they will actually get. What is missing is explicit when-to-use/when-not guidance against the sibling listing tools (e.g. list_consumer_sessions), so the selection decision is left implied.

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

Deploy Server

Other Tools