Skip to main content
Glama
mako10k

MCP-Confirm

by mako10k

ask_yes_no

Get user confirmation through yes/no questions when AI needs clarification or verification during interactions.

Instructions

Ask a yes/no confirmation question to the user when the AI needs clarification or verification

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
questionYesThe yes/no confirmation question to ask the user

Implementation Reference

  • The handler function for the 'ask_yes_no' tool. It extracts the question from input arguments, constructs an elicitation request schema for a boolean answer, sends the request via sendElicitationRequest, and returns the user's yes/no response or handles errors.
    private async handleAskYesNo(args: Record<string, unknown>) {
      const question =
        typeof args.question === "string"
          ? args.question
          : "Please answer yes or no";
    
      const elicitationParams: ElicitationParams = {
        message: question,
        requestedSchema: {
          type: "object",
          properties: {
            answer: {
              type: "boolean",
              title: "Your Answer",
              description: "Please select yes or no",
            },
          },
          required: ["answer"],
        },
        // Use default timeout instead of hardcoded short timeout
        timeoutMs: this.config.defaultTimeoutMs,
      };
    
      try {
        const response = await this.sendElicitationRequest(elicitationParams);
    
        if (response.action === "accept" && response.content) {
          return {
            content: [
              {
                type: "text",
                text: `User answered: ${response.content.answer ? "Yes" : "No"}`,
              },
            ],
          };
        } else {
          return {
            content: [
              {
                type: "text",
                text: `User ${response.action}ed the question.`,
              },
            ],
          };
        }
      } catch (error) {
        return this.createErrorResponse(
          `Elicitation request failed: ${error instanceof Error ? error.message : String(error)}`
        );
      }
    }
  • Defines the schema for the 'ask_yes_no' tool, specifying the name, description, and input schema that requires a 'question' string parameter.
    private createAskYesNoTool(): Tool {
      return {
        name: "ask_yes_no",
        description:
          "Ask a yes/no confirmation question to the user when the AI needs clarification or verification",
        inputSchema: {
          type: "object",
          properties: {
            question: {
              type: "string",
              description: "The yes/no confirmation question to ask the user",
            },
          },
          required: ["question"],
        },
      };
    }
  • src/index.ts:231-241 (registration)
    Registers the 'ask_yes_no' tool as part of the list of available tools returned in response to ListTools requests.
    private getToolDefinitions(): Tool[] {
      return [
        this.createAskYesNoTool(),
        this.createConfirmActionTool(),
        this.createClarifyIntentTool(),
        this.createVerifyUnderstandingTool(),
        this.createCollectRatingTool(),
        this.createElicitCustomTool(),
        this.createSearchLogsTool(),
        this.createAnalyzeLogsTool(),
      ];
  • src/index.ts:518-519 (registration)
    Dispatches 'ask_yes_no' tool calls to the handleAskYesNo handler in the executeToolCall switch statement.
    case "ask_yes_no":
      return await this.handleAskYesNo(args);
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It describes the tool's purpose and context but lacks details on behavioral traits such as how the user's response is handled, whether it blocks execution, or any error conditions. However, it does not contradict any annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the key information ('Ask a yes/no confirmation question') and includes essential context without any wasted words. Every part of the sentence contributes to understanding the tool's use.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (1 parameter, no output schema, no annotations), the description is mostly complete. It covers purpose and usage context well, but lacks details on behavioral aspects like response handling or error cases, which could be beneficial for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with the parameter 'question' fully documented in the schema. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline of 3 for high schema coverage without extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Ask a yes/no confirmation question') and the resource ('to the user'), with a precise purpose ('when the AI needs clarification or verification'). It distinguishes from siblings like 'clarify_intent' or 'confirm_action' by specifying the binary yes/no format.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly states when to use this tool: 'when the AI needs clarification or verification.' This provides clear context for usage, distinguishing it from alternatives like 'elicit_custom' or 'verify_understanding' by focusing on binary confirmation scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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