Skip to main content
Glama

index_rules_from_markdown

Index Markdown rule files into SQLite to make team coding rules queryable, upserting canonical blocks or staging legacy proposals for approval.

Instructions

Index rules from a markdown file directly into SQLite.

mode="atomic" upserts canonical blocks by code (existing rules are updated in place, new ones created). mode="legacy" stages each old-style block as a pending_proposals entry instead of writing to rules directly.

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 ## RN-XXX-NNN blocks (the {TECH} segment is optional — plain ## RN-NNN is also accepted) and upsert them directly into rules/rule_history. 'legacy': parse old ### blocks into pending_proposals only, never writing to rules directly.atomic
filepathYesPath to the source .md file containing rule 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

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the burden and largely meets it: it declares 'Access level: write', discloses that atomic mode updates existing rules in place (a destructive-ish upsert by code), that legacy mode never writes to rules, and lists the returned counts plus parser warnings/errors. Not covered are permissions/auth beyond the 'write' label and what happens on parse failure for the whole file.

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?

Front-loads the purpose in one sentence, then the two modes, then access level and return shape as scannable labeled lines. There is some duplication of the schema's mode text, which is the only real waste.

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 return details are not strictly required, yet the description still summarizes counts, per-scope breakdown, warnings and errors, giving an agent a full picture of a three-parameter write tool. Only file-path preconditions and failure behavior are unaddressed.

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% and the schema's own mode description already explains both values in detail, so the description's mode paragraph largely echoes structured data. It adds no new syntax for filepath or default_scope_id, so the baseline 3 is appropriate.

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?

States a specific verb and resource ('Index rules from a markdown file') plus the destination ('directly into SQLite'), which is more informative than a bare name restatement. It does not explicitly distinguish itself from the sibling index_lessons_from_markdown, but the rules/lessons split is self-evident from the resource named.

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 gives clear conditional guidance for the main decision point: mode='atomic' upserts canonical blocks by code while mode='legacy' stages pending_proposals instead of writing to rules. It stops short of naming alternatives such as convert_to_atomic_format or extract_rules_from_transcript, but the mode-selection context is concrete.

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