feat(cli): allow expanding full details of MCP tool on approval (#19916)

This commit is contained in:
Yuki Okita
2026-02-24 10:45:05 +09:00
committed by GitHub
parent 3409de774c
commit 05bc0399f3
6 changed files with 207 additions and 10 deletions
@@ -95,6 +95,9 @@ export type SerializableConfirmationDetails =
serverName: string;
toolName: string;
toolDisplayName: string;
toolArgs?: Record<string, unknown>;
toolDescription?: string;
toolParameterSchema?: unknown;
}
| {
type: 'ask_user';
+7
View File
@@ -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,
);
}
}
+3
View File
@@ -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>;
}