Skip to main content
Glama
mdz-axo

PT-MCP (Paul Test Man Context Protocol)

by mdz-axo

analyze_dependencies

Analyze and map dependencies in codebases to identify internal module relationships and external package dependencies for better project understanding.

Instructions

Analyze and map internal and external dependencies

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesRoot directory path
include_externalNoInclude external package dependencies
include_internalNoInclude internal module dependencies
max_depthNoMaximum dependency depth to traverse

Implementation Reference

  • Core handler function that executes the analyze_dependencies tool: destructures args, initializes dependency graph, analyzes external/internal deps, detects cycles, enriches with KG, stores RDF, formats markdown results.
    export async function analyzeDependencies( args: AnalyzeDependenciesArgs ): Promise<{ content: Array<{ type: string; text: string }> }> { const { path, include_external = true, include_internal = true, max_depth = 5, } = args; const graph: DependencyGraph = { nodes: new Map(), edges: [], circular: [], orphans: [], stats: { total_external: 0, total_internal: 0, max_depth: 0, circular_count: 0, }, }; // Analyze external dependencies (from package.json) if (include_external) { await analyzeExternalDependencies(path, graph); } // Analyze internal dependencies (import/require statements) if (include_internal) { await analyzeInternalDependencies(path, graph, max_depth); } // Detect circular dependencies detectCircularDependencies(graph); // Enrich with knowledge graph await enrichDependenciesWithKG(graph); // Store in database as RDF triples await storeDependencyGraph(graph); // Format results const results = formatDependencyResults(graph); return { content: [ { type: 'text', text: results, }, ], }; }
  • TypeScript interface defining input parameters for the analyze_dependencies tool handler.
    interface AnalyzeDependenciesArgs { path: string; include_external?: boolean; include_internal?: boolean; max_depth?: number; }
  • Registration of analyze_dependencies tool in the CallToolRequestSchema switch dispatcher: imports and calls the handler function.
    case "analyze_dependencies": return await analyzeDependencies(args as any);
  • src/index.ts:223-251 (registration)
    Tool registration in ListToolsRequestSchema response: defines name, description, and inputSchema for analyze_dependencies.
    { name: "analyze_dependencies", description: "Analyze and map internal and external dependencies", inputSchema: { type: "object", properties: { path: { type: "string", description: "Root directory path", }, include_external: { type: "boolean", description: "Include external package dependencies", default: true, }, include_internal: { type: "boolean", description: "Include internal module dependencies", default: true, }, max_depth: { type: "number", description: "Maximum dependency depth to traverse", default: 5, }, }, required: ["path"], }, },
  • Compiled TypeScript declaration for AnalyzeDependenciesArgs interface (schema).
    interface AnalyzeDependenciesArgs { path: string; include_external?: boolean; include_internal?: boolean; max_depth?: number; } export declare function analyzeDependencies(args: AnalyzeDependenciesArgs): Promise<{ content: Array<{ type: string; text: string; }>; }>; export {}; //# sourceMappingURL=analyze-dependencies.d.ts.map

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/mdz-axo/pt-mcp'

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