Skip to main content
Glama

gograph_imports

Read-onlyIdempotent

Find all files and packages importing a specific Go package by exact import path. Trace usage before removal or replacement, or identify internal package consumers.

Instructions

Find all files and packages in the codebase that import a specific package by its exact import path. The MCP server checks freshness before this call and refreshes in the current requested analysis mode; precise and precise_fallback graphs retry CHA/SSA after source changes. Read-only; no side effects. WHEN TO USE: When isolating usage of a third-party library before removing or replacing it, or tracing where an internal package is consumed from outside. NOT TO USE: For a package's own outgoing imports (use gograph_deps); for reverse package-level dependency lookup by short name (use gograph_dependents). RETURNS: File paths and package names of all importers; empty when the package is imported nowhere.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum rows per page; the byte budget may return fewer.
cursorNoOpaque next_cursor for the same graph snapshot and result selection.
packageYesThe exact import path of the target package to trace imports for (e.g., 'github.com/redis/go-redis')

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.7.5
    • addedInput schema / properties / cursor
      Added value: +{
      +  "description": "Opaque next_cursor for the same graph snapshot and result selection.",
      +  "maxLength": 128,
      +  "type": "string"
      +}
    • addedInput schema / properties / limit
      Added value: +{
      +  "default": 100,
      +  "description": "Maximum rows per page; the byte budget may return fewer.",
      +  "maximum": 200,
      +  "minimum": 1,
      +  "type": "integer"
      +}
  2. Addedv1.5.4
  3. Removedv1.5.3
  4. Changed1 schema field changedv1.4.70
    • changedInput schema / properties / package / description
      Previous value: -"The name of the package (e.g., 'github.com/redis/go-redis')"New value: +"The exact import path of the target package to trace imports for (e.g., 'github.com/redis/go-redis')"
  5. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false, openWorldHint=false. The description adds genuinely new context: the server checks freshness before the call, refreshes in the requested analysis mode, and precise/precise_fallback graphs retry CHA/SSA after source changes. The 'read-only; no side effects' line merely restates annotations, but the freshness/retry behavior is valuable. A 4 fits given annotations carry the safety profile.

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?

Front-loads the core purpose, then structures WHEN/NOT-TO-USE and RETURNS cleanly. Dense but every section earns its place; slightly long due to the freshness/CHA-SSA detail, but not padded.

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?

No output schema exists, but the description supplies a RETURNS section (file paths, package names, empty when unused) and covers the freshness/refresh behavior an agent needs to interpret results. Sufficient for correct invocation.

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%; the package, limit, and cursor params are all documented in the schema, and the description's 'exact import path' wording reinforces the package format. It adds little beyond the schema, so the baseline 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?

States a specific verb+resource+scope: 'Find all files and packages that import a specific package by its exact import path.' It explicitly names the siblings it is not (gograph_deps for outgoing imports, gograph_dependents for short-name reverse lookup), so an agent can disambiguate without opening either schema.

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

Usage Guidelines5/5

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

Contains explicit WHEN TO USE ('isolating usage of a third-party library before removing/replacing it, or tracing where an internal package is consumed from outside') and NOT TO USE clauses that route to gograph_deps and gograph_dependents. Nothing is left to inference.

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