Skip to main content
Glama

find_throws_declarations

Find all Java methods that declare a specific exception in their throws clause. Input a fully qualified exception type to analyze exception flow and handling across a loaded project.

Instructions

Find all throws declarations of an exception type in method signatures.

JDT-UNIQUE: This fine-grained search is not available in LSP.

USAGE: Provide fully qualified exception type name as typeName OUTPUT: All methods that declare 'throws ExceptionType'

Useful for:

  • Understanding exception flow in the codebase

  • Finding all methods that can throw a specific exception

  • Exception handling analysis

potentialMatches, present only when there are any, holds the places JDT's search reports as possible matches but cannot confirm, because a type or name there does not resolve (a missing dependency or a compile error): count is their exact number, and locations lists them, as many as the results it stands beside may list. They are never counted or listed as results.

Requires load_project to be called first.

Input Schema

NameRequiredDescriptionDefault
typeNameYesFully qualified exception type name (e.g., 'java.io.IOException')
maxResultsNoMaximum results to return (default 100)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.4
  2. Removedv1.3.3
  3. First observedv1.2.0

TDQS

A4.2/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the full burden and does notable work: it discloses the load_project prerequisite and explains the non-obvious potentialMatches field (unconfirmed matches never counted or listed as results). It still does not state read-only status or rate/size limits explicitly, so it is strong but not exhaustive.

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?

Purpose is front-loaded in the first line, followed by differentiator, usage, output, and use cases in a scannable structure. The potentialMatches paragraph is dense and slightly long but each clause carries real semantic weight about result semantics.

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 and no annotations, the description compensates by describing the output ('all methods that declare throws ExceptionType') and the subtle potentialMatches sub-structure, plus the prerequisite. An agent has everything it needs to invoke and interpret the result.

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%, so both parameters are already documented (typeName as fully qualified name, maxResults default 100). The description restates the typeName convention but adds no format or syntax detail beyond what the schema provides, matching the baseline for high coverage.

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?

States a precise verb and resource ('Find all throws declarations of an exception type in method signatures') and immediately scopes what counts ('All methods that declare throws ExceptionType'). It is distinguishable from siblings like find_catch_blocks or find_references without opening the schema.

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?

Provides a 'Useful for' list of concrete scenarios and the hard prerequisite 'Requires load_project to be called first', plus the JDT-vs-LSP differentiation. It stops short of naming sibling tools that might be mistaken for it, so no explicit when-not guidance.

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