Skip to main content
Glama

find_type_arguments

Find all usages of a type as a generic type argument, such as List or Map<K, Foo>, to understand generic usage patterns and locate every collection or container of that type.

Instructions

Find all usages of a type as a generic type argument (List, Map<K, Foo>).

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

USAGE: Provide fully qualified type name OUTPUT: All locations where the type is used as a generic argument

Useful for:

  • Understanding generic usage patterns

  • Finding all collections/containers of a type

  • API design 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 type name to find in generic arguments
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?

With no annotations, the description carries the full burden and does well: it discloses the important load_project prerequisite and explains the potentialMatches field's semantics, including that unresolved types are never counted as results. It omits nothing critical for a read-only search, though it doesn't address result limits or error behavior beyond the schema's maxResults.

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 front-loaded with purpose, then blocks for JDT-UNIQUE, USAGE, OUTPUT, and the potentialMatches detail. Each section serves a purpose, though the 'Useful for' bullets lightly echo the opening sentence and the potentialMatches paragraph is dense, keeping it just short of maximally tight.

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, the description must describe return values and it does: locations of generic-argument usages plus the nuanced potentialMatches structure. Combined with the load_project prerequisite and the LSP distinction, an agent has everything needed to invoke and interpret the tool correctly.

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%, so typeName and maxResults are already documented structurally. The description's 'Provide fully qualified type name' reinforces the typeName constraint but adds little beyond the schema, and maxResults is untouched. Baseline 3 applies when 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?

States a specific verb+resource with concrete syntax examples (List<Foo>, Map<K, Foo>), and explicitly positions itself against alternatives by noting it is not available in LSP and that it searches only generic-argument positions. An agent can distinguish it from find_references, find_type_instantiations, and find_casts without opening any 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?

Clear context is given via the 'USAGE' line and 'Useful for' scenarios, plus the JDT-UNIQUE note implying it covers ground other searches do not. However, it never names sibling tools as alternatives nor states explicit exclusions (e.g., 'use find_references for non-generic usages'), so the when-not guidance is only implied.

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