Skip to main content
Glama

Find Methods by Side Effects

find_by_side_effects
Read-onlyIdempotent

Find C# methods by side-effect profile: filter for io, network, database, logging or other effects, or list pure methods. Use it to answer 'what hits the database?' and locate side-effect-free code.

Instructions

Find code by its side-effect profile: what a method touches in the outside world. Each unit carries effect tokens from a closed set - io, network, database, serialization, logging, cache, messaging, unknown ('unknown' = an external call the analysis could not classify) - or none, which makes it pure. calls_external lists the external calls and property accesses behind a token; an effect that comes from a 'new X()' or is inherited from a callee has no row there.

Use it for 'what hits the database or the network?' and to find pure methods. Effects propagate along calls and creations: calling a method or building an object that writes a file counts as 'io'.

With neither effect nor purity, only impure units are listed. An effect or purity outside its vocabulary, or effect with purity='pure', is rejected with the valid values, never a silent zero.

Returns scope, effect, purity, methodsScanned, matches (capped envelope, max 200 hits: name, declaringType, namespace, effects) and, when they apply, 'note', availableEffects, methodsScannedNote, testMatchesFiltered. The units are methods plus every accessor and constructor with a body, under their metadata names (get_X, set_X, .ctor, .cctor), and, unscoped, each top-level-statement file ('Program.cs (top-level)'); the purity='pure' listing is methods-only. A hit does not split direct from inherited effects.

On zero matches availableEffects lists the tokens present in scope (an empty result reads 'valid token, nothing in scope records it') and the note quotes the token's meaning ('cache' = an external cache API, not an in-memory one), omitted when nothing was scanned. A 'note' leads the answer when a project's core references did not resolve: an unresolved run reports methods as PURE that are not.

Read-only; works on a recalled session. Test projects are excluded unless includeTests=true; testMatchesFiltered counts the removed units, which methodsScanned does not include.

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>"
    },
    "name": "find_by_side_effects"
  }
}

Input Schema

NameRequiredDescriptionDefault
scopeNo'solution' (default) or a namespace prefix (e.g. 'MyApp.Infrastructure') to narrow scope.solution
effectNoFilter to methods carrying this effect token - exactly one of: io, network, database, serialization, logging, cache, messaging, unknown (case-insensitive; any other value is rejected, not answered with zero). Omit to not filter on a specific effect.
purityNo'any' (default), 'pure' (only side-effect-free methods), or 'impure' (only methods with at least one effect).any
sessionIdYesThe session_id returned by analyze_solution. Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use.
includeTestsNoInclude test-project methods (default false - production focus: a 'what hits the DB?' query is otherwise drowned by Seed*/Migrate_*/*RepositoryTests). Set true to also list the methods of test projects.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.5.46513
    • changedInput schema / properties / includeTests / description
      Previous value: -"Include test-project methods (default false - production focus: a 'what hits the DB?' query is otherwise drowned by Seed*/Migrate_*/*RepositoryTests). Set true to also list methods in *.Tests/*.Spec projects."New value: +"Include test-project methods (default false - production focus: a 'what hits the DB?' query is otherwise drowned by Seed*/Migrate_*/*RepositoryTests). Set true to also list the methods of test projects."
    • 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.3/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive/closed-world, yet the description still adds substantial behavior: effects propagate along calls and object creation, an effect arising from 'new X()' or inherited from a callee has no calls_external row, hits are capped at 200, invalid vocabulary or effect+purity='pure' is rejected with the valid values rather than returning zero, and an unresolved run reports methods as PURE that are not. These are exactly the non-obvious caveats an agent needs before trusting results.

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?

It is front-loaded: the definition and use cases come first, then the return envelope, then edge cases and caveats. Most sentences carry unique information, but the middle passages are dense and semicolon-chained (the calls_external row rules, the units enumeration), which costs readability for a tool whose core contract is simple.

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?

With no output schema, the description carries the full burden and discharges it: it enumerates the returned fields (scope, effect, purity, methodsScanned, matches, plus conditional note, availableEffects, methodsScannedNote, testMatchesFiltered), the shape of each match, the 200-hit cap, and the empty-result interpretation. Combined with annotations covering safety, an agent has everything needed to call and read the result.

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 baseline is 3, but the description adds real semantics: 'unknown' is defined as an external call the analysis could not classify, 'cache' is an external cache API rather than in-memory, invalid effect values and the effect+purity='pure' combination are explicitly rejected rather than silently returning empty, and methodsScanned is stated to exclude testMatchesFiltered units. It also warns that unscoped results include top-level-statement files while purity='pure' is methods-only.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence gives a specific verb and a precise resource-plus-dimension: 'Find code by its side-effect profile: what a method touches in the outside world.' The token vocabulary (io, network, database, serialization, logging, cache, messaging, unknown, none/pure) makes the concept concrete. It does not explicitly contrast itself with sibling finders like find_by_semantics or find_by_attribute, so it stops short of full sibling differentiation.

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 supplies concrete use cases: 'what hits the database or the network?' and 'to find pure methods', plus state-dependent behavior such as 'With neither effect nor purity, only impure units are listed' and the default exclusion of test projects with the includeTests override. It never names an alternative tool to use instead, and gives no when-not guidance, so the routing burden is only partly lifted.

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