Skip to main content
Glama

find_hook_usages

Search a React project for every usage of a specific hook, returning a summary, file distribution, and up to 10 code locations. Filter results by file path or component to pinpoint relevant usages.

Instructions

Find all usages of a React hook across the codebase. Returns summary (totalUsages, filesCount), distribution by path, and limited usages (default: 10). Use filePath/component filters to drill down.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax usages to return (default: 10, max: 50)
excludeNoFile patterns to exclude
includeNoFile patterns to include
filePathNoFilter to specific file or folder path (e.g., "src/app/sections/")
hookNameYesHook name to search for (e.g., "useState", "useQuery", "useAuth")
componentNoFilter to usages within specific component
projectPathYesRoot path of the project
Behavior4/5

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

No annotations are present, so the description carries the full burden. It discloses key behavioral aspects: returns summary (totalUsages, filesCount), distribution by path, and limits usages with a default of 10. This goes beyond the verb and gives useful output expectations.

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 two sentences: the first states purpose and return summary, the second gives filter guidance. No wasted words, with the most important information front-loaded.

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

Completeness3/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 should detail return values more thoroughly. It outlines the summary and distribution, but does not specify fields within individual usages (e.g., file path, line number). The limit default is mentioned but the maximum (50) is only in the schema. Adequate but with room for more detail.

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 baseline is 3. The description adds some semantic value by mentioning 'filePath/component filters' and the default limit, but it does not systematically explain each parameter beyond what the schema already provides.

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 all usages of a React hook across the codebase.' This clearly states the tool's function and distinguishes it from sibling tools like find_component_usages, which targets components.

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?

The phrase 'Use filePath/component filters to drill down' provides clear guidance on how to refine searches. While it does not explicitly mention alternatives or exclusions, the purpose statement makes the intended use case obvious.

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/paramhq/tsx-query'

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