Skip to main content
Glama

add_lesson

Save a lesson learned when you already know what to record. Provide a summary and optional details to capture technical findings or pitfalls.

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
detailNo
domainNo
run_idNo
summaryYes
source_urlNo
source_toolNo
source_agentNo
project_folderNo
user_confirmedNo
last_validated_atNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations provided, so description must carry full burden. It states 'writeback lifecycle' implying a write operation, but lacks details on side effects, duplicate handling, authorization needs, or return behavior. The output schema exists but is not mentioned. Sufficient for basic understanding but not rich.

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?

Description is well-structured with headings and clear separation of purpose and lifecycle. Bilingual adds length, but each sentence serves a purpose. Front-loaded with core action. Could be more concise if monolingual, but overall efficient.

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?

Moderate complexity tool with 10 params and output schema. Description covers usage, lifecycle, and most params, but misses two parameters (project_folder, user_confirmed) and does not mention output schema or return values. Adequate but with clear gaps.

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 0%, so description partly compensates by explaining 8 out of 10 parameters (missing project_folder and user_confirmed). Domain parameter gets extra context (comma-separated labels). Baseline for 0% is low, but description adds meaningful value for most params, earning above baseline.

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?

Description clearly states tool records a single lesson learned, with verb 'record' and resource 'lesson learned'. It distinguishes from extract_session_insights but does not explicitly differentiate from sibling tools add_decision and add_playbook, though the domain (lesson vs decision/playbook) is implied.

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?

Provides explicit when-to-use (user explicitly states a lesson) and when-not-to-use (if session summary, use extract_session_insights). However, it does not mention when to use add_decision or add_playbook instead, which limits comprehensive guidance against all siblings.

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