Skip to content

Commit 95cc80c

Browse files
Copilotbamurtaugh
andcommitted
Add VSCode language model tool source type definitions
This change adds TypeScript definitions for language model tools from different sources including VS Code extensions and MCP (Model Context Protocol) servers. The new types provide source attribution and metadata for language model tools, enabling better tool management and user transparency about tool origins. Co-authored-by: bamurtaugh <25310137+bamurtaugh@users.noreply.github.com>
1 parent 1db58f2 commit 95cc80c

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

src/@types/vscode.proposed.chatParticipantAdditions.d.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,43 @@ declare module 'vscode' {
265265
export const onDidChangeChatRequestTools: Event<ChatRequest>;
266266
}
267267

268+
export class LanguageModelToolExtensionSource {
269+
/**
270+
* ID of the extension that published the tool.
271+
*/
272+
readonly id: string;
273+
274+
/**
275+
* Label of the extension that published the tool.
276+
*/
277+
readonly label: string;
278+
279+
private constructor(id: string, label: string);
280+
}
281+
282+
export class LanguageModelToolMCPSource {
283+
/**
284+
* Editor-configured label of the MCP server that published the tool.
285+
*/
286+
readonly label: string;
287+
288+
/**
289+
* Server-defined name of the MCP server.
290+
*/
291+
readonly name: string;
292+
293+
/**
294+
* Server-defined instructions for MCP tool use.
295+
*/
296+
readonly instructions?: string;
297+
298+
private constructor(label: string, name: string, instructions?: string);
299+
}
300+
301+
export interface LanguageModelToolInformation {
302+
source: LanguageModelToolExtensionSource | LanguageModelToolMCPSource | undefined;
303+
}
304+
268305
// TODO@API fit this into the stream
269306
export interface ChatUsedContext {
270307
documents: ChatDocumentContext[];

0 commit comments

Comments
 (0)