Skip to main content
Glama
gclluch
by gclluch

find_usages

Locate every occurrence of a Python identifier with surrounding code context, including reads, assignments, and imports. Get project-wide references across files or a clear note when unavailable.

Instructions

Find every occurrence of an identifier with surrounding source lines.

Covers reads, assignments, parameters, attribute access, imports and global/nonlocal declarations. Always reports a project-wide references section: either the cross-file hits, or that there are none, or that jedi is not installed and cross-file references were therefore not checked. An empty result and an unchecked one are not the same answer.

Args: path: Path to a .py file. identifier: Name to search for. context: Lines of context to show around each hit (default 1).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
contextNo
identifierYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries the transparency burden and does so well. It discloses that the tool always reports a project-wide references section, handles the case where jedi is not installed, and clarifies that an empty result differs from an unchecked one. This goes beyond a simple 'find' statement and gives the agent useful behavioral expectations.

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 clearly structured with a summary, a coverage list, a behavioral note, and an Args section. Each part adds information, though the project-wide behavior paragraph is slightly dense and could be tightened without losing 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 that an output schema exists, the description does not need to explain return values. It covers the tool's purpose, coverage, edge cases, and parameters. The main missing piece is explicit guidance on when to choose this over sibling tools, but overall the description is complete enough for an agent to use it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% parameter description coverage, but the description's Args section provides meaningful semantics for all three parameters: path is a .py file, identifier is the name to search for, and context is the number of lines around each hit. This fully compensates for the schema's lack of detail.

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 opens with a specific verb and resource: 'Find every occurrence of an identifier with surrounding source lines.' It also enumerates the kinds of usages covered (reads, assignments, parameters, attribute access, imports, global/nonlocal declarations), which clearly differentiates it from sibling tools like list_declarations or get_callers.

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?

The description implies when to use the tool (when you need all references to an identifier) but does not explicitly mention sibling tools or state when not to use it. No alternatives are named, so the agent must infer placement from the tool name and purpose alone.

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/gclluch/py-ast-mcp'

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