Skip to main content
Glama

write_reflexion

Records agent run reflections including successes, improvement areas, missing context, and tool needs. Entries are reviewed weekly for self-improvement proposals.

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
Behavior3/5

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

No annotations are provided, so the description must carry the full burden. It explains that entries are reviewed for self-improvement, but does not disclose side effects, auth requirements, or whether it overwrites entries. For a read-like write operation, it is minimally 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 structured clearly with a title line, a usage paragraph followed by a parameter list. It is concise (approx. 100 words), front-loads the purpose, and has no redundant sentences.

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?

Given the 6 parameters (2 required) and presence of an output schema, the description covers purpose, usage timing, and parameter semantics. It provides adequate context for an AI agent to invoke the tool correctly, though it omits the return value format (covered by output schema).

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%, but the tool description provides detailed parameter explanations (e.g., 'went_well: What went well in this run (1-2 sentences)'). This adds significant meaning beyond the schema titles and required list.

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 action: 'Record an agent self-critique entry to the reflexion_log.' It specifies the stage (Stage 11) and the context (end of every agent run). This distinguishes it from similar tools like log_agent_run.

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 'Called at the end of every agent run to capture experience' and mentions the weekly Coach loop review. It provides clear context but does not contrast with siblings like aggregate_reflexions_tool or log_agent_run.

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_PH'

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