Skip to main content
Glama

find_throw_sites

Locate every throw site of a specified exception type across your .NET solution, including rethrows and derived types. Supports source and metadata types.

Instructions

Find every place an exception type is thrown across the solution — throw new T(...), throw expr; and bare throw; rethrows (whose type comes from the enclosing catch). The exception type may live in source or in metadata, so System.ArgumentNullException works as well as your own MyApp.DomainException. Set includeDerived to also match subclasses of the requested type. Every throw in the file is reported, including throws inside lambdas and local functions, attributed to the member that contains them — use get_exception_flow instead when the question is which exceptions escape a specific method. Returns an envelope with items, totalCount, truncated, limit and a byType / byProject summary, sorted by file, line, column.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of items to return (default: 500).
exceptionTypeYesException type to search for (e.g. `System.InvalidOperationException` or `MyApp.DomainException`).
includeDerivedNoAlso match types deriving from the requested one. Default false (exact type only).
Behavior4/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It details that the search covers the entire solution, includes throws in lambdas and local functions, attributes throws to the containing member, and returns a sorted envelope with summaries. While it does not explicitly state read-only behavior or performance characteristics, the description is sufficiently transparent for a typical search 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?

The description is a single paragraph that begins with the primary purpose, then details scope, parameter usage, comparison with a sibling, and return format. It is information-dense but not excessively verbose. Minor improvement could be splitting into sentences, but it remains clear and efficient.

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?

The description is highly complete given the tool's complexity. It covers the exception type specification, matching scope (including lambdas and local functions), the use of 'includeDerived', the distinction from 'get_exception_flow', and the envelope structure (items, totalCount, truncated, limit, byType/byProject summary, sorting). No output schema exists, so the description compensates fully.

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. The description adds value by giving concrete examples for the 'exceptionType' parameter (System.ArgumentNullException, MyApp.DomainException) and explaining the scope of 'includeDerived' (matches subclasses). It also describes the types of throw statements matched, which enriches parameter understanding without being redundant.

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 clearly states the verb 'Find' and the resource 'every place an exception type is thrown across the solution'. It explicitly distinguishes itself from the sibling tool 'get_exception_flow' by describing a different use case (finding all throws vs. escapes from a specific method), providing clear differentiation.

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?

The description provides explicit guidance on when to use this tool ('Find every place an exception type is thrown'), when not to use it (use 'get_exception_flow' for method escape analysis), and how to use parameters like 'includeDerived'. It also explains the types of throws matched (throw new, throw expr, bare throw), covering usage context thoroughly.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MarcelRoozekrans/roslyn-codelens-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server