Skip to main content
Glama

analyze_imports

Find what imports a file, detect unused exports, and identify circular dependencies by analyzing import/export relationships. Uses a cached graph for fast repeated queries.

Instructions

Analyze import/export relationships for a file. Find what imports this file (importedBy), detect unused exports, and circular dependencies. Uses cached import graph for fast subsequent queries. Returns summary + limited results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax results per category (default: 10, max: 50)
excludeNoFile patterns to exclude
includeNoFile patterns to include
filePathYesFile to analyze (relative to project root)
directionNoWhat to analyze: imports (what this file imports), importedBy (what imports this file), or both (default: both)
projectPathYesRoot path of the project
includeUnusedNoInclude unused exports analysis - exports not imported by any file in the project (default: true)
detectCircularNoDetect circular dependencies involving this file (default: true)
Behavior3/5

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

With no annotations provided, the description must carry the behavioral disclosure burden. It does reveal key behaviors: it uses a cached import graph and returns 'summary + limited results,' which implies truncation. However, it does not explicitly state read-only behavior, potential staleness of the cache, or how to refresh it, nor does it clarify what 'limited' means beyond a limit parameter.

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 three sentences, each earning its place: the first states purpose, the second lists key capabilities, and the third adds behavioral details about caching and output scope. It is front-loaded, efficient, and free of fluff or redundancy.

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?

Despite a rich schema (8 parameters) and clear purpose, there is no output schema, so the description's mention of 'Returns summary + limited results' offers only vague insight into the return value. The description omits details about result structure, pagination, or how caching affects freshness. While the schema fills in parameter details, the lack of output schema and limited return description leave gaps.

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?

The input schema has 100% coverage, documenting all 8 parameters with descriptions, enums, and defaults. The description adds little beyond high-level mentions of importedBy, unused exports, and circular dependencies, which are already in the schema. Since the schema carries the full detail, a baseline score of 3 is appropriate.

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: 'Analyze import/export relationships for a file.' It explicitly mentions specific capabilities—importedBy, unused exports, and circular dependencies—which distinguishes it from sibling tools like find_component_usages or trace_prop_flow. The verb 'analyze' combined with the resource 'import/export relationships' is specific and unambiguous.

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 analyzing imports/exports) and even hints at repeated use via caching ('Uses cached import graph for fast subsequent queries'), but it does not explicitly state exclusions or alternatives. No reference to sibling tools or scenarios where another tool would be more appropriate.

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