Skip to main content
Glama
code-alchemist01

Development Tools MCP Server

analyze_dependencies

Analyze project dependencies to identify unused packages, outdated versions, and security vulnerabilities for improved code quality and maintenance.

Instructions

Analyze project dependencies including unused, outdated, and vulnerable packages

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathNoPath to project root (defaults to current directory)
checkUnusedNoCheck for unused dependencies
checkOutdatedNoCheck for outdated packages
checkVulnerabilitiesNoCheck for security vulnerabilities
checkBundleSizeNoCheck bundle size

Implementation Reference

  • Core handler function implementing the logic to analyze project dependencies by parsing package.json and performing optional checks for unused deps, outdated packages, and vulnerabilities.
    async analyzeDependencies(
      projectPath: string = process.cwd(),
      options?: DependencyAnalysisOptions
    ): Promise<DependencyReport> {
      const packageJsonPath = join(projectPath, 'package.json');
      
      if (!existsSync(packageJsonPath)) {
        throw new Error('package.json not found');
      }
    
      const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
      const dependencies = this.extractDependencies(packageJson);
      
      const report: DependencyReport = {
        dependencies,
        unused: options?.checkUnused !== false ? await this.findUnusedDependencies(projectPath) : [],
        outdated: options?.checkOutdated !== false ? await this.findOutdatedPackages(packageJson) : [],
        vulnerabilities: options?.checkVulnerabilities !== false ? await this.findVulnerabilities(projectPath) : [],
        totalDependencies: dependencies.length,
      };
    
      return report;
    }
  • Tool-specific handler case within handleDependencyAnalysisTool that parses input arguments and invokes the core analyzer.
    case 'analyze_dependencies': {
      const options: DependencyAnalysisOptions = {
        checkUnused: params.checkUnused as boolean,
        checkOutdated: params.checkOutdated as boolean,
        checkVulnerabilities: params.checkVulnerabilities as boolean,
        checkBundleSize: params.checkBundleSize as boolean,
      };
      const report = await analyzer.analyzeDependencies(projectPath, options);
      return Formatters.formatDependencyReport(report);
    }
  • JSON Schema defining the input parameters for the analyze_dependencies tool.
    inputSchema: {
      type: 'object',
      properties: {
        projectPath: {
          type: 'string',
          description: 'Path to project root (defaults to current directory)',
        },
        checkUnused: {
          type: 'boolean',
          description: 'Check for unused dependencies',
          default: true,
        },
        checkOutdated: {
          type: 'boolean',
          description: 'Check for outdated packages',
          default: true,
        },
        checkVulnerabilities: {
          type: 'boolean',
          description: 'Check for security vulnerabilities',
          default: true,
        },
        checkBundleSize: {
          type: 'boolean',
          description: 'Check bundle size',
          default: false,
        },
      },
    },
  • Tool registration object defining name, description, and schema, exported as part of dependencyAnalysisTools array.
    {
      name: 'analyze_dependencies',
      description: 'Analyze project dependencies including unused, outdated, and vulnerable packages',
      inputSchema: {
        type: 'object',
        properties: {
          projectPath: {
            type: 'string',
            description: 'Path to project root (defaults to current directory)',
          },
          checkUnused: {
            type: 'boolean',
            description: 'Check for unused dependencies',
            default: true,
          },
          checkOutdated: {
            type: 'boolean',
            description: 'Check for outdated packages',
            default: true,
          },
          checkVulnerabilities: {
            type: 'boolean',
            description: 'Check for security vulnerabilities',
            default: true,
          },
          checkBundleSize: {
            type: 'boolean',
            description: 'Check bundle size',
            default: false,
          },
        },
      },
    },
  • src/server.ts:66-67 (registration)
    Main server dispatch registration routing calls to analyze_dependencies to the appropriate handler.
    } else if (dependencyAnalysisTools.some((t) => t.name === name)) {
      result = await handleDependencyAnalysisTool(name, args || {});
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 what the tool analyzes but doesn't describe execution behavior (e.g., runtime, permissions, output format, or side effects). For a tool with 5 parameters and no annotations, this is a significant gap in transparency.

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 a single, efficient sentence that front-loads the core purpose without unnecessary words. Every part earns its place by specifying the resource and analysis types, making it appropriately sized and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (5 parameters, no annotations, no output schema), the description is incomplete. It lacks details on behavioral traits, output format, and usage context relative to siblings, leaving gaps that could hinder an AI agent's ability to invoke it correctly.

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 description lists analysis categories (unused, outdated, vulnerable packages) that partially map to parameters like 'checkUnused', 'checkOutdated', and 'checkVulnerabilities', adding some meaning. However, with 100% schema description coverage, the schema already documents all parameters thoroughly, so the description provides only marginal value beyond the schema.

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 as analyzing project dependencies across three specific categories (unused, outdated, vulnerable packages). It uses a specific verb ('analyze') and resource ('project dependencies'), but doesn't explicitly differentiate from sibling tools like 'find_unused_dependencies' or 'check_vulnerabilities', which would require a 5.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. With many sibling tools like 'find_unused_dependencies', 'check_outdated_packages', and 'check_vulnerabilities', the description lacks explicit context for choosing this comprehensive tool over more specific ones, offering only implied usage through its broad scope.

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/code-alchemist01/development-tools-mcp-Server'

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