Skip to main content
Glama

brain_learn

Save durable lessons, architecture decisions, bug root-causes, and team conventions with automatic attribution, deduplication, contradiction detection, and supersession tracking for future recall.

Instructions

Store a new durable lesson, architecture decision, bug root-cause, or team convention. Includes automatic multi-agent attribution, quality evaluation, deduplication, contradiction detection, and supersession tracking. Examples: "Never use RS256 in dev", "JWT refresh token expires in 7d; rotate on each use".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agentNoOptional: agent name creating this memory (e.g. "claude-code", "cursor", "antigravity"). Auto-detected if omitted.
filesNoOptional: array of related files.
lessonYesThe lesson, rule, or decision to remember. Be specific and actionable.
categoryNoCategory for this memory.manual
file_pathNoOptional: the primary file this lesson applies to.
confidenceNoConfidence rating from 0.0 to 1.0 (default: 1.0).
importanceNoImportance multiplier from 0.1 to 2.0 (default: 1.0).
supersedes_idNoOptional: ID of an older memory that is superseded/replaced by this new lesson.
importance_levelNoOptional: importance level (default: automatically detected from content).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.3.1
    • addedInput schema / properties / agent
      Added value: +{
      +  "description": "Optional: agent name creating this memory (e.g. \"claude-code\", \"cursor\", \"antigravity\"). Auto-detected if omitted.",
      +  "type": "string"
      +}
    • addedInput schema / properties / importance_level
      Added value: +{
      +  "description": "Optional: importance level (default: automatically detected from content).",
      +  "enum": [
      +    "low",
      +    "medium",
      +    "high",
      +    "critical"
      +  ],
      +  "type": "string"
      +}
  2. First observedv1.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations (which only show non-read-only, non-idempotent, non-destructive), the description discloses automatic behaviors: 'multi-agent attribution, quality evaluation, deduplication, contradiction detection, and supersession tracking.' This tells the agent that the store is not a simple write and that the system will process, reconcile, and potentially supersede existing memories. This is exactly the kind of behavioral context the description should add.

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 compact and well-structured: one sentence defines the tool's scope, one sentence lists its automatic behaviors, and two examples illustrate ideal input. Every sentence earns its place, and the most important information comes first.

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 tool with 9 parameters but only 1 required, full schema coverage, and no output schema, the description covers the core write intent and automatic post-processing behaviors well. It doesn't describe return values or failure modes, but the absence of an output schema lowers the burden. The main gap is not explaining how this relates to sibling tools like brain_validate or brain_trace, but the description is otherwise sufficient for correct use.

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

Parameters4/5

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

The schema already covers all parameters at 100% with descriptions, so the baseline is 3. The description adds value by showing examples of high-quality lesson strings ('Never use RS256 in dev', 'JWT refresh token expires in 7d; rotate on each use') and advising 'Be specific and actionable,' which clarifies the expected semantic quality of the required lesson parameter. This pushes it above baseline.

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 immediately states a specific action and resource: 'Store a new durable lesson, architecture decision, bug root-cause, or team convention.' It clearly enumerates the kinds of content accepted and gives concrete examples, making the tool's role unmistakable and naturally distinct from siblings like brain_recall, brain_prune, and brain_forget.

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 provides clear context: use this tool when you want to persist a lesson or decision. It lists valid content categories and gives examples of good lessons, which helps the agent judge appropriateness. It does not explicitly name alternatives or state when not to use the tool, so it falls slightly short of a 5.

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