From 079ffc3c5c092fcc6060eb05a0e8df4630b24244 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 17 Apr 2026 22:54:41 +0000 Subject: [PATCH 1/2] Initial plan From 494214a806f9fb5007ee5ad211e581242aa9689e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 17 Apr 2026 22:56:35 +0000 Subject: [PATCH 2/2] test: enforce strict Azure MCP tool reference matching Agent-Logs-Url: https://github.com/microsoft/GitHub-Copilot-for-Azure/sessions/34bca725-ee9c-45ac-8738-01aff96711a4 Co-authored-by: kvenkatrajan <102772054+kvenkatrajan@users.noreply.github.com> --- tests/fixtures/azure-mcp-tool-names.snapshot.json | 1 + tests/mcp-tool-references/unit.test.ts | 11 ++++------- tests/scripts/update-mcp-tool-snapshot.js | 2 ++ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/fixtures/azure-mcp-tool-names.snapshot.json b/tests/fixtures/azure-mcp-tool-names.snapshot.json index c8f92bad8..2d54618ad 100644 --- a/tests/fixtures/azure-mcp-tool-names.snapshot.json +++ b/tests/fixtures/azure-mcp-tool-names.snapshot.json @@ -1,5 +1,6 @@ { "source": "npx -y @azure/mcp server start (initialize + tools/list)", + "toolReferenceConvention": "References must match exact tool names from toolNames. Compound forms like _* are not supported.", "azureMcpVersion": "3.0.0-beta.3+ae9594a1268710e678c0a6c9f9801212b1ee3694", "toolNames": [ "acr", diff --git a/tests/mcp-tool-references/unit.test.ts b/tests/mcp-tool-references/unit.test.ts index 7099841f2..ccc302a61 100644 --- a/tests/mcp-tool-references/unit.test.ts +++ b/tests/mcp-tool-references/unit.test.ts @@ -56,13 +56,6 @@ describe("Azure MCP tool references in skill markdown", () => { continue; } - const hasValidNamespacePrefix = snapshot.toolNames.some((snapshotToolName) => - resolvedToolName.startsWith(`${snapshotToolName}_`), - ); - if (hasValidNamespacePrefix) { - continue; - } - const relativePath = path.relative(skillsRoot, markdownPath); unknownReferences.push(`${toolReference} (${relativePath})`); } @@ -74,11 +67,15 @@ describe("Azure MCP tool references in skill markdown", () => { test("snapshot file exists and has expected shape", () => { const snapshot = JSON.parse(readFileSync(snapshotPath, "utf8")) as { source?: string; + toolReferenceConvention?: string; azureMcpVersion?: string; toolNames?: string[]; }; expect(typeof snapshot.source).toBe("string"); + expect(snapshot.toolReferenceConvention).toBe( + "References must match exact tool names from toolNames. Compound forms like _* are not supported.", + ); expect(typeof snapshot.azureMcpVersion).toBe("string"); expect(Array.isArray(snapshot.toolNames)).toBe(true); expect(snapshot.toolNames?.length).toBeGreaterThan(0); diff --git a/tests/scripts/update-mcp-tool-snapshot.js b/tests/scripts/update-mcp-tool-snapshot.js index 2fc22836a..eb8ebdcb1 100644 --- a/tests/scripts/update-mcp-tool-snapshot.js +++ b/tests/scripts/update-mcp-tool-snapshot.js @@ -137,6 +137,8 @@ async function main() { const snapshot = { source: "npx -y @azure/mcp server start (initialize + tools/list)", + toolReferenceConvention: + "References must match exact tool names from toolNames. Compound forms like _* are not supported.", azureMcpVersion: version, toolNames, };