Skip to main content
Glama

find_annotation_usages

Find all locations where a given annotation is applied in your Java project. Specify the fully qualified annotation name to get precise usage locations.

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)
Behavior3/5

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

With no annotations, the description carries full burden. It mentions the prerequisite and output is 'all locations,' but omits read-only nature, output format details, and any side effects or performance implications.

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 brief (few sentences) and well-structured with labeled sections (JDT-UNIQUE, USAGE, OUTPUT, Examples, Requires). Every sentence contributes meaning.

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 no output schema, the description adequately covers purpose, parameters via examples, and a prerequisite. However, it lacks explicit mention of return value structure and potential error conditions.

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%, and the description adds value with examples of valid annotation names, clarifying the expected format beyond the schema. However, it does not elaborate on maxResults beyond the schema default.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states 'find all usages of an annotation type,' specifying both verb and resource. However, among siblings like find_references, it lacks explicit differentiation, relying on a JDT uniqueness claim versus LSP.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides usage instructions (provide fully qualified name) and a prerequisite (load_project), but does not guide when to use this tool over alternatives such as find_references or find_implementations.

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