check_compatibility
Check if a combination of package versions is verified to work together. Resolve version conflicts before pinning a stack or recommending a version matrix. Returns compatibility status, conflicts list, and notes.
Instructions
Is this specific multi-package version combo verified to work together? USE WHEN: pinning a stack (next@15 + react@19 + node@22); before recommending a version matrix. RETURNS: {compatible, conflicts[], notes}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| packages | Yes | Package -> version map, e.g. {"next":"15","react":"19"}. |
Implementation Reference
- mcp-server/tools.js:707-714 (handler)Handler case for 'check_compatibility' in the handleToolCall dispatcher. Validates that 'packages' is a non-empty object (not array/string), then POSTs it to /api/compat on the backend API.
case "check_compatibility": { let pkgs = args.packages; if (typeof pkgs === "string") { try { pkgs = JSON.parse(pkgs); } catch {} } if (!pkgs || typeof pkgs !== "object" || Array.isArray(pkgs) || Object.keys(pkgs).length === 0) { return fail("\"packages\" must be a non-empty object, e.g. {\"next\":\"16\",\"react\":\"19\"}"); } return ok(await pJ("/api/compat", { packages: pkgs })); } - mcp-server/tools.js:380-401 (schema)Tool registration definition for 'check_compatibility' including its inputSchema. Defines parameters: 'packages' (object of string->string, required) for the package-to-version map.
{ name: "check_compatibility", description: "Is this specific multi-package version combo verified to work together? USE WHEN: pinning a stack (next@15 + react@19 + node@22); before recommending a version matrix. RETURNS: {compatible, conflicts[], notes}.", annotations: { title: "check_compatibility", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, inputSchema: { type: "object", properties: { packages: { type: "object", description: "Package -> version map, e.g. {\"next\":\"15\",\"react\":\"19\"}.", additionalProperties: { type: "string" }, }, }, required: ["packages"], }, - mcp-server/tools.js:543-551 (helper)Helper function 'postJson' (bound as 'pJ') used by the handler to POST the packages payload to the DepScope backend at /api/compat.
async function postJson(path, body, toolName) { const res = await fetch(`${API_BASE}${path}`, { method: "POST", headers: { ...headers(toolName), "Content-Type": "application/json" }, body: JSON.stringify(body), }); if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`); return res.json(); } - mcp-server/tools.js:19-19 (registration)The 'check_compatibility' tool object is part of the exported TOOLS array, which is consumed by the MCP server entry points (index.js and http-server.js) for registration.
export const TOOLS = [