Skip to main content
Glama
token-context-mcp

token-context-mcp

Module dependents

get_module_dependents
Read-onlyIdempotent

Retrieve a file or module’s lexical import graph—including imports, imported_by, and dynamic-import flags—to map direct dependencies and dependents before impact analysis.

Instructions

File/module lexical import graph (imports & imported_by) for one path or module; flags dynamic imports. Fails if unindexed. For symbol call edges, use get_impact_slice instead.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "repo_id": "<repo_id>"
    },
    "name": "get_module_dependents"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoIndexed repository-relative file path; pass exactly one of path or module (providing both or neither errors).
moduleNoModule/package name (1-200 safe chars); pass exactly one of path or module (providing both or neither errors).
profileNoNamed budget profile preset ('locate', 'orient', 'impact', 'read'); defaults to 'impact'.
repo_idYesRegistered repository ID from list_repositories (never a filesystem path).
max_tokensNoToken cap for the response (32 to max_result_tokens); defaults to 'impact' profile budget and reports omissions in omitted_count.

Output Schema

NameRequiredDescriptionDefault
dataNoLexical import and importer relationships for the requested path or module.
errorNoPresent when the tool call fails (either a structured {code, message, details} object or a diagnostic string).
budgetNoToken budget accounting for this response.
repo_idNoRegistered repository identifier.
evidenceNoSource-verified file line spans and SHA-256 hashes backing the response.
warningsNoFreshness, ambiguity, redaction, or security warnings.
freshnessNoIndex freshness state ('fresh', 'pending', 'stale', or 'unknown').
truncatedNoTrue if items were omitted due to budget or node limits.
ledger_revNoCurrent evidence ledger revision for repo_id.
completenessNoCoverage/resolution completeness indicator.
index_run_idNoIdentifier of the active index snapshot run.
schema_versionNoEnvelope schema version ('1.0').
untrusted_repository_contentNoTrue when payload embeds raw repository text.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.3.8
    • changedInput schema / properties / max_tokens / description
      Previous value: -"Maximum token budget for the response (32 to max_result_tokens)."New value: +"Token cap for the response (32 to max_result_tokens); defaults to 'impact' profile budget and reports omissions in omitted_count."
    • changedInput schema / properties / module / description
      Previous value: -"Module or package identifier to find importers and imports for (provide module or path)."New value: +"Module/package name (1-200 safe chars); pass exactly one of path or module (providing both or neither errors)."
    • changedInput schema / properties / path / description
      Previous value: -"Repository-relative file path to inspect imports for (provide path or module)."New value: +"Indexed repository-relative file path; pass exactly one of path or module (providing both or neither errors)."
    • changedInput schema / properties / profile / description
      Previous value: -"Named budget profile ('locate', 'orient', 'impact', 'read'); defaults to 'impact'."New value: +"Named budget profile preset ('locate', 'orient', 'impact', 'read'); defaults to 'impact'."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "budget": {
      +      "additionalProperties": true,
      +      "description": "Token budget accounting for this response.",
      +      "properties": {
      +        "envelope_reserve": {
      +          "description": "Wire-framing token reserve when budget >= 512.",
      +          "type": "integer"
      +        },
      +        "estimated_tokens": {
      +          "description": "Estimated serialized response tokens.",
      +          "type": "integer"
      +        },
      +        "requested_tokens": {
      +          "description": "Requested or profile-default token budget.",
      +          "type": "integer"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "completeness": {
      +      "additionalProperties": true,
      +      "description": "Coverage/resolution completeness indicator.",
      +      "properties": {
      +        "basis": {
      +          "description": "How completeness was computed.",
      +          "type": "string"
      +        },
      +        "value": {
      +          "description": "Completeness ratio in [0.0, 1.0], or null if N/A.",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "data": {
      +      "additionalProperties": true,
      +      "description": "Lexical import and importer relationships for the requested path or module.",
      +      "properties": {
      +        "basis": {
      +          "description": "Extraction basis ('lexical_import_statements').",
      +          "type": "string"
      +        },
      +        "estimator_version": {
      +          "description": "Token estimator version.",
      +          "type": "string"
      +        },
      +        "imported_by": {
      +          "description": "Indexed paths that lexically import this path/module.",
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "imports": {
      +          "description": "Modules imported by matched_paths.",
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "matched_paths": {
      +          "description": "Indexed file paths matching the query.",
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "omitted_count": {
      +          "description": "Count of import entries omitted due to budget.",
      +          "type": "integer"
      +        },
      +        "query": {
      +          "additionalProperties": {
      +            "type": "string"
      +          },
      +          "description": "Normalized lookup key ({'path': ...} or {'module': ...}).",
      +          "type": "object"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "error": {
      +      "additionalProperties": true,
      +      "description": "Present when the tool call fails (either a structured {code, message, details} object or a diagnostic string).",
      +      "properties": {
      +        "code": {
      +          "description": "Machine-readable error code.",
      +          "type": "string"
      +        },
      +        "details": {
      +          "description": "Optional structured metadata for the error.",
      +          "type": "object"
      +        },
      +        "message": {
      +          "description": "Human-readable error explanation.",
      +          "type": "string"
      +        }
      +      },
      +      "type": [
      +        "object",
      +        "string"
      +      ]
      +    },
      +    "evidence": {
      +      "description": "Source-verified file line spans and SHA-256 hashes backing the response.",
      +      "items": {
      +        "additionalProperties": true,
      +        "properties": {
      +          "end_line": {
      +            "description": "1-based end line in source.",
      +            "type": "integer"
      +          },
      +          "path": {
      +            "description": "Repository-relative file path.",
      +            "type": "string"
      +          },
      +          "sha256": {
      +            "description": "12-character hex prefix of indexed file SHA-256.",
      +            "type": "string"
      +          },
      +          "start_line": {
      +            "description": "1-based start line in source.",
      +            "type": "integer"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "freshness": {
      +      "description": "Index freshness state ('fresh', 'pending', 'stale', or 'unknown').",
      +      "type": "string"
      +    },
      +    "index_run_id": {
      +      "description": "Identifier of the active index snapshot run.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "ledger_rev": {
      +      "description": "Current evidence ledger revision for repo_id.",
      +      "type": "integer"
      +    },
      +    "repo_id": {
      +      "description": "Registered repository identifier.",
      +      "type": "string"
      +    },
      +    "schema_version": {
      +      "description": "Envelope schema version ('1.0').",
      +      "type": "string"
      +    },
      +    "truncated": {
      +      "description": "True if items were omitted due to budget or node limits.",
      +      "type": "boolean"
      +    },
      +    "untrusted_repository_content": {
      +      "description": "True when payload embeds raw repository text.",
      +      "type": "boolean"
      +    },
      +    "warnings": {
      +      "description": "Freshness, ambiguity, redaction, or security warnings.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed5 schema fields changedv0.3.7
    • addedInput schema / properties / max_tokens / description
      Added value: +"Maximum token budget for the response (32 to max_result_tokens)."
    • addedInput schema / properties / module / description
      Added value: +"Module or package identifier to find importers and imports for (provide module or path)."
    • addedInput schema / properties / path / description
      Added value: +"Repository-relative file path to inspect imports for (provide path or module)."
    • addedInput schema / properties / profile / description
      Added value: +"Named budget profile ('locate', 'orient', 'impact', 'read'); defaults to 'impact'."
    • addedInput schema / properties / repo_id / description
      Added value: +"Registered repository ID from list_repositories (never a filesystem path)."
  3. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare this as a read-only, idempotent, non-destructive local operation, so the bar is lower. The description adds genuine behavioral context on top: it flags dynamic imports and warns that unindexed repos cause failure, which the annotations do not convey.

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?

Three compact clauses with no filler: what it returns, its failure mode, and its alternative are all front-loaded. Every sentence carries distinct information.

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?

For a 5-parameter read tool with full schema coverage, annotations, and an output schema, the description covers purpose, failure mode, and sibling routing. The only unaddressed element is when to prefer path versus module, which the schema already handles.

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 every parameter (path, module, profile, repo_id, max_tokens) is already documented in structured form, including the exactly-one-of rule that the description only restates. No additional format or syntax guidance is offered beyond the schema.

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 and resource: a lexical import graph returning imports and imported_by for a single path or module, plus dynamic-import flagging. It explicitly separates itself from get_impact_slice, which handles symbol call edges, so an agent can choose between them without inspecting schemas.

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?

Gives an explicit when-not: use get_impact_slice for symbol call edges, and a precondition ('Fails if unindexed') that steers the agent toward index status checks. It leaves the path-vs-module choice to the schema, which already states the exactly-one rule.

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