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
| Name | Required | Description | Default |
|---|---|---|---|
| package | Yes | Package name |
Implementation Reference
- src/index.ts:620-638 (handler)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, }; } }, );