outdated
Check for outdated packages in a project to identify dependencies needing updates, ensuring project health and security.
Instructions
Check for outdated packages in a project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to the package directory | |
| global | No | Check global packages | |
| long | No | Show extended information |
Implementation Reference
- src/index.ts:353-373 (handler)The tool 'outdated' is registered and implemented directly in src/index.ts, using the 'run' helper to execute 'npm outdated' with appropriate arguments.
server.tool( "outdated", "Check for outdated packages in a project", { path: z.string().describe("Absolute path to the package directory"), global: z.boolean().optional().describe("Check global packages"), long: z.boolean().optional().describe("Show extended information"), }, async ({ path, global: isGlobal, long }) => { const args = ["outdated", "--json"]; if (isGlobal) args.push("-g"); if (long) args.push("--long"); try { const { stdout } = await run(args, path); return { content: [{ type: "text", text: stdout || "{}" }] }; } catch (e: any) { // npm outdated exits non-zero when outdated packages found return { content: [{ type: "text", text: e.stdout || e.stderr || e.message }] }; } }, );