Skip to main content
Glama
mako10k

MCP-Confirm

by mako10k

confirm_action

Request user confirmation for actions with significant impact. Provide clear descriptions of the action, its potential effects, and additional details to ensure informed decision-making.

Instructions

Ask user to confirm an action before proceeding with potentially impactful operations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesDescription of the action to be confirmed
detailsNoAdditional details about what will happen
impactNoPotential impact or consequences of this action

Implementation Reference

  • The primary handler function for the 'confirm_action' tool. It extracts parameters, builds an elicitation message and schema for user confirmation, sends the request via sendElicitationRequest, and formats the response based on user input.
    private async handleConfirmAction(args: Record<string, unknown>) { const action = typeof args.action === "string" ? args.action : "Unknown action"; const impact = typeof args.impact === "string" ? args.impact : undefined; const details = typeof args.details === "string" ? args.details : undefined; let message = `Please confirm this action:\n\n**Action**: ${action}`; if (impact) { message += `\n\n**Impact**: ${impact}`; } if (details) { message += `\n\n**Details**: ${details}`; } message += `\n\nDo you want to proceed?`; const elicitationParams: ElicitationParams = { message, requestedSchema: { type: "object", properties: { confirmed: { type: "boolean", title: "Confirm Action", description: "Do you want to proceed with this action?", }, note: { type: "string", title: "Additional Note", description: "Any additional instructions or concerns?", }, }, required: ["confirmed"], }, timeoutMs: this.determineTimeoutForAction(impact), }; try { const response = await this.sendElicitationRequest(elicitationParams); if (response.action === "accept" && response.content) { const confirmed = response.content.confirmed as boolean; const note = response.content.note as string | undefined; return { content: [ { type: "text", text: `User ${confirmed ? "confirmed" : "declined"} the action.${note ? `\nNote: ${note}` : ""}`, }, ], }; } else { return { content: [ { type: "text", text: `User ${response.action}ed the confirmation request.`, }, ], }; } } catch (error) { return this.createErrorResponse( `Confirmation request failed: ${error instanceof Error ? error.message : String(error)}` ); } }
  • Defines the Tool specification including name, description, and inputSchema for validating 'confirm_action' tool calls.
    private createConfirmActionTool(): Tool { return { name: "confirm_action", description: "Ask user to confirm an action before proceeding with potentially impactful operations", inputSchema: { type: "object", properties: { action: { type: "string", description: "Description of the action to be confirmed", }, impact: { type: "string", description: "Potential impact or consequences of this action", }, details: { type: "string", description: "Additional details about what will happen", }, }, required: ["action"], }, }; }
  • src/index.ts:231-241 (registration)
    Registers the 'confirm_action' tool by including its creation in the list of available tools returned by listTools handler.
    private getToolDefinitions(): Tool[] { return [ this.createAskYesNoTool(), this.createConfirmActionTool(), this.createClarifyIntentTool(), this.createVerifyUnderstandingTool(), this.createCollectRatingTool(), this.createElicitCustomTool(), this.createSearchLogsTool(), this.createAnalyzeLogsTool(), ];
  • src/index.ts:520-521 (registration)
    Dispatches 'confirm_action' tool calls to the handleConfirmAction method in the executeToolCall switch statement.
    case "confirm_action": return await this.handleConfirmAction(args);
  • Helper function used by handleConfirmAction to determine appropriate timeout based on action impact level.
    private determineTimeoutForAction(impact?: string): number { if (!impact) return this.config.defaultTimeoutMs; const impactLower = impact.toLowerCase(); if (impactLower.includes("delete") || impactLower.includes("remove")) { return 120000; // 2 minutes for critical actions } else if (impactLower.includes("warning")) { return 90000; // 1.5 minutes for warning actions } return this.config.defaultTimeoutMs; }

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mako10k/mcp-confirm'

If you have feedback or need assistance with the MCP directory API, please join our Discord server