Skip to main content
Glama
ecosyste-ms

Ecosyste.ms Package Data

Official
by ecosyste-ms

lookup_package

Find package metadata by PURL or GitHub URL to access ecosystem data across 40+ registries, including versions, dependencies, and security information.

Instructions

Find packages by PURL (pkg:npm/lodash) or GitHub URL. Use when given a package URL or repo link instead of ecosystem+name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
purlNoPackage URL, e.g. pkg:npm/lodash, pkg:pypi/requests
ecosystemNoPackage ecosystem
nameNoPackage name
repository_urlNoGitHub/GitLab URL to find associated packages

Implementation Reference

  • index.js:47-73 (handler)
    Core handler function executing the lookup_package tool logic: handles PURL parsing, local DB lookup, fallback to API for package info.
    async function lookupPackage(args) {
      if (args.purl) {
        const local = getPackageByPurl(args.purl);
        if (local) return { source: "local", ...local };
    
        const parsed = parsePurl(args.purl);
        if (parsed) {
          return getPackage(parsed.ecosystem, parsed.name);
        }
    
        const results = await fetchAPI("/packages/lookup", { purl: args.purl });
        return { source: "api", data: results };
      }
    
      if (args.ecosystem && args.name) {
        return getPackage(args.ecosystem, args.name);
      }
    
      if (args.repository_url) {
        const results = await fetchAPI("/packages/lookup", {
          repository_url: args.repository_url,
        });
        return { source: "api", data: results };
      }
    
      throw invalidInput("Provide ecosystem+name, purl, or repository_url");
    }
  • Input schema and metadata definition for the lookup_package tool.
    {
      name: "lookup_package",
      description:
        "Find packages by PURL (pkg:npm/lodash) or GitHub URL. Use when given a package URL or repo link instead of ecosystem+name.",
      inputSchema: {
        type: "object",
        properties: {
          purl: {
            type: "string",
            description: "Package URL, e.g. pkg:npm/lodash, pkg:pypi/requests",
          },
          ecosystem: { type: "string", description: "Package ecosystem" },
          name: { type: "string", description: "Package name" },
          repository_url: {
            type: "string",
            description: "GitHub/GitLab URL to find associated packages",
          },
        },
      },
    },
  • index.js:85-94 (registration)
    Tool dispatch/registration in the main handleToolCall switch statement, invoking the handler and formatting output.
    case "lookup_package": {
      const result = await lookupPackage(args);
      if (result.source === "local") {
        return formatPackage(result);
      }
      if (Array.isArray(result.data)) {
        return result.data.map(formatPackage).join("\n\n---\n\n");
      }
      return formatPackage(result.data);
    }
  • Helper function used by lookup_package for fetching package data from local DB or API.
    async function getPackage(ecosystem, name) {
      const local = getPackageFromDb(ecosystem, name);
      if (local) return { source: "local", ...local };
    
      const registry = ecosystemToRegistry(ecosystem);
      if (!registry) throw invalidEcosystem(ecosystem);
    
      const encodedName = encodeURIComponent(name);
      const data = await fetchAPI(`/registries/${registry}/packages/${encodedName}`);
      return { source: "api", data };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states what the tool does, not how it behaves. It doesn't disclose whether this is a read-only operation, what happens with multiple matches, error conditions, rate limits, or authentication needs. For a lookup tool with zero annotation coverage, this leaves significant behavioral gaps.

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?

Two concise sentences with zero waste. The first states the purpose and inputs, the second provides usage guidance. Every word earns its place, and the information is front-loaded appropriately.

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?

For a lookup tool with 4 parameters, 100% schema coverage, but no annotations or output schema, the description provides adequate purpose and usage guidance but lacks behavioral context. It's complete enough for basic understanding but leaves gaps about how the tool actually behaves and what it returns.

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?

Schema description coverage is 100%, so the schema already documents all 4 parameters. The description mentions PURL and GitHub URL, which maps to purl and repository_url parameters, but doesn't add meaningful semantics beyond what the schema provides. The baseline of 3 is appropriate when schema does the heavy lifting.

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

Purpose5/5

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

The description clearly states the verb 'Find' and resource 'packages', specifies the input types (PURL or GitHub URL), and distinguishes from siblings by indicating this is for when given a URL instead of ecosystem+name. This provides specific differentiation from tools like get_package that likely use different parameters.

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

Usage Guidelines5/5

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

The description explicitly states 'Use when given a package URL or repo link instead of ecosystem+name', providing clear when-to-use guidance and implicitly suggesting alternatives (ecosystem+name based tools like get_package). This gives the agent specific context for tool selection.

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/ecosyste-ms/mcp'

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