Skip to main content
Glama

tests_for

Find test functions that transitively cover a target symbol by walking the call graph backwards, labeling each with its framework to pick the right runner.

Instructions

Find test functions that transitively cover a target symbol (Phase 13.10). Walks the call graph backwards from <target>, keeps rows under recognized test-path globs (Rust / Python / TS-JS / Go / Java / Kotlin / C# / C++), stamps each row with a framework label (pytest, jest, go-test, …) so an agent can pick the right runner without parsing paths. Prefer over grep test.*Foo — that misses transitively-covered helpers and produces lots of false positives. v1.20.0 (D5) surface — the CLI subcommand exists since v1.19.0 but was MCP-invisible.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax results to return.
symbolNoDEPRECATED alias for `target`; still accepted, emits a deprecated_args notice in _meta.
targetYesSymbol whose test coverage to find — the function/method/class you want to know is tested.
excludeNoBlacklist results by path glob; wins over include (repeatable)
includeNoWhitelist results by path glob, gitignore syntax (repeatable)
max_hopsNoMaximum reverse-call-graph hops from `target`. Default 6.
auto_updateNoAuto-update the index if stale, or bootstrap it if missing, before running (default: true)
async_updateNoWith auto_update, refresh a stale index in the background instead of waiting for it: results come from the index already on disk and _meta.vex.dev/stale says so (default: false)
project_rootNoAbsolute path to the project root (defaults to the MCP working directory)
test_patternNoGlob patterns for test paths (repeatable). When set, REPLACES the default pattern set (does NOT append) — pass the full set you want.
no_stale_checkNoSkip the staleness check that runs before each call; assumes the index is fresh.
include_fixturesNoAdmit non-test-named helpers (fixtures) under test paths via a one-hop forward callee walk. Default off — only `test_*` / `*Test` names surface.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.27.3

TDQS

A4.5/5.0
Behavior4/5

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

No annotations are provided, so the description must carry the behavioral load — and it does substantial work: it explains that rows are stamped with a `framework` label for runner selection, that the walk is transitive with a bounded hop count, and that the CLI surface predates the MCP surface. It doesn't cover return format or what stale-index behavior looks like at the result level, but the framework-label disclosure is valuable behavioral context beyond the schema.

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-loaded with the core purpose, then mechanism, then the grep contrast, then a version-history note. The version sentence is somewhat meta and could be trimmed, but it's a single trailing sentence and doesn't obscure the main payload.

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?

Given 12 parameters with full schema coverage but no output schema, the description correctly focuses on what the tool returns conceptually (test rows with framework labels) and the transitive mechanism. It leaves return-format details to the agent's expectations, which is acceptable when no output schema exists, though a note on result shape would have strengthened it.

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

Parameters4/5

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

Schema coverage is 100%, so the schema already documents all 12 parameters thoroughly, including the deprecated `symbol` alias, `test_pattern` replace-not-append semantics, and the `async_update`/`_meta.vex.dev/stale` contract. The description adds meaning by explaining WHY the framework label exists (so agents can pick a runner without path parsing), which goes beyond structured data, but it doesn't re-explain the parameters themselves — the schema does that.

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 (find) and resource (test functions that transitively cover a target symbol) with the exact mechanism (backward call-graph walk). Distinguishes itself from the sibling `callers`/`callees` by being test-path-filtered and from `grep` by reason. An agent can immediately tell what it returns.

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

Usage Guidelines5/5

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

Explicitly names the alternative (`grep test.*Foo`) and the reason it's wrong (misses transitive helpers, false positives), giving a clear when-to-use-this-not-that rule. This is the strongest kind of routing guidance.

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