Skip to main content
Glama
bsmi021

Node Omnibus MCP Server

by bsmi021

install_packages

Install npm packages with version management in Node.js projects to manage dependencies and development tools.

Instructions

Install npm packages with version management

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
packagesYesPackage names to install
pathYesProject directory path
devNoInstall as dev dependency

Implementation Reference

  • The main handler function that executes the installation of npm packages in the specified project directory. It validates the path, checks for package.json, runs 'npm install' with optional --save-dev flag, and returns success message with output.
    private async handleInstallPackages(args: InstallPackageArgs) {
        await this.validatePath(args.path);
    
        try {
            // Verify package.json exists
            const packageJsonPath = path.join(args.path, 'package.json');
            await fs.access(packageJsonPath);
    
            // Install packages
            const installCmd = `npm install ${args.dev ? '--save-dev' : ''} ${args.packages.join(' ')}`;
            const { stdout, stderr } = await execAsync(installCmd, { cwd: args.path });
    
            return {
                content: [
                    {
                        type: 'text',
                        text: `Packages installed successfully:\n${stdout}\n${stderr}`,
                    },
                ],
            };
        } catch (error) {
            throw new McpError(
                ErrorCode.InternalError,
                `Failed to install packages: ${error instanceof Error ? error.message : String(error)}`
            );
        }
    }
  • TypeScript interface defining the input arguments for the install_packages tool: array of packages, project path, and optional dev flag.
    interface InstallPackageArgs extends Record<string, unknown> {
        packages: string[];
        path: string;
        dev?: boolean;
    }
  • src/index.ts:249-272 (registration)
    Tool registration in the ListTools response, including name, description, and detailed inputSchema for MCP protocol compliance.
    {
        name: 'install_packages',
        description: 'Install npm packages with version management',
        inputSchema: {
            type: 'object',
            properties: {
                packages: {
                    type: 'array',
                    items: { type: 'string' },
                    description: 'Package names to install',
                },
                path: {
                    type: 'string',
                    description: 'Project directory path',
                },
                dev: {
                    type: 'boolean',
                    description: 'Install as dev dependency',
                    default: false,
                },
            },
            required: ['packages', 'path'],
        },
    },
  • src/index.ts:397-398 (registration)
    Dispatch case in the CallToolRequest handler that routes 'install_packages' calls to the specific handler function.
    case 'install_packages':
        return await this.handleInstallPackages(args as InstallPackageArgs);
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. While 'Install' implies a mutation/write operation, the description doesn't specify critical behaviors like whether it requires specific permissions, if it modifies package.json/package-lock.json, potential side effects, or error handling. The phrase 'with version management' adds some context but is vague about what that entails.

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 directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, with every part earning its place by conveying essential information about the action and context.

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 installing npm packages (a mutation operation with potential side effects), no annotations, and no output schema, the description is incomplete. It lacks details on behavioral traits, error conditions, return values, or how it interacts with the project environment. For a tool with 3 parameters and significant implications, this minimal description is insufficient.

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 schema description coverage is 100%, meaning all parameters are documented in the schema itself. The description doesn't add any additional meaning beyond what's in the schema (e.g., it doesn't explain parameter interactions or provide examples). 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.

Purpose4/5

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

The description clearly states the action ('Install') and target ('npm packages') with additional context ('with version management'), which provides a specific verb+resource combination. However, it doesn't explicitly distinguish this tool from sibling tools like 'add_script' or 'create_project', which might also involve package management in different contexts.

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. There are no explicit when/when-not instructions, no mention of prerequisites (like needing Node.js/npm installed), and no comparison to sibling tools that might handle related tasks like 'add_script' or 'create_project'.

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/bsmi021/mcp-node-omnibus-server'

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