Skip to content

armgit / Ix

Public Imported from GitHub
0

Understand any codebase instantly. System intelligence for codebases, built for humans and AI.

feat(mcp): add limit input to ix_impact (CL-20H)

KageBinary280b50e74866
diff --git a/ix-cli/src/cli/__tests__/mcp-tool-params.test.ts b/ix-cli/src/cli/__tests__/mcp-tool-params.test.ts
index db5ca174..f05fa140 100644
--- a/ix-cli/src/cli/__tests__/mcp-tool-params.test.ts
+++ b/ix-cli/src/cli/__tests__/mcp-tool-params.test.ts
@@ -73,6 +73,22 @@ describe("resolving an ambiguous symbol over MCP", () => {
});
});
+describe("ix_impact limit", () => {
+ it("forwards limit as --limit, so the CLI's 'Raise --limit' hint can be acted on", async () => {
+ const { calls, runIx } = recorder();
+ const client = await connect(runIx);
+ await client.callTool({ name: "ix_impact", arguments: { target: "verify", limit: 25 } });
+ expect(calls).toEqual([["impact", "--limit=25", "--format=llm", "--", "verify"]]);
+ });
+
+ it("leaves argv unchanged when limit is omitted", async () => {
+ const { calls, runIx } = recorder();
+ const client = await connect(runIx);
+ await client.callTool({ name: "ix_impact", arguments: { target: "verify" } });
+ expect(calls).toEqual([["impact", "--format=llm", "--", "verify"]]);
+ });
+});
+
describe("ix_search", () => {
it("exists at all, which is the point", async () => {
const client = await connect(async () => ({ ok: true, stdout: "ok", stderr: "" }));
diff --git a/ix-cli/src/mcp/server.ts b/ix-cli/src/mcp/server.ts
index 9af0b8e7..cfad13d9 100644
--- a/ix-cli/src/mcp/server.ts
+++ b/ix-cli/src/mcp/server.ts
@@ -454,9 +454,11 @@ export function createIxMcpServer(options: CreateServerOptions = {}): McpServer
kind: SYMBOL_TOOL_INPUT.kind,
path: SYMBOL_TOOL_INPUT.path,
pick: SYMBOL_TOOL_INPUT.pick,
+ // Caps the top-impacted members and the leaf caller/callee rows. The CLI
+ // default is 10, so the hint's "Raise --limit" needs this to be reachable.
+ limit: z.number().int().min(0).max(500).optional(),
},
- async (input) =>
- runFormatted(runIx, "ix_impact", ix("impact", [stringArg(input, "target")], symbolOptions(input, { limit: false }))),
+ async (input) => runFormatted(runIx, "ix_impact", ix("impact", [stringArg(input, "target")], symbolOptions(input))),
);
registerTool(
ctx,