mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-21 18:44:30 -07:00
feat(cli): allow expanding full details of MCP tool on approval (#19916)
This commit is contained in:
@@ -95,6 +95,9 @@ export type SerializableConfirmationDetails =
|
||||
serverName: string;
|
||||
toolName: string;
|
||||
toolDisplayName: string;
|
||||
toolArgs?: Record<string, unknown>;
|
||||
toolDescription?: string;
|
||||
toolParameterSchema?: unknown;
|
||||
}
|
||||
| {
|
||||
type: 'ask_user';
|
||||
|
||||
@@ -80,6 +80,8 @@ export class DiscoveredMCPToolInvocation extends BaseToolInvocation<
|
||||
readonly trust?: boolean,
|
||||
params: ToolParams = {},
|
||||
private readonly cliConfig?: Config,
|
||||
private readonly toolDescription?: string,
|
||||
private readonly toolParameterSchema?: unknown,
|
||||
) {
|
||||
// Use composite format for policy checks: serverName__toolName
|
||||
// This enables server wildcards (e.g., "google-workspace__*")
|
||||
@@ -123,6 +125,9 @@ export class DiscoveredMCPToolInvocation extends BaseToolInvocation<
|
||||
serverName: this.serverName,
|
||||
toolName: this.serverToolName, // Display original tool name in confirmation
|
||||
toolDisplayName: this.displayName, // Display global registry name exposed to model and user
|
||||
toolArgs: this.params,
|
||||
toolDescription: this.toolDescription,
|
||||
toolParameterSchema: this.toolParameterSchema,
|
||||
onConfirm: async (outcome: ToolConfirmationOutcome) => {
|
||||
if (outcome === ToolConfirmationOutcome.ProceedAlwaysServer) {
|
||||
DiscoveredMCPToolInvocation.allowlist.add(serverAllowListKey);
|
||||
@@ -317,6 +322,8 @@ export class DiscoveredMCPTool extends BaseDeclarativeTool<
|
||||
this.trust,
|
||||
params,
|
||||
this.cliConfig,
|
||||
this.description,
|
||||
this.parameterSchema,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -757,6 +757,9 @@ export interface ToolMcpConfirmationDetails {
|
||||
serverName: string;
|
||||
toolName: string;
|
||||
toolDisplayName: string;
|
||||
toolArgs?: Record<string, unknown>;
|
||||
toolDescription?: string;
|
||||
toolParameterSchema?: unknown;
|
||||
onConfirm: (outcome: ToolConfirmationOutcome) => Promise<void>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user