Skip to main content
Glama

Save to Brain

brain_save

Saves decisions, bug fixes, patterns, and lessons to a local knowledge base so future agents can recall context; use state_key to replace outdated current-value facts.

Instructions

Save a decision, bug fix, pattern, or lesson to a local knowledge base. Call this whenever you make a decision, fix a bug, learn something non-obvious, or the user corrects you. Write the content for a future agent with zero context about this session. Use state_key for current-value facts so a later save replaces the earlier value.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "content": "<content>"
    },
    "name": "brain_save"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagsNoTags: an array, or a comma-separated string
titleNoShort title, max 60 chars. When omitted, the content's first line becomes the title
contentYesThe full note. Write for a future agent with zero context. When it replaces an older note, start with SUPERSEDES <id> and that note is archived.
projectNoProject name (e.g. web-app). Omit for a note that applies everywhere
categoryNoCategory of the note (default: thought)
metadataNoAdditional structured data
state_keyNoFor a CURRENT-VALUE fact that will change later (a setting, a status, an owner), pass a key like config:theme. Saving under the same key archives the previous value, so search returns only the current one. Namespaces: config, status, pricing, policy, stack, vendor, infra, person. Omit it for anything that stays true once it happened: an event, a decision, a lesson.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden, and it does disclose the one surprising behavior: state_key saves replace/archive the earlier value so only the current one is found. It also sets an audience contract ('write for a future agent with zero context'). It does not say what a save returns (an id?), whether duplicates are detected, or that the write is permanent — the id gap matters because SUPERSEDES <id> is the archive mechanism.

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?

Four sentences, front-loaded with purpose then trigger then authoring rule then state_key semantics — a sensible order. Slight redundancy: the content classes are listed twice ('decision, bug fix, pattern, or lesson' then 'make a decision, fix a bug, learn something non-obvious'), which costs a few words without adding information.

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 7-parameter mutation tool with no annotations and no output schema, the description covers purpose, timing, authoring style and the state_key lifecycle. The main remaining hole is the return contract — an agent is told to write 'SUPERSEDES <id>' but is not told whether saving yields that id or how to obtain it.

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 baseline is 3 and the description adds only the decision rule for state_key, which the schema's own state_key description already spells out. The 'zero context' phrasing reinforces the content parameter, but no new syntax or examples are introduced beyond the 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?

States a specific verb and resource ('Save ... to a local knowledge base') and enumerates the content classes (decision, bug fix, pattern, lesson) it accepts. Against siblings brain_search, brain_recent, brain_delete, brain_stats and brain_update_project, this is plainly the write path, so an agent can tell them apart without opening any schema.

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?

Gives an explicit call trigger list: 'whenever you make a decision, fix a bug, learn something non-obvious, or the user corrects you.' That is stronger than most definitions. It stops short of exclusions (what not to save, e.g. ephemeral chatter) and never routes to a sibling for related jobs such as reassigning a note's project.

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