Skip to content

Commit 93c556d

Browse files
committed
fix(@angular/cli): use narrower types for new MCP TS SDK compatibility
1 parent 13c8c4c commit 93c556d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/angular/cli/src/commands/mcp/tools/best-practices.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* guide bundled with the Angular CLI.
1616
*/
1717

18+
import type { CallToolResult } from '@modelcontextprotocol/sdk/types';
1819
import { readFile, stat } from 'node:fs/promises';
1920
import { createRequire } from 'node:module';
2021
import path from 'node:path';
@@ -211,7 +212,7 @@ function createBestPracticesHandler({ logger }: McpToolContext) {
211212
type: 'text' as const,
212213
text: content,
213214
annotations: {
214-
audience: ['assistant'],
215+
audience: ['assistant' as const],
215216
priority: 0.9,
216217
source,
217218
},

packages/angular/cli/src/commands/mcp/tools/doc-search.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,13 @@ function createDocSearchHandler({ logger }: McpToolContext) {
176176
const textContent: {
177177
type: 'text';
178178
text: string;
179-
annotations?: { audience: string[]; priority: number };
179+
annotations?: { audience: ('assistant' | 'user')[]; priority: number };
180180
}[] = [
181181
{
182182
type: 'text' as const,
183183
text: `Showing results for Angular v${finalSearchedVersion} documentation.`,
184184
annotations: {
185-
audience: ['assistant'],
185+
audience: ['assistant' as const],
186186
priority: 0.9,
187187
},
188188
},

0 commit comments

Comments
 (0)