Skip to main content
Glama

save_annotation

Save AI-written summaries and keywords for a source file to make BM25 keyword search semantic, helping natural-language queries find relevant code without embeddings.

Instructions

Saves an AI-authored annotation (summary + keywords) for a source file.

Annotations make keyword search semantic WITHOUT embeddings: your summary
is indexed into BM25, so natural-language queries like "where is auth
handled" match it. Write annotations for files you have just read or
changed — 1-2 sentences on what the file does and why it exists.

Args:
    path: File path relative to project root (or absolute inside it).
    summary: 1-3 sentences: purpose, key responsibilities, notable design.
    keywords: Comma-separated search terms a developer might query
        (synonyms, domain words not present in identifiers).

Returns:
    Confirmation with annotation coverage stats.

Input Schema

NameRequiredDescriptionDefault
pathYes
summaryYes
keywordsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.12.0

TDQS

A4.2/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the full burden, and it discloses the non-obvious side effect that the summary becomes BM25-searchable content — behavior an agent could not infer from the schema. It also states the return shape ('confirmation with annotation coverage stats'). The notable omission is what happens on re-save: whether an existing annotation is overwritten, merged, or rejected, which matters for a mutation tool with zero annotation coverage.

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?

Purpose is front-loaded in the first line, the BM25 rationale earns its sentence because it explains why the summary quality matters, and the Args block stays tight. The Returns line is somewhat redundant given an output schema exists, and the docstring formatting adds light structural overhead.

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?

For a 3-parameter write tool with an output schema and no annotations, the description covers purpose, mechanism, invocation trigger, per-parameter guidance, and return shape — enough to call it correctly. The one gap an agent would still hit is overwrite/idempotency semantics when an annotation already exists for the path.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description compensates fully for all three parameters: path is scoped ('relative to project root, or absolute inside it'), summary has a length and content spec ('1-3 sentences: purpose, key responsibilities, notable design'), and keywords explains both format (comma-separated) and strategy (synonyms, domain words not present in identifiers). This adds meaning well beyond the bare string types in the schema.

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 ('Saves an AI-authored annotation (summary + keywords) for a source file') and adds the mechanism that makes it distinct: the summary is indexed into BM25 so natural-language queries match it. It never names the sibling it complements (get_annotations, list_unannotated_files), so the read/write pairing must be inferred from the names.

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?

'Write annotations for files you have just read or changed' gives a concrete trigger condition, which is real usage guidance rather than a restatement of the name. There is no exclusion guidance (e.g. skip generated/vendored files) and no pointer to list_unannotated_files as the way to find candidates.

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