Skip to main content
Glama

Find Tests for a Symbol

find_tests_for
Read-onlyIdempotent

Find tests that likely cover a C# symbol from static evidence to identify what pins a change before editing and which tests to run after.

Instructions

Find the tests that likely cover a symbol, from static evidence (coverage_gaps: the reverse). Use it before a change (what pins it) and after (what to run). Only test-attributed methods count (default: Fact, Theory, Test, TestMethod, TestCase(Source)).

Returns items [{testType, testMethod, project, matchReason}] (+ 'testTypeFullName' where two read alike, 'logicalProject' where project ends in '(tfm)', 'raisedEvent' on an event raise), count, totalFound, truncated (max 50), invokesTotal, dispatchTotal (omitted at 0).

matchReason (11 tiers, sorted): 'invokes' (calls the target), 'invokes-via', 'command' (executes the target's command), 'command-via', 'accesses' (reads/writes the target property or field, or a type's static one), 'accesses-via', 'constructs' (builds the target type; type or constructor query), 'constructs-via' - strong, counted by invokesTotal (whole result) - then 'dispatch' (calls an interface/abstract/virtual member the target implements or overrides, or raises an event it handles; a double may have run), 'dispatch-via' (both counted by dispatchTotal) and 'name' (a guess: the test's or its class's name holds the symbol - for Type.Member, both).

Evidence reaches one call deep ('-via': through one method, constructor or getter the test calls). A 'note' says so on an empty answer or when a non-constructor answer's strong rows are all '-via', and names other pitfalls: an incomplete or unrestored run, an undeclared name or type segment (name noise), an event or enum member (name tier only), an unread qualified type name, a constructor query, no strong row, contract rows, construction rows (matched by simple name), overloads unioned, constant- and helper-only static readers left out, unread VB, F# or markup code. Also: 'generatedCodeNote' (its project or a referenced one lacks generated code), 'namesakes' (types sharing the name), 'nearest' (an undeclared name's close declared one).

Read-only.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sessionId": "<sessionId>",
      "symbol": "<symbol>"
    },
    "name": "find_tests_for"
  }
}

Input Schema

NameRequiredDescriptionDefault
symbolYesThe case-sensitive symbol to find covering tests for: a type's simple name, a member name bare or as 'Type.Member' (only that type's member), or 'Type.Type' for the constructor. A qualified type name ('Ns.Type', 'Outer.Inner') reads as the type where no type of that simple name lies outside it (a 'note' says so).
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.46521
    • changedInput schema / properties / symbol / description
      Previous value: -"The type name, or the member name - bare or in the qualified Type.Member form - to find covering tests for."New value: +"The case-sensitive symbol to find covering tests for: a type's simple name, a member name bare or as 'Type.Member' (only that type's member), or 'Type.Type' for the constructor. A qualified type name ('Ns.Type', 'Outer.Inner') reads as the type where no type of that simple name lies outside it (a 'note' says so)."
  2. 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."
  3. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already establish that the tool is read-only, idempotent, closed-world, and non-destructive. The description adds substantial behavior beyond that: result item fields, matchReason tiers, strong versus weak evidence, one-call-deep '-via' semantics, truncation at 50, and numerous note conditions and pitfalls.

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 front-loaded with purpose and usage before moving into detailed return semantics. It is dense and parenthetical, but most of the detail earns its place because there is no output schema and the matchReason tiers require explanation.

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?

For a static-analysis query with no output schema, the description gives enough about return shape, ranking, totals, truncation, and exceptional notes to interpret results correctly. Annotations cover safety and idempotence, and the schema covers both parameters in detail.

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 coverage is 100%, and the parameter descriptions already explain symbol forms, constructor syntax, qualified names, and the sessionId path behavior. The description adds little parameter-level meaning beyond the schema, so the baseline of 3 is appropriate.

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: find tests that likely cover a symbol from static evidence. It explicitly distinguishes itself from coverage_gaps by calling that the reverse and gives two concrete use phases, before and after a change.

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?

It says to use this before a change to see what pins the symbol and after a change to see what to run. It also names coverage_gaps as the complementary alternative, so the agent has clear routing guidance.

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