Skip to main content
Glama

add_lesson

Record a lesson learned with summary and optional detail, domain, source, and validation. Use when explicitly stating a pitfall or technical finding.

Instructions

记录单条经验教训(你已经知道要记什么)。 / Record one lesson learned when you already know what to save.

**Lifecycle: writeback** — 对话中学到可复用的经验时调用。
Lifecycle: writeback — call when reusable experience is learned during conversation.

用途:用户明确说出一条踩坑经验或技术发现时调用。
Purpose: Call when the user explicitly states a lesson, pitfall, or technical finding.

注意:如果用户给了一段会话摘要让你自动提取,请用 extract_session_insights 而不是本工具。
Note: If the user gives a session summary for automatic extraction, use extract_session_insights instead.

Args:
    summary: 教训的一行摘要。 / One-line lesson summary.
    detail: 详细说明(可选)。 / Detailed explanation (optional).
    domain: 技术领域(可选),可填多个,逗号分隔,如 'python,testing'。 / Technical domain (optional); may contain multiple comma-separated labels such as 'python,testing'.
    source_tool: 记录来源工具,如 'claude_code', 'codex'(可选,建议填写)。 / Source tool, such as 'claude_code' or 'codex' (optional but recommended).
    source_url: 如果教训来自外部内容,填写来源 URL(可选)。 / Source URL when the lesson comes from external content (optional).
    source_agent: 产生/校验此条目的 agent 身份(可选,如 'claude_code',比 source_tool 更细)。 / Agent identity that produced or validated this entry (optional; finer-grained than source_tool).
    run_id: 产生此条目的工作流/会话运行 ID(可选)。 / Workflow/session run id that produced this entry (optional).
    last_validated_at: 人/agent 最近确认此条目仍然成立的 ISO-8601 时间(可选)。 / ISO-8601 time this entry was last confirmed to still hold (optional).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
summaryYes
detailNo
domainNo
source_toolNo
source_urlNo
source_agentNo
run_idNo
last_validated_atNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations provided, but the description mentions 'Lifecycle: writeback', indicating data persistence. It does not contradict any annotations (none exist). Could be more explicit about storage effects, but is adequate for a write 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?

Bilingual content doubles length, but structure is clear with lifecycle, purpose, args, and sibling reference. Front-loaded with core action. Every sentence adds value.

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?

With 8 parameters, 1 required, and an output schema, the description covers purpose, usage, and each parameter. It omits error conditions but is complete for a simple record tool.

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 0%, but the description compensates by explaining each parameter in the Args section. Explanations add context beyond schema names, though some (e.g., run_id) are minimal.

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 it records a single lesson learned when the user already knows what to save. It specifies the action, resource, and condition, and distinguishes itself from extract_session_insights.

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 states when to call: when the user explicitly states a lesson, pitfall, or technical finding. Also provides a clear alternative: use extract_session_insights for automatic extraction from session summaries.

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/Patdolitse/piia-engram'

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