Skip to main content
Glama
transparentlyok

MCP Context Manager

get_dependencies

Analyze code dependencies by identifying imports and requires for files or specific symbols to understand what external code is needed.

Instructions

Find all dependencies (imports/requires) for a file or symbol. Useful for understanding what code needs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesFile path to analyze dependencies for
symbolNoOptional: specific symbol to trace dependencies for

Implementation Reference

  • The implementation of getDependencies, which retrieves imports and (if a symbol is specified) analyzes symbol usage within the file.
    async getDependencies(filePath: string, symbol?: string): Promise<any> {
      const fileIndex = this.indexer.getFileIndex(filePath);
    
      if (!fileIndex) {
        return {
          error: `File "${filePath}" not found in index.`,
        };
      }
    
      const result: any = {
        file: filePath,
        imports: fileIndex.imports,
        importCount: fileIndex.imports.length,
      };
    
      if (symbol) {
        // Find the symbol and analyze its dependencies
        const symbolObj = fileIndex.symbols.find((s) => s.name === symbol);
        if (symbolObj) {
          result.symbol = symbol;
          result.symbolType = symbolObj.type;
          result.usedSymbols = this.extractUsedSymbols(symbolObj.code, fileIndex.imports);
        } else {
          result.error = `Symbol "${symbol}" not found in ${filePath}`;
        }
      }
    
      return result;
  • src/index.ts:292-303 (registration)
    Registration of the 'get_dependencies' MCP tool.
    {
      name: 'get_dependencies',
      description: 'Find all dependencies (imports/requires) for a file or symbol. Useful for understanding what code needs.',
      inputSchema: {
        type: 'object',
        properties: {
          filePath: {
            type: 'string',
            description: 'File path to analyze dependencies for',
          },
          symbol: {
            type: 'string',
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the tool 'finds' dependencies, implying a read-only operation, but doesn't specify if it's cached, requires specific permissions, has rate limits, or what the output format looks like. For a tool with no annotations, this leaves significant gaps in understanding its behavior.

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 concise and front-loaded, with two sentences that efficiently convey the purpose and utility. Every word earns its place, avoiding redundancy or fluff, making it easy for an agent to parse quickly.

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?

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is adequate but incomplete. It covers the basic purpose and usage hint but lacks details on behavioral traits, output format, or error handling. With no annotations to fill gaps, the description should do more to be fully helpful for an agent.

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% description coverage, with clear documentation for 'filePath' and 'symbol.' The description adds minimal value beyond the schema, only implying that 'symbol' is optional and for tracing dependencies. Since the schema already covers parameters well, the baseline score of 3 is appropriate, as the description doesn't significantly enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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: 'Find all dependencies (imports/requires) for a file or symbol.' It specifies the verb ('Find') and resource ('dependencies'), and distinguishes it from siblings like 'find_symbol' or 'get_file_summary' by focusing on dependency analysis. However, it doesn't explicitly differentiate from all siblings (e.g., 'get_repository_structure' might also involve dependencies), so it's not a perfect 5.

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 provides implied usage guidance with 'Useful for understanding what code needs,' suggesting it's for code analysis contexts. It doesn't explicitly state when to use this tool versus alternatives like 'find_similar' or 'search_code,' nor does it mention prerequisites or exclusions. The guidance is helpful but not comprehensive.

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/transparentlyok/mcp-context-manager'

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