Skip to main content
Glama

agent_lesson_add

Record a lesson learned during a run to prevent repeating failures. Recall it at next boot, with scope for session, agent, or workspace.

Instructions

Record a lesson learned during a run so the agent doesn't repeat the failure. Embedded for goal-relevant recall at the next agent_boot. Mirrors the vibe-loop '## Lessons' log. scope controls breadth: 'session' (this run), 'agent' (this agent always), or 'workspace'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
whyNoWhy it failed
scopeNoHow broadly the lesson applies (default 'session')
session_idYesSession this lesson came from
try_insteadNoWhat to do differently next time
what_failedYesWhat was attempted that failed

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.1

TDQS

A3.9/5.0
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 and does a decent job: it discloses the post-write behavior (embedded for goal-relevant recall at the next agent_boot) and unpacks the scope enum's effect ('session'/'agent'/'workspace'). It omits any dedup, overwrite, or permission behavior, but the core trait an agent needs is disclosed.

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?

Three front-loaded sentences that lead with the action and its payoff. The 'Mirrors the vibe-loop Lessons log' clause is mildly incidental jargon, but overall it is tight and well-ordered.

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?

For a write tool with no annotations and no output schema, the description covers purpose, timing, scope semantics, and downstream recall behavior. It leaves lifecycle details (overwrite, dedup, author attribution) unspecified, which is a minor gap rather than a blocking one.

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 schema already documents all five parameters. The description adds genuine meaning for scope's three breadth tiers, but says nothing about what_failed, why, try_instead, or session_id beyond the self-evident schema text. Baseline 3 is appropriate.

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?

States a specific verb and resource ('Record a lesson learned during a run') plus the outcome it serves ('so the agent doesn't repeat the failure'). An agent understands the intent immediately, though the description never explicitly separates this from the similarly-named ctx_remember sibling.

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?

Clear context: record a lesson after a run so it is recalled at the next agent_boot, with scope controlling breadth. It implies when to use it but names no exclusion or alternative, so it stops short of routing the agent away from ctx_remember or similar siblings.

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