mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-21 23:40:44 -07:00
feat(policy): Propagate Tool Annotations for MCP Servers (#20083)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user