Skip to main content
Glama

install_dependencies

Install project dependencies using npm, yarn, or pnpm to prepare development environments for building and testing applications.

Instructions

Install project dependencies

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
managerNoPackage manager to usenpm
directoryNoDirectory to install dependencies in (default: current directory)

Implementation Reference

  • Implements the core logic for installing dependencies using the specified package manager (npm, yarn, or pnpm) via execSync in the target directory, with timeout and error handling.
    private async installDependencies(args: any) {
      const manager = args?.manager || 'npm';
      const directory = args?.directory || process.cwd();
      const command = `${manager} install`;
      
      try {
        const output = execSync(command, { 
          cwd: directory, 
          encoding: 'utf8',
          timeout: 600000 // 10 minutes
        });
        
        return {
          content: [
            {
              type: 'text',
              text: `Dependencies installed successfully!\nCommand: ${command}\nDirectory: ${directory}\nOutput:\n${output}`
            }
          ]
        };
      } catch (error: any) {
        throw new Error(`Dependency installation failed: ${error.message}\nStderr: ${error.stderr || 'N/A'}`);
      }
    }
  • src/index.ts:94-112 (registration)
    Registers the 'install_dependencies' tool in the ListToolsRequestHandler response, defining its name, description, and input schema.
    {
      name: 'install_dependencies',
      description: 'Install project dependencies',
      inputSchema: {
        type: 'object',
        properties: {
          manager: {
            type: 'string',
            description: 'Package manager to use',
            enum: ['npm', 'yarn', 'pnpm'],
            default: 'npm'
          },
          directory: {
            type: 'string',
            description: 'Directory to install dependencies in (default: current directory)'
          }
        }
      }
    },
  • Defines the input schema for the tool, specifying properties for package manager and directory with types, descriptions, enum, and defaults.
    inputSchema: {
      type: 'object',
      properties: {
        manager: {
          type: 'string',
          description: 'Package manager to use',
          enum: ['npm', 'yarn', 'pnpm'],
          default: 'npm'
        },
        directory: {
          type: 'string',
          description: 'Directory to install dependencies in (default: current directory)'
        }
      }
  • Dispatcher switch case that routes CallToolRequest for 'install_dependencies' to the handler function.
    case 'install_dependencies':
      return await this.installDependencies(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. 'Install project dependencies' implies a write operation that modifies the project environment, but it doesn't disclose critical traits such as whether it requires network access, has side effects (e.g., modifying node_modules), potential errors (e.g., missing package.json), or output behavior. This is a significant gap for a mutation tool with zero annotation coverage.

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 with zero waste. It is front-loaded and directly states the tool's purpose without unnecessary elaboration. Every word earns its place, making it highly concise and well-structured for quick understanding.

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 complexity of a dependency installation tool (a mutation operation with potential side effects), the description is incomplete. No annotations or output schema exist to cover behavioral aspects, and the description fails to address critical context like prerequisites, error handling, or what 'install' entails. This leaves significant gaps for an agent to use the tool correctly and safely.

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 both parameters ('manager' and 'directory'), including enums and defaults. The description adds no additional meaning beyond what the schema provides, such as explaining how parameters interact or typical use cases. With high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Install project dependencies' clearly states the verb ('Install') and resource ('project dependencies'), making the purpose understandable. However, it lacks specificity about what 'install' entails (e.g., installing from package.json) and doesn't distinguish it from sibling tools like 'check_package_json' or 'run_build', which might involve similar contexts. This makes it vague but not tautological.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a package.json file), exclusions, or how it relates to siblings like 'run_build' (which might include dependency installation). Without any context for usage, it leaves the agent to infer based on the tool name alone.

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/TeodorTrotea/mcptest'

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