Skip to main content
Glama

index_lessons_from_markdown

Parse Markdown lesson blocks and insert or update them in a SQLite lessons table, returning indexed, created, updated counts and parser warnings.

Instructions

Index lessons from a markdown file directly into SQLite.

Same logic as index_rules_from_markdown but targets the lessons table.

Access level: write. Returns: JSON with indexed/created/updated counts, a per-scope breakdown, and any parser warnings or errors.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNo'atomic': parse canonical ## LL-XXX-NNN blocks (the {TECH} segment is optional — plain ## LL-NNN is also accepted) and upsert them directly into lessons/lesson_history. 'legacy': parse old ### blocks into pending_proposals only, never writing to lessons directly.atomic
filepathYesPath to the source .md file containing lesson blocks.
default_scope_idYesScope assigned to blocks that don't declare their own **Scope:** field (e.g. 'global-java', 'project-<id>').

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and largely does: it declares 'Access level: write', discloses that atomic mode upserts directly into lessons/lesson_history, and summarizes the return payload (indexed/created/updated counts, per-scope breakdown, parser warnings/errors). It stops short of stating permission requirements, conflict/replace semantics on upsert, or whether prior rows are overwritten.

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?

Four short lines, fully front-loaded: what it does, the sibling differentiation, the access level, and the return shape. No filler sentences and nothing buried at the end.

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?

An output schema exists so the description need not detail return values, and all three parameters are schema-documented. The remaining gap is operational: no mention of permissions, error/partial-failure behavior, or what an upsert does to pre-existing lesson rows in the atomic path.

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 100%, so every parameter (mode, filepath, default_scope_id) is already fully documented in the schema, including the atomic/legacy semantics. The description adds no format, syntax, or example detail beyond that, so the baseline of 3 applies.

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?

States a specific verb and resource ('Index lessons from a markdown file directly into SQLite') and explicitly contrasts with the sibling 'index_rules_from_markdown', naming the target table as the differentiator. An agent can pick between the two indexing tools without opening either schema.

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

Usage Guidelines3/5

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

Usage is implied (index lesson blocks that already live in a .md file) and the sibling comparison helps routing, but there is no explicit when-to-use/when-not guidance, and no hint about when to prefer this over transcript-based extraction such as 'extract_lessons_from_transcript'. The atomic-vs-legacy split is only explained in the schema.

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