Skip to main content
Glama

get_session_agent_tree

Read-onlyIdempotent

Retrieves the supervisor and sub-agent tree across all turns in a multi-turn session using parent-session lineage, closing the agent hierarchy when per-execution traces fall short.

Instructions

Agent tree of a session (by parent-session lineage): supervisor + sub-agents across all turns — works where per-execution traces can't close the tree in multi-turn sessions

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": {
      "session_id": "<session_id>"
    },
    "name": "get_session_agent_tree"
  }
}

Input Schema

NameRequiredDescriptionDefault
session_idYesAnchor session_id, usually the supervisor's session
execution_idNoOptionally restrict the tree to one execution

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.2.4
    • changedInput schema / properties / execution_id / description
      Previous value: -"Opcional: restringe a árvore a uma execução específica"New value: +"Optionally restrict the tree to one execution"
    • changedInput schema / properties / session_id / description
      Previous value: -"session_id da sessão âncora (a do supervisor)"New value: +"Anchor session_id, usually the supervisor's session"
  2. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive, and closed-world behavior. The description adds genuinely new context: the tree is resolved by parent-session lineage, spans all turns, and is the right choice when per-execution traces cannot close the tree. Return format and depth/size characteristics remain undescribed.

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?

A single dense sentence that front-loads the resource and scope. The bolded 'session' and em-dash aside are effective, though the final clause is slightly jargon-heavy and could be trimmed.

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?

With no output schema, the description does sketch the return shape (supervisor plus sub-agents across all turns), which is the key missing piece. Still absent are scale or ordering expectations and any indication of what happens when a session has no sub-agents, leaving it only adequate for a tree-traversal tool.

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 100%, with both session_id ('Anchor session_id, usually the supervisor's session') and execution_id fully documented in the schema. The description adds no syntax or semantics beyond that, so the baseline of 3 applies.

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 names the specific resource ('Agent tree of a session') and its composition ('supervisor + sub-agents across all turns'), which lets an agent distinguish it from per-execution trace tools. It lacks a leading verb and never names a concrete sibling such as get_agent_lineage, so differentiation is conceptual rather than explicit.

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 trailing clause 'works where per-execution traces can't close the tree in multi-turn sessions' implies when this tool is preferred, which is a real usage hint. However, there is no explicit when-not guidance and no named alternative, so the agent must infer the boundary from the sibling catalog.

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