Skip to main content
Glama

Retrieve Lessons

retrieve_lessons
Read-only

Retrieve relevant past lessons for any tool action, offering per-action guidance before execution to prevent repeated costly mistakes.

Instructions

Retrieve the most relevant lessons for a given tool/action context. Use in PreToolUse hooks for per-action guidance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scopeNo
filtersNoPre-filter the candidate corpus before lexical or vector ranking.
toolNameYesThe tool being called (e.g., Bash, Edit, Read)
maxResultsNoMax lessons to return (default 5)
queryRewriteNoEnable bounded deterministic synonym expansion when the original lexical match is weak. Defaults true.
requireScopeNoFail closed unless a complete four-field scope is supplied.
actionContextNoDescription of what the tool call is doing
includeSharedNoInclude explicitly shared memories with scoped results. Defaults true.
includeRetrievalMetaNoInclude path provenance such as lexical/dense pools and query variants.
Behavior3/5

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

The annotation readOnlyHint=true already declares the read-only nature, and the description does not contradict it. The description adds minimal behavioral context beyond the annotation, such as the per-action guidance focus, but does not disclose any potential side effects, error modes, or rate limits. With annotations present, the bar is lower, but the description still adds limited value.

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 two concise sentences that front-load the main purpose and add a clear usage note. Every sentence earns its place, with no unnecessary information or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the core purpose and usage context but does not explain return values (no output schema exists) or parameter interactions. The rich schema descriptions compensate somewhat, but the description alone is not fully complete for a tool with 9 parameters and nested objects.

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 high (89%), so the parameters are well-documented in the schema. The description does not add any parameter-specific semantics beyond what the schema already provides, earning the baseline score of 3.

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?

The description clearly states the tool retrieves relevant lessons for a tool/action context, using the specific verb 'retrieve' and resource 'lessons'. It also mentions the intended use in PreToolUse hooks. However, it does not explicitly differentiate from sibling 'search_lessons' or other retrieval tools, so it lacks sibling distinction.

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 a clear usage context ('Use in PreToolUse hooks for per-action guidance'), which tells the agent when this tool is appropriate. It does not mention exclusions or alternative tools, but the context is specific enough for a 4.

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/IgorGanapolsky/ThumbGate'

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