Skip to main content
Glama

topos_calculate_coverage

Read-onlyIdempotent

Measure how well a test suite exercises its program-under-test, via structural (UAST) coverage (read-only). A standalone signal, separate from the four-pillar quality lattice; for a quality verdict use topos_evaluate_* instead.

Instructions

Measure how well a test suite exercises its program-under-test, via structural (UAST) coverage (read-only). A standalone signal, separate from the four-pillar quality lattice; for a quality verdict use topos_evaluate_* instead. Computes UAST bipartite declaration matching and k-gram path recall. Returns a CoverageResult.

Input Schema

NameRequiredDescriptionDefault
kNoLength of kind n-grams for path recall.
languageNoProgramming language (for parsing).python
put_filesYesPaths to the program-under-test files (relative to project root).
test_filesNoPaths to the test suite files (relative to project root). Optional: inline tests in `put_files` (Rust `#[cfg(test)]`, Go `Test*`, Python `test_*`) are counted on the test side.
include_unknownNoWhether to include Unknown UAST nodes in the analysis.
coverage_thresholdNoMinimum threshold for the declaration coverage policy.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.11.0
    • addedInput schema / properties / test_files / default
      Added value: +[]
    • changedInput schema / properties / test_files / description
      Previous value: -"Paths to the test suite files (relative to project root)."New value: +"Paths to the test suite files (relative to project root). Optional:\ninline tests in `put_files` (Rust `#[cfg(test)]`, Go `Test*`,\nPython `test_*`) are counted on the test side."
    • changedInput schema / required
      Previous value: -[
      -  "put_files",
      -  "test_files"
      -]New value: +[
      +  "put_files"
      +]
  2. Addedv0.4.0
  3. Removedv0.4.0-rc
  4. Changed1 schema field changedv0.3.9
    • changedInput schema / properties / params / properties / coverage_threshold / description
      Previous value: -"Minimum threshold for declaration and topological coverage policies."New value: +"Minimum threshold for the declaration coverage policy."
  5. First observedv0.3.6

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and non-destructive, so the safety profile is covered; the description adds the method (UAST bipartite declaration matching and k-gram path recall) and the return type (CoverageResult). It doesn't describe error conditions or how partial inputs are handled, but for a pure read-only analysis tool that is a minor omission.

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?

Three short sentences, front-loading the core action and then the sibling differentiation, with no filler. The phrasing is jargon-dense ('four-pillar quality lattice', 'UAST bipartite declaration matching') but each clause carries information.

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 read-only, fully schema-documented tool with eight sibling evaluate/assess tools, the description covers purpose, method, and the routing decision away from quality verdicts. With no output schema it names the return type, which is the minimum needed; more detail on result shape or behavior on missing test files would round it out.

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 the schema already documents all six parameters, making 3 the baseline. The description's mention of 'k-gram path recall' loosely connects to the `k` parameter but adds no syntax or format detail beyond the schema.

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: 'Measure how well a test suite exercises its program-under-test, via structural (UAST) coverage.' It also differentiates itself from siblings by declaring it is 'a standalone signal, separate from the four-pillar quality lattice' and pointing to `topos_evaluate_*` for quality verdicts, so an agent can tell it apart from the evaluate family.

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?

It gives clear context (use this to measure test-suite exercise of a program) and an explicit exclusion with an alternative route ('for a quality verdict use `topos_evaluate_*` instead'). The gap is that the alternative is named as a wildcard family rather than a specific sibling, so the agent must still choose among several evaluate tools.

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