Skip to main content
Glama

anchor_recapture

Repair broken location anchors on code findings by recapturing them from the git object store. Runs as a dry run unless apply is set.

Instructions

Rebuild stored location anchors from the git object store. DRY RUN by default.

The sanctioned repair path: meta.loc is writable through update_finding(meta_update=) and NOTHING validates it there, so a hand-assembled object is accepted at the write and read back as unknown(invalid_anchor). This verb builds the object itself, from the same capture the file-time resolver uses.

Four behaviours are specified rather than incidental. A FAILED capture never replaces a valid stored anchor (outcome kept) — the refusal is usually about the environment, and the anchor it would destroy is still good in a clone that has the history. The loc: null tombstone ("do not recapture") is left alone unless force_tombstone says otherwise. The git work runs outside any transaction, and only the version check and the write share one — so a row whose anchor changed while the capture ran is reported stale and left to the other writer.

include_unanchored widens the POPULATION to rows that never carried an anchor at all — every finding filed before the capture seam landed, since capture runs only when a genuine new finding is filed. They report would_backfill/backfilled, never folded into would_update/updated: "acquired an anchor for the first time" is the number this exists to produce. It is NOT force_tombstone (a loc: null tombstone is a key that is present and null, and this flag never touches it) and it is NOT a fingerprint backfill — nothing here reads or writes that column.

Args:

  • finding_id: Repair one finding instead of a population

  • status: Status filter; "all" widens to every status (default: open)

  • category: Restrict to one category

  • file: Restrict to one file (the finding's file column)

  • project_dir: The repository to capture from. Omitting it makes every capture refuse with no_root, which by the rule above leaves every valid anchor untouched

  • apply: Write the rebuilt anchors (default: report only)

  • force_tombstone: Overwrite a loc: null tombstone

  • include_unanchored: Also take rows carrying no loc key at all (the backfill population). Leaves tombstones alone; still a dry run unless apply is set

  • limit: Maximum findings examined (default 10000). 0 means NO findings are examined; a negative value is an error (it used to mean "no limit").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNo
applyNo
limitNo
statusNoopen
categoryNo
finding_idNo
project_dirNo
force_tombstoneNo
include_unanchoredNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.2.2

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden — and it does so excellently. It discloses dry-run default, failure-capture never replacing valid anchors, tombstone preservation unless force_tombstone, git work running outside the transaction with stale outcomes, and the distinct backfill outcome family for include_unanchored. This is far richer behavioral disclosure than annotations would typically provide.

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?

The description is long, but the tool is genuinely complex with nine parameters, multiple outcome families, and a transactional caveat. The first line front-loads purpose and default mode, and later paragraphs each add non-obvious behavior that materially affects invocation. Minor redundancy, such as restating the dry-run default inside the apply argument, keeps it just short of a perfect score.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and zero schema descriptions, the description leaves little uncovered: it defines outcome vocabulary (kept/stale/would_backfill/backfilled), default behavior, failure modes (no_root, negative limit), population filters, and the relationship to update_finding. An output schema exists, so return-value detail is not required. A caller has everything needed to decide whether to run this tool and with which flags.

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%, so the description must compensate entirely for the bare input schema. The Args section covers all nine parameters with non-obvious semantics: include_unanchored's population-widening and dry-run interaction, project_dir's no_root failure mode, the changed limit semantics (0 means no findings, negative is an error), and the meaning of apply, force_tombstone, status, category, file, and finding_id. No parameter is left as a bare title.

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 states a specific verb and resource: 'Rebuild stored location anchors from the git object store' and immediately signals the default dry-run mode. It distinguishes this verb from the nearby repair path (update_finding with meta_update) and from sibling anchor tooling, making the tool's role as the sanctioned anchor-repair operation unmistakable.

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 context for when this tool is the right choice: it is the sanctioned repair path because update_finding does not validate hand-assembled anchors, and it explicitly says what the tool is NOT (force_tombstone, fingerprint backfill). It does not name a specific sibling tool as the alternative for ordinary anchor lookup or resolution, so the guidance is strong but not a complete when-to-use vs alternate-to-use routing.

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

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/faxik/codebugs'

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