From ae33716e22bbad767b2a0d2584780e44efed9402 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Fri, 5 Sep 2025 10:19:00 +0300 Subject: [PATCH] fix: report correct number of projects --- src/tools/atlas/read/listProjects.ts | 2 +- tests/integration/tools/atlas/projects.test.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tools/atlas/read/listProjects.ts b/src/tools/atlas/read/listProjects.ts index 720186ecf..d5d3931b0 100644 --- a/src/tools/atlas/read/listProjects.ts +++ b/src/tools/atlas/read/listProjects.ts @@ -55,7 +55,7 @@ export class ListProjectsTool extends AtlasToolBase { ----------------| ----------------| ----------------| ----------------| ---------------- ${rows}`; return { - content: formatUntrustedData(`Found ${rows.length} projects`, formattedProjects), + content: formatUntrustedData(`Found ${data.results.length} projects`, formattedProjects), }; } } diff --git a/tests/integration/tools/atlas/projects.test.ts b/tests/integration/tools/atlas/projects.test.ts index 631b00f87..de637a23a 100644 --- a/tests/integration/tools/atlas/projects.test.ts +++ b/tests/integration/tools/atlas/projects.test.ts @@ -61,7 +61,6 @@ describeWithAtlas("projects", (integration) => { const response = await integration.mcpClient().callTool({ name: "atlas-list-projects", arguments: {} }); const elements = getResponseElements(response); expect(elements).toHaveLength(2); - expect(elements[0]?.text).toMatch(/Found \d+ projects/); expect(elements[1]?.text).toContain(" { } } expect(found).toBe(true); + + expect(elements[0]?.text).toBe(`Found ${data.length} projects`); }); }); });