Skip to main content
Glama

find_annotation_usages

Locate all instances where a specific Java annotation is used in your project to understand its application and dependencies.

Instructions

Find all usages of an annotation type in the project.

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

USAGE: Provide fully qualified annotation name OUTPUT: All locations where the annotation is applied

Examples:

  • find_annotation_usages(annotation="org.springframework.beans.factory.annotation.Autowired")

  • find_annotation_usages(annotation="org.junit.jupiter.api.Test")

  • find_annotation_usages(annotation="javax.persistence.Entity")

Requires load_project to be called first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
annotationYesFully qualified annotation type name (e.g., 'org.springframework.beans.factory.annotation.Autowired')
maxResultsNoMaximum results to return (default 100)
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior: it performs a search operation (implied read-only, non-destructive), specifies the output format ('All locations where the annotation is applied'), and mentions a technical constraint ('JDT-UNIQUE'). However, it doesn't detail potential limitations like performance impacts or error conditions, which keeps it from a perfect score.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded, with the core purpose in the first sentence. Each subsequent section (JDT-UNIQUE note, usage instructions, examples, prerequisite) adds necessary information without redundancy. It's appropriately sized for a tool with two parameters and clear use cases.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (search operation with two parameters), no annotations, and no output schema, the description is largely complete: it covers purpose, usage, prerequisites, and output format. However, it lacks details on the exact structure of the returned locations (e.g., file paths, line numbers), which would be helpful since there's no output schema. This minor gap prevents a perfect score.

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 description coverage is 100%, providing full documentation for both parameters. The description adds minimal value beyond the schema: it reiterates the 'annotation' parameter requirement with examples but doesn't explain 'maxResults' or add syntax details. This meets the baseline of 3, as the schema does the heavy lifting.

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's purpose with a specific verb ('Find') and resource ('all usages of an annotation type in the project'), distinguishing it from siblings like 'find_references' or 'find_implementations' by focusing specifically on annotation usages. The title 'null' is not a factor, as the description fully compensates.

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 usage guidance: it specifies when to use (for fine-grained annotation searches not available in LSP), includes a prerequisite ('Requires load_project to be called first'), and distinguishes it from alternatives by noting it's 'JDT-UNIQUE' compared to LSP tools. This covers when, when-not, and prerequisites comprehensively.

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/pzalutski-pixel/javalens-mcp'

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