Skip to main content
Glama

Find Tests for a Symbol

find_tests_for
Read-onlyIdempotent

Find test methods likely covering a C# symbol via static analysis—calls, reads, construction, or name. Use it to see what pins a symbol before changes and to select tests after.

Instructions

Find the test cases that likely cover a symbol: test methods that call it, read it, build it or are named after it. Static evidence, not a coverage run; coverage_gaps asks the reverse for a scope.

Use it before changing a symbol, to see what pins it, and after, to pick tests. Only a method that itself carries a test attribute counts (by default Fact, Theory, Test, TestMethod, TestCase).

Returns items [{testType, testMethod, project, matchReason}], count, totalFound, truncated (at most 50), invokesTotal, dispatchTotal (omitted at 0) and an optional 'note' after the list. matchReason is one of nine tiers, in sort order: 'invokes' (the test calls the target), 'invokes-via' (through one method or constructor it calls), 'accesses' (it reads or writes the target property or field; for a type, a static one), 'accesses-via', 'constructs' (it builds the target type; type and constructor queries only), 'constructs-via', 'dispatch' (it calls an interface or abstract member the target implements; a test double may have run instead), 'dispatch-via' and 'name' (a guess: the test's or its class's name mentions the symbol - for Type.Member, both names). The first six are strong. invokesTotal counts the strong rows and dispatchTotal the contract rows over the whole result, so totalFound minus both is the name guesses.

The evidence reaches two hops at most - the test and one method or constructor it calls or getter it reads - so a deeper chain is not counted, and an empty answer is not 'nothing pins this'. The 'note' says so on an empty answer, and names the other cases where numbers mislead: an undeclared name or type segment (every hit is name noise), an event or enum member (only the name tier can match), a nested type in the 'Outer.Inner' form, a constructor query, contract rows, construction rows (matched on the type's simple name, so a namesake counts too).

Read-only. symbol is case-sensitive: a type's simple name, a member name bare or as 'Type.Member' (only that type's member), or 'Type.Type' for the constructor.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesThe type name, or the member name - bare or in the qualified Type.Member form - to find covering tests for.
sessionIdYesThe session_id returned by analyze_solution. Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.46513
    • changedInput schema / properties / sessionId / description
      Previous value: -"The session_id returned by analyze_solution."New value: +"The session_id returned by analyze_solution. Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use."
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), but the description adds substantial context beyond them: the two-hop evidence limit, the truncation cap of 50, the meaning of an empty answer, and the specific cases where the returned numbers mislead (undeclared names, event/enum members, nested types, constructor queries). This is unusually rich disclosure for a read-only tool.

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 and the sibling distinction, and each sentence carries information an agent needs. The middle paragraph enumerating nine matchReason tiers is dense, but with no output schema this return-value semantics has to live somewhere. Slightly heavy, though nearly every clause earns its place.

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?

No output schema exists, so the description carries the full burden of explaining the return shape, and it does: the item fields, count/totalFound/truncated, invokesTotal/dispatchTotal, the optional note, and the tier taxonomy in sort order. Combined with the case-sensitivity rule for the input, an agent has everything needed to call and interpret this tool.

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 baseline is 3, but the description adds real meaning beyond the schema: 'symbol is case-sensitive' and the three accepted forms including 'Type.Type' for a constructor, which the schema does not spell out. The added constraint materially affects how an agent passes the argument.

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 ('find the test cases that likely cover a symbol') and immediately scopes what counts as evidence ('static evidence, not a coverage run'). It explicitly distinguishes itself from the sibling coverage_gaps ('asks the reverse for a scope'), so an agent can route between the two without opening either schema.

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?

Gives explicit when-to-use guidance in both directions of a workflow: 'before changing a symbol, to see what pins it, and after, to pick tests.' It also names the alternative tool and the condition that selects it, and states what the tool is NOT (a coverage run).

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