Skip to main content
Glama

plan

Retrieves normalized agent plan histories, grouping by task and distinguishing final/draft revisions with user feedback.

Instructions

Normalized plan atoms for a session — final vs drafts, grouped by task.

Wraps query(type="plan_event", …) and normalizes every agent's plan signal (Claude ExitPlanMode / Write plans/*.md, Codex update_plan, Antigravity implementation_plan.md) into a single :class:~ai_r.events.Plan shape — the per-agent signal is an internal detail, never surfaced.

Plans are grouped by task keyed on each plan's task_key — the plan-file slug when the agent has one (Claude plans/<slug>.md, Antigravity implementation_plan.md path), falling back to the normalized title only when no plan file exists (Codex update_plan). Within a task the latest plan is final and earlier revisions are draft; plans of earlier completed tasks are completed_major.

F3.4 default schema (measured ≈×3.7 cheaper than "everything inlined"): the final plan's full text is inlined (body + body_source"approval_edited_by_user" when the user's approval carried an edited plan, which is the AUTHORITATIVE text and overrides the signal/file body, else "plan_signal"); drafts stay references (bodies via get_body); every «plan quote → user comment» pair extracted from the user's plan responses is returned under feedback, each with a ref ("<session>:pf<N>") that get_body resolves to the FULL raw response. Only agents with an interactive plan-approval flow have the feedback signal (today: Claude — an ExitPlanMode verdict or a rejected plan-file Write); others honestly contribute nothing. Technical failures and bare no-comment rejections are filtered out.

F3.4 v2 additions: every plan atom carries version — its 1-based revision number within the task group, chronological (drafts are v1…vN-1, the final is vN); every feedback pair carries plan_version (the answered revision's number), round (1-based feedback-round number within the session — one round per user response that produced pairs) and section — the heading of the plan section the quote anchors to. Quotes are selected from the RENDERED plan, so the anchor match strips markdown markup from both sides; a quote that matches no section — or more than one — gets an honest null anchor, never a nearest guess.

Args: session: Restrict to one session uuid (recommended). kind: Optional filter — draft | final | completed_major. group: Grouping strategy; only "task" is supported. agent: Optional agent filter (claude/codex/opencode/antigravity/pi). redact: When True (default) secrets in the emitted plan/feedback fields (title/steps/body/quote/comment…) are masked as [REDACTED_<TYPE>] and the response carries a redactions type→count dict when any replacement happened; False returns raw content. bodies: "final" (default) inlines the final plan's full text; "none" returns reference-only atoms. feedback: True (default) adds the feedback pair list + feedback_count; False omits both (historical shape). rounds: "all" (default) returns every feedback round; "last" keeps only each session's final round (v2). Any other value fails loud.

Returns: {"plans": [...], "count": N, "feedback": [...], "feedback_count": M} — each plan carries id/session_id/agent/title/task_id/kind/version/path/steps/status/ refs/sha256 (+ body/body_source on the final when bodies="final"); each feedback pair carries session_id/agent/plan_id/plan_version/verdict/round/quote/comment/ section/ref/ts (verdictrejected | stay_in_plan_mode; quote is null for a free-text comment; plan_version/ section are null without a signal). Draft bodies and raw responses stay on-demand via :func:get_body. Standard {"error": ..., "message": ...} dict on invalid arguments.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindNo
agentNo
groupNotask
bodiesNofinal
redactNo
roundsNoall
sessionNo
feedbackNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations, the description fully discloses behavioral traits: normalization of signals from different agents, grouping logic, versioning, redaction defaults, filtering of technical failures, and the precise semantics of feedback anchors ('never a nearest guess'). It also explains what output to expect and how parameters change behavior.

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 long but exceptionally well-structured: an introductory summary, followed by detailed schema explanations, then parameter and return specifications. Every sentence adds substantive information, and the structure makes it easy to navigate. It is front-loaded with the core purpose.

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 tool with 8 parameters, an output schema, and complex normalization logic, the description is exhaustive. It covers all input options, output structure, edge cases, and internal behaviors, leaving no ambiguity. The presence of an output schema doesn't reduce the need for this detail, and the description provides it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the full burden. The 'Args' section explains every parameter (session, kind, group, agent, redact, bodies, feedback, rounds) with defaults, allowed values, and behavioral effects, fully compensating for the bare schema.

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 states the exact function: 'Normalized plan atoms for a session — final vs drafts, grouped by task.' It clearly identifies the resource (plan events) and the action (normalization), and distinguishes itself from siblings like get_body (draft bodies on demand) and query (the underlying raw call).

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?

The description explicitly states when to use it (to get normalized plan data grouped by task) and references alternatives: it 'wraps query(type=...)' and notes that 'Draft bodies and raw responses stay on-demand via get_body.' It also provides parameter-level guidance (e.g., 'session: Restrict to one session uuid (recommended)') and explains the behavior of edge cases like 'rounds' failing loud.

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

Install Server

Other Tools

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/pro-target/ai-r'

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