feat(policy): Propagate Tool Annotations for MCP Servers (#20083)

This commit is contained in:
Jerop Kipruto
2026-02-24 09:20:11 -05:00
committed by GitHub
parent fdeed97bc4
commit 06161f5a97
19 changed files with 455 additions and 41 deletions
+6
View File
@@ -91,6 +91,7 @@ export abstract class BaseToolInvocation<
readonly _toolName?: string,
readonly _toolDisplayName?: string,
readonly _serverName?: string,
readonly _toolAnnotations?: Record<string, unknown>,
) {}
abstract getDescription(): string;
@@ -199,6 +200,7 @@ export abstract class BaseToolInvocation<
args: this.params as Record<string, unknown>,
},
serverName: this._serverName,
toolAnnotations: this._toolAnnotations,
};
return new Promise<'ALLOW' | 'DENY' | 'ASK_USER'>((resolve) => {
@@ -372,6 +374,10 @@ export abstract class DeclarativeTool<
return READ_ONLY_KINDS.includes(this.kind);
}
get toolAnnotations(): Record<string, unknown> | undefined {
return undefined;
}
getSchema(_modelId?: string): FunctionDeclaration {
return {
name: this.name,