Skip to main content
Glama
ember-tooling

Ember MCP Server

get_npm_package_info

Retrieve npm package details like version, dependencies, and maintainers to inform dependency upgrades in Ember.js projects.

Instructions

Get comprehensive information about an npm package including latest version, description, dependencies, maintainers, and more. Essential for understanding package details before upgrading dependencies.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
packageNameYesName of the npm package (e.g., 'ember-source', '@glimmer/component', 'ember-cli')

Implementation Reference

  • The primary handler function that processes the tool call, fetches NPM package data using NpmService, formats it into a comprehensive Markdown response including description, versions, dependencies, metadata, and more.
    async handleGetNpmPackageInfo(args) {
      const { packageName } = args;
    
      try {
        const packageInfo = await this.npmService.getPackageInfo(packageName);
        const formatted = this.npmService.formatPackageInfo(packageInfo);
    
        let text = `# ${formatted.name}\n\n`;
        text += `**Description:** ${formatted.description}\n\n`;
        text += `**Latest Version:** ${formatted.latestVersion}\n\n`;
    
        // Dist tags
        if (Object.keys(formatted.distTags).length > 0) {
          text += `**Distribution Tags:**\n`;
          for (const [tag, version] of Object.entries(formatted.distTags)) {
            text += `  - ${tag}: ${version}\n`;
          }
          text += `\n`;
        }
    
        // Metadata
        if (formatted.license) {
          text += `**License:** ${formatted.license}\n`;
        }
        if (formatted.author) {
          text += `**Author:** ${formatted.author}\n`;
        }
        if (formatted.homepage) {
          text += `**Homepage:** ${formatted.homepage}\n`;
        }
        if (formatted.repository) {
          text += `**Repository:** ${formatted.repository}\n`;
        }
    
        // Keywords
        if (formatted.keywords.length > 0) {
          text += `\n**Keywords:** ${formatted.keywords.join(', ')}\n`;
        }
    
        // Dependencies
        const depCount = Object.keys(formatted.dependencies).length;
        const devDepCount = Object.keys(formatted.devDependencies).length;
        const peerDepCount = Object.keys(formatted.peerDependencies).length;
    
        if (depCount > 0 || devDepCount > 0 || peerDepCount > 0) {
          text += `\n**Dependencies:**\n`;
          if (depCount > 0) {
            text += `  - ${depCount} runtime dependencies\n`;
          }
          if (peerDepCount > 0) {
            text += `  - ${peerDepCount} peer dependencies\n`;
          }
          if (devDepCount > 0) {
            text += `  - ${devDepCount} dev dependencies\n`;
          }
        }
    
        // Engines
        if (Object.keys(formatted.engines).length > 0) {
          text += `\n**Engine Requirements:**\n`;
          for (const [engine, version] of Object.entries(formatted.engines)) {
            text += `  - ${engine}: ${version}\n`;
          }
        }
    
        // Dates
        if (formatted.created) {
          text += `\n**Created:** ${new Date(formatted.created).toLocaleDateString()}\n`;
        }
        if (formatted.lastPublished) {
          text += `**Last Published:** ${new Date(formatted.lastPublished).toLocaleDateString()}\n`;
        }
    
        // Maintainers
        if (formatted.maintainers.length > 0) {
          text += `\n**Maintainers:** ${formatted.maintainers.length} maintainer(s)\n`;
        }
    
        return {
          content: [
            {
              type: "text",
              text: text,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error fetching package information: ${error.message}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Input schema defining the expected parameters for the get_npm_package_info tool: a required 'packageName' string.
    inputSchema: {
      type: "object",
      properties: {
        packageName: {
          type: "string",
          description:
            "Name of the npm package (e.g., 'ember-source', '@glimmer/component', 'ember-cli')",
        },
      },
      required: ["packageName"],
    },
  • index.js:131-146 (registration)
    Registration of the 'get_npm_package_info' tool in the ListTools response, including name, description, and input schema.
    {
      name: "get_npm_package_info",
      description:
        "Get comprehensive information about an npm package including latest version, description, dependencies, maintainers, and more. Essential for understanding package details before upgrading dependencies.",
      inputSchema: {
        type: "object",
        properties: {
          packageName: {
            type: "string",
            description:
              "Name of the npm package (e.g., 'ember-source', '@glimmer/component', 'ember-cli')",
          },
        },
        required: ["packageName"],
      },
    },
  • Helper method in NpmService that fetches raw package information from the NPM registry API using node-fetch.
    async getPackageInfo(packageName) {
      try {
        const response = await fetch(`${this.registryUrl}/${packageName}`);
        
        if (!response.ok) {
          if (response.status === 404) {
            throw new Error(`Package "${packageName}" not found on npm registry`);
          }
          throw new Error(`Failed to fetch package info: ${response.statusText}`);
        }
    
        const data = await response.json();
        return data;
      } catch (error) {
        throw new Error(`Error fetching npm package info: ${error.message}`);
      }
    }
  • Helper method in NpmService that processes raw NPM package data into a formatted object with extracted fields like versions, metadata, dependencies, etc., used by the main handler.
    formatPackageInfo(packageInfo) {
      const latestVersion = packageInfo['dist-tags']?.latest;
      const latestVersionData = latestVersion ? packageInfo.versions[latestVersion] : null;
    
      return {
        name: packageInfo.name,
        description: packageInfo.description || 'No description available',
        latestVersion: latestVersion || 'Unknown',
        distTags: packageInfo['dist-tags'] || {},
        homepage: packageInfo.homepage || latestVersionData?.homepage || null,
        repository: packageInfo.repository?.url || latestVersionData?.repository?.url || null,
        license: latestVersionData?.license || 'Unknown',
        author: this.formatAuthor(packageInfo.author || latestVersionData?.author),
        maintainers: packageInfo.maintainers || [],
        keywords: latestVersionData?.keywords || [],
        dependencies: latestVersionData?.dependencies || {},
        devDependencies: latestVersionData?.devDependencies || {},
        peerDependencies: latestVersionData?.peerDependencies || {},
        engines: latestVersionData?.engines || {},
        lastPublished: packageInfo.time?.[latestVersion] || null,
        created: packageInfo.time?.created || null,
        modified: packageInfo.time?.modified || null,
      };
    }
Behavior3/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. It mentions the tool returns 'comprehensive information' and lists examples (latest version, description, dependencies, maintainers), which adds behavioral context. However, it doesn't disclose critical details like rate limits, authentication needs, error handling, or pagination behavior, leaving gaps for a read operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/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 purpose and usage. Every sentence adds value: the first defines the tool's function, and the second provides context. There's no wasted text, though it could be slightly more structured for clarity.

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 complexity (a read operation with one parameter) and lack of annotations and output schema, the description is moderately complete. It covers the purpose and usage context but misses behavioral details like return format, error cases, or limitations. Without an output schema, the description should ideally explain what 'comprehensive information' includes, but it only lists examples, leaving some ambiguity.

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 the parameter 'packageName' well-documented in the schema. The description doesn't add any parameter-specific details beyond what the schema provides, such as format constraints or examples. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but doesn't need to.

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 with specific verbs ('Get comprehensive information') and resources ('npm package'), and lists key information types (version, description, dependencies, maintainers). However, it doesn't explicitly differentiate from sibling tools like 'get_ember_version_info' or 'compare_npm_versions', which may also involve npm package information.

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 context ('Essential for understanding package details before upgrading dependencies'), which suggests when to use it. However, it lacks explicit guidance on when to choose this tool over alternatives like 'compare_npm_versions' or 'get_ember_version_info', and doesn't specify exclusions or prerequisites.

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/ember-tooling/ember-mcp'

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