verify_understanding
Confirm AI correctly understood user requirements before proceeding by verifying key points and next steps.
Instructions
Verify that the AI correctly understood the user's requirements before proceeding
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| understanding | Yes | AI's understanding of the user's request | |
| key_points | No | Key points that the AI wants to confirm | |
| next_steps | No | What the AI plans to do next if understanding is correct |
Implementation Reference
- src/index.ts:825-897 (handler)The handler function that executes the verify_understanding tool. It constructs a message summarizing the AI's understanding, key points, and next steps, then elicits user feedback via sendElicitationRequest, and returns the user's response.private async handleVerifyUnderstanding(args: Record<string, unknown>) { const understanding = typeof args.understanding === "string" ? args.understanding : "Unknown understanding"; const key_points = Array.isArray(args.key_points) ? args.key_points : undefined; const next_steps = typeof args.next_steps === "string" ? args.next_steps : undefined; let message = `Please verify my understanding:\n\n**What I understood**: ${understanding}`; if (key_points && key_points.length > 0) { message += `\n\n**Key points to confirm**:\n${key_points.map((point: unknown, i: number) => `${i + 1}. ${String(point)}`).join("\n")}`; } if (next_steps) { message += `\n\n**What I plan to do next**: ${next_steps}`; } const elicitationParams: ElicitationParams = { message, requestedSchema: { type: "object", properties: { understanding_correct: { type: "boolean", title: "Understanding Correct", description: "Is my understanding correct?", }, corrections: { type: "string", title: "Corrections", description: "What should I correct or clarify?", }, proceed: { type: "boolean", title: "Proceed", description: "Should I proceed with the planned next steps?", }, }, required: ["understanding_correct"], }, }; try { const response = await this.sendElicitationRequest(elicitationParams); if (response.action === "accept") { return { content: [ { type: "text", text: `Understanding verification result:\n${JSON.stringify(response.content, null, 2)}`, }, ], }; } else { return { content: [ { type: "text", text: `User ${response.action}ed the understanding verification.`, }, ], }; } } catch (error) { return this.createErrorResponse( `Understanding verification failed: ${error instanceof Error ? error.message : String(error)}` ); }
- src/index.ts:319-347 (schema)Defines the Tool schema for verify_understanding, including name, description, and inputSchema specifying the expected parameters: understanding (required), key_points, and next_steps.private createVerifyUnderstandingTool(): Tool { return { name: "verify_understanding", description: "Verify that the AI correctly understood the user's requirements before proceeding", inputSchema: { type: "object", properties: { understanding: { type: "string", description: "AI's understanding of the user's request", }, key_points: { type: "array", items: { type: "string", }, description: "Key points that the AI wants to confirm", }, next_steps: { type: "string", description: "What the AI plans to do next if understanding is correct", }, }, required: ["understanding"], }, }; }
- src/index.ts:524-525 (registration)Switch case in executeToolCall method that routes calls to the verify_understanding tool to its handler function.case "verify_understanding": return await this.handleVerifyUnderstanding(args);
- src/index.ts:236-236 (registration)The verify_understanding tool is registered by including its creator in the getToolDefinitions() return array, which is used by the list tools handler.this.createVerifyUnderstandingTool(),