Skip to main content
Glama

repo

Find the repository URL for any npm package to access its source code and documentation.

Instructions

Get the repository URL for a package

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
packageYesPackage name

Implementation Reference

  • The implementation of the 'repo' tool, which retrieves the repository URL for a package using 'npm repo'.
    server.tool(
      "repo",
      "Get the repository URL for a package",
      {
        package: z.string().describe("Package name"),
      },
      async ({ package: pkg }) => {
        const args = ["repo", pkg, "--no-browser"];
        try {
          const { stdout, stderr } = await run(args);
          return { content: [{ type: "text", text: (stdout + stderr).trim() }] };
        } catch (e: any) {
          return {
            content: [{ type: "text", text: `Error: ${e.stderr || e.message}` }],
            isError: true,
          };
        }
      },
    );

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/mikusnuz/npm-mcp'

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