Skip to main content
Glama

lesson_save

Persist a new lesson learned in a session with a confidence score to retain patterns, heuristics, and observations across context resets. Check for similar lessons first to avoid duplicates.

Instructions

Persist a new lesson learned during this session with an initial confidence score (default 0.7). Confidence decays over time when the lesson is not reinforced. Does not deduplicate, call lesson_recall first to check whether a similar lesson already exists. Use to record patterns, heuristics, or observations the AI should carry forward across sessions.

Input Schema

NameRequiredDescriptionDefault
tagsNoOptional tags for categorization. Accepts an array of tag strings (preferred) or a single comma-separated string (legacy).
authorNoOptional author name for team attribution. Defaults to the system username.
contentYesThe lesson text to store.
contextYesWhere this lesson applies, e.g. 'code review' or 'git workflow'.
initial_confidenceNoStarting confidence score between 0 and 1. Defaults to 0.7.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.1.17
  2. Removedv1.1.15
  3. Added
  4. Removedv1.1.12
  5. Changed3 schema fields changedv1.1.11
    • changedInput schema / properties / tags / description
      Previous value: -"Optional comma-separated tags for categorization."New value: +"Optional tags for categorization. Accepts an array of tag strings (preferred) or a single comma-separated string (legacy)."
    • addedInput schema / properties / tags / oneOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  }
      +]
    • removedInput schema / properties / tags / type
      Removed value: -"string"
  6. Changed1 schema field changedv1.1.7
    • addedInput schema / properties / author
      Added value: +{
      +  "description": "Optional author name for team attribution. Defaults to the system username.",
      +  "type": "string"
      +}
  7. Addedv1.0.7

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the load and does disclose real behavior: it persists, assigns a starting confidence (default 0.7), and that confidence decays over time when unreinforced. It omits what the call returns (e.g., an ID or confirmation) and whether the write is immediately durable across processes.

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 sentences, front-loaded with the core action, and each sentence adds something (persistence, decay semantics, dedup caveat, use cases). Minor redundancy in repeating the 0.7 default from the schema costs it a point.

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 5-parameter write tool with full schema coverage and no output schema, the description covers purpose, defaults, decay, and the dedup caveat adequately. The only notable gap is return-value expectations, which matter for a mutation with no output schema.

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 coverage is 100%, so all five parameters are already documented, including defaults for initial_confidence and author. The description only restates the 0.7 default and adds no format or interaction detail beyond the schema, making the baseline 3 appropriate.

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?

Uses a specific verb+resource ('Persist a new lesson learned') and scopes it to the current session. It is clearly distinguishable from sibling lesson_recall and lesson_reinforce by stating it creates rather than retrieves or reinforces.

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

Usage Guidelines5/5

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

Explicitly names the alternative ('call lesson_recall first to check whether a similar lesson already exists') and the condition that selects it, plus a positive use case ('patterns, heuristics, or observations the AI should carry forward across sessions'). It even states an exclusion: it does not deduplicate.

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