Skip to main content
Glama

find_catch_blocks

Identify all catch blocks handling a specific exception type across the solution, with details on rethrows, empty handlers, and runtime filters. Optionally include clauses catching base types.

Instructions

Find the catch clauses that handle an exception type across the solution, and say what each one does with it. Each item reports hasFilter (a when clause, so the handler may decline at runtime), rethrows (the body contains a bare throw;) and isEmpty (an empty handler body) — together these answer 'who is silently swallowing this exception?' in a single call. By default only clauses declaring exactly the requested type match; set includeBaseClauses to also surface handlers that catch a base type, including catch (Exception) and bare catch, since those bind the requested type too. caughtType is null for a bare catch. The exception type may live in source or in metadata. 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.IO.IOException` or `MyApp.DomainException`).
includeBaseClausesNoAlso match clauses catching a base type of the requested one, including bare `catch`. Default false.
Behavior4/5

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

No annotations are provided, but the description discloses behavioral traits such as default exact-only matching, the effect of includeBaseClauses, and sorting order. It also explains what caughtType means for bare catches, adding transparency beyond simple input/output.

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 somewhat lengthy but well-structured with front-loaded purpose and clear information flow. Each sentence adds value, and it avoids unnecessary repetition.

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?

Given three parameters and no output schema, the description is highly complete: it explains the output envelope structure (items, totalCount, etc.), the sorting order, and the behavior for bare catches. It fully covers what an agent needs to understand invocation and interpretation.

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 schema describes each parameter. The description adds meaning by explaining the semantic effect of includeBaseClauses and clarifying that caughtType is null for bare catches, providing context the schema alone does not convey.

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 tool finds catch clauses handling a specific exception type and reports their behavior (hasFilter, rethrows, isEmpty). It distinguishes itself from sibling tools by being exclusively focused on catch blocks and their swallowing behavior.

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?

The description explains when to use this tool (to find who is silently swallowing an exception). It details the includeBaseClauses option for broader matching, though it does not explicitly contrast with siblings like find_exception_flow or find_throw_sites.

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