find_throw_sites
Locate all throw sites for a given exception type across the entire solution, including derived types and nested lambdas, with precise file, line, and member attribution.
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.
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": {
"exceptionType": "<exceptionType>"
},
"name": "find_throw_sites"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of items to return (default: 500). | |
| exceptionType | Yes | Exception type to search for (e.g. `System.InvalidOperationException` or `MyApp.DomainException`). | |
| includeDerived | No | Also match types deriving from the requested one. Default false (exact type only). |