Skip to main content
Glama

learn_from_attempts

Store lessons from task attempts to automatically recall solutions in future sessions, improving efficiency by documenting what worked and what failed.

Instructions

Store a lesson learned from a failed or successful attempt. Call this AFTER completing any non-trivial task (deploy, debug, fix, architecture decision). The lesson will be recalled automatically in future sessions via recall_best_solution. Fields: topic (short slug like "deploy:web"), outcome ("success"|"failure"), what_worked (what solved it), what_failed (what did NOT work), context (extra details). Supports structured metadata: severity, file_paths (files involved), commands (working commands), tags. Deduplication: if a lesson for this topic already exists, it is updated instead of duplicated. Example: learn_from_attempts(topic="deploy:api", outcome="success", what_worked="nohup docker compose up -d --build", what_failed="docker compose up hangs on SSH timeout", severity="critical", commands=["nohup docker compose up -d --build"])

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instance_idYesUUID of the cache instance
topicYesShort slug, e.g. "deploy:web", "debug:redis-tls", "fix:generate-series"
outcomeYesDid it work?
what_workedYesWhat solved the problem or what approach succeeded
what_failedNoWhat did NOT work (optional but valuable)
contextNoAdditional context, error messages, root cause (optional)
severityNoImpact severity: critical (blocks work/deploy), major (significant slowdown), minor (nice to know). Default: major.
file_pathsNoFiles involved in this lesson (e.g. ["infra/deploy.sh", ".env"])
commandsNoCommands that worked or failed (e.g. ["rsync -avz ...", "docker compose up -d"])
tagsNoTopic tags for filtering (e.g. ["bash", "deploy", "env"])
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: the tool performs a write operation ('store', 'updated'), includes deduplication logic, and mentions automatic recall in future sessions. However, it lacks details on error handling, performance characteristics, or authentication requirements, which would be valuable for a mutation tool.

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?

The description is well-structured and front-loaded with the core purpose and usage guidelines. Most sentences earn their place by adding specific details (e.g., deduplication, metadata support). However, the example at the end is somewhat lengthy and could be slightly trimmed without losing clarity.

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 tool's complexity (10 parameters, mutation operation) and lack of annotations/output schema, the description does a good job of covering essential context: purpose, usage, parameters, and behavior. It could improve by mentioning error cases or response format, but it's largely complete for guiding an agent.

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?

Schema description coverage is 100%, so the baseline is 3. The description adds value by explaining parameter semantics beyond the schema: it clarifies that 'topic' is a 'short slug', provides examples of valid values for 'outcome', and explains the purpose of structured metadata fields like 'severity' and 'commands'. The example at the end illustrates practical usage, enhancing understanding.

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 tool's purpose with specific verbs ('store a lesson learned') and resources ('from a failed or successful attempt'), distinguishing it from siblings like 'recall_best_solution' (which retrieves lessons) and 'global_learn' (which appears broader). It explicitly defines what the tool does rather than just restating the name.

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?

The description provides explicit guidance on when to use this tool ('AFTER completing any non-trivial task') and references an alternative ('recall_best_solution' for retrieval). It also specifies deduplication behavior ('if a lesson for this topic already exists, it is updated'), helping the agent understand when not to create duplicates.

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/cachly-dev/cachly-mcp'

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