Skip to main content
Glama

write_reflexion

Record an agent's self-critique after each run to capture successes, improvement areas, missing context, and tool needs, enabling continuous learning and self-improvement.

Instructions

Stage 11: Record an agent self-critique entry to the reflexion_log.

Called at the end of every agent run to capture experience: what worked,
what could be better, what context was missing, what tools were needed.
Entries are reviewed by the weekly Coach loop for self-improvement proposals.

Args:
    session_id: Pipeline session ID from session_bootstrap().
    agent_slug: Which agent is writing the reflexion (e.g. 'librarian').
    went_well: What went well in this run (1–2 sentences).
    could_improve: What could have been done better (1–2 sentences).
    missing_context: What context or data was unavailable but needed.
    tool_wishes: Tools or capabilities that would have helped.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYes
agent_slugYes
went_wellNo
could_improveNo
missing_contextNo
tool_wishesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool writes to a log and is part of a pipeline, which is sufficient for a simple write operation. It does not detail side effects like mutability, but it is adequate.

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 concise and well-structured: a header, a brief contextual paragraph, and a list of parameter definitions. Every sentence adds value without waste.

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?

Given the tool has 6 parameters (2 required), no annotations, and an output schema, the description fully covers purpose, usage, and parameters. The output schema is provided separately, so the description does not need to explain return values.

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?

The description provides meaningful explanations for all six parameters, including examples (e.g., 'agent_slug: e.g. librarian') and sources (e.g., 'session_id from session_bootstrap()'). This goes well beyond the bare schema titles, which have 0% coverage.

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 clearly states the verb 'Record' and the resource 'reflexion_log', and explains that it captures agent self-critique. This distinguishes it from siblings like 'add_journal_entry' and 'add_memory_entry' by specifying that it is for self-critique and reviewed by the Coach loop.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says it is 'Called at the end of every agent run' and that entries are reviewed weekly, providing clear context. However, it does not explicitly exclude alternatives or mention when not to use the tool.

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/SVerITG/Metis'

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