Handle user approvals with form elicitation

Google Workspace Model Context Protocol (MCP) servers use server-driven human-in-the-loop approvals to protect user data before an AI agent performs actions, such as sending an email, modifying a calendar event, updating or trashing a file, or reading data and metadata. These server-side approvals work alongside Google Workspace administrator policies and your own MCP host or agent platform governance controls. The servers request user approvals using MCP form elicitation.

For example, an approval dialog for sending a Gmail message might look like this:

Approval dialog for sending a Gmail message with recipient details, a
    Don't allow button, and an Allow once split button.

This guide explains how to connect to the /mcp/v1 endpoint, design approval dialogs for the best user experience, and implement the stateless form elicitation protocol in an MCP host, MCP client, or agent harness.

Before you begin

Before implementing or configuring MCP form elicitation, complete the prerequisites, determine whether your MCP host or client needs custom elicitation support, and review the server endpoints.

Prerequisites

Before implementing form elicitation in a custom MCP host or client, complete the following setup requirements:

  • Enable APIs and MCP servers in the same Google Cloud project: Create your OAuth 2.0 client ID in the same Google Cloud project where you enable the target Google Workspace APIs and MCP server endpoints. Select Use this client for an AI-powered agent when creating the OAuth client. For complete instructions, see Configure Google Workspace MCP servers.
  • Request the required OAuth 2.0 scopes for your target tools: Calling a tool with tools/call requires an OAuth 2.0 Bearer access token that includes the scope required for that tool, even though tools/list returns available tools independently of token scopes. Check the server's MCP reference overview page for each tool's required OAuth scopes.

Check if you need to implement form elicitation

We recommend connecting to the /mcp/v1 endpoint with MCP form elicitation so your agent can access the full set of Google Workspace tools and results. Whether you need to write code depends on how your MCP host and MCP client are built:

  • Configuring a prebuilt MCP host: If you're connecting a prebuilt MCP host application such as Google Antigravity or Claude Desktop that supports MCP form elicitation, you don't need to write form elicitation code:
    1. Connect to the /mcp/v1 endpoint. For setup steps, see Configure Google Workspace MCP servers.
    2. Review how your host's local confirmation prompts interact with server-side elicitation. Keep your platform's own tool restrictions and governance policies active. If you want to avoid redundant generic prompts on /mcp/v1, you can optionally adjust your host's local confirmation setting. For guidance, see Coordinate local prompts on /mcp/v1.
    3. If your prebuilt MCP host doesn't support form elicitation yet, you can connect to the limited /mcp/v1self fallback endpoint, which exposes tools that are useful without form elicitation, although specific calls can still require approval.
  • Integrating an MCP client SDK or agent framework into your MCP host: If you use an MCP client library or agent framework such as Agent Development Kit (ADK) that already handles form elicitation at the protocol layer, you still need to wire its elicitation handler into your MCP host's UI or CLI surface. Implement the approval UI recommendations in this guide for the best user experience on /mcp/v1.
  • Building a custom MCP client and host: If you are building your own MCP client and host integration, implement both the stateless form elicitation protocol and the approval UI recommendations in this guide to connect to /mcp/v1.
  • Using the Google Workspace command-line interface (CLI): If your agent connects to Google Workspace through the Google Workspace command-line interface (CLI), gwscli, the command-line interface handles human-in-the-loop confirmation prompts over standard error and standard input. You don't need to implement the MCP form elicitation protocol directly. For details, see Human-in-the-loop verification.

Server endpoints

The following generally available Google Workspace MCP servers and the Developer Preview Universal Search MCP server offer the primary /mcp/v1 endpoint and a limited /mcp/v1self fallback endpoint:

Endpoint Server URLs Form elicitation requirement Available tools
/mcp/v1
  • Gmail: https://gmailmcp.googleapis.com/mcp/v1
  • Google Drive: https://drivemcp.googleapis.com/mcp/v1
  • Google Docs: https://docsmcp.googleapis.com/mcp/v1
  • Google Sheets: https://sheetsmcp.googleapis.com/mcp/v1
  • Google Slides: https://slidesmcp.googleapis.com/mcp/v1
  • Google Calendar: https://calendarmcp.googleapis.com/mcp/v1
  • Google Chat: https://chatmcp.googleapis.com/mcp/v1
  • Google Tasks: https://tasksmcp.googleapis.com/mcp/v1
  • Universal Search: https://workspacemcp.googleapis.com/mcp/v1 ( Developer Preview)
Recommended primary endpoint. Use with mode: "form" elicitation. Exposes all tools and full result sets for the server, including tools that always require user approval under default policy.
/mcp/v1self
  • Gmail: https://gmailmcp.googleapis.com/mcp/v1self
  • Drive: https://drivemcp.googleapis.com/mcp/v1self
  • Docs: https://docsmcp.googleapis.com/mcp/v1self
  • Sheets: https://sheetsmcp.googleapis.com/mcp/v1self
  • Slides: https://slidesmcp.googleapis.com/mcp/v1self
  • Calendar: https://calendarmcp.googleapis.com/mcp/v1self
  • Chat: https://chatmcp.googleapis.com/mcp/v1self
  • Tasks: https://tasksmcp.googleapis.com/mcp/v1self
  • Universal Search: https://workspacemcp.googleapis.com/mcp/v1self ( Developer Preview)
Fallback endpoint. Specific calls might still require form elicitation depending on policy and target resources. Omits tools that always require approval under default policy, and exposes only tools that are useful without form elicitation, such as update_doc. List and search methods such as search_threads return only the subset of results accessible without approval rather than prompting for full access.

Use /mcp/v1 with form elicitation whenever possible, and reserve /mcp/v1self for MCP hosts where you can't add form elicitation support. If a client calls a tool in a way that requires user approval on either endpoint without declaring form elicitation support, the server blocks the call and returns a MissingRequiredClientCapability error.

To compare /mcp/v1 and /mcp/v1self toolsets across all generally available services in a single guide, see All Google Workspace MCP server tools. You can also check each server's individual tool reference overview page:

How form elicitation works

Google Workspace MCP servers use a stateless, single-connection request and retry flow based on the 2026-07-28 MCP Elicitation specification.

Seven-step form elicitation flow between the user, MCP client, and
    Google Workspace MCP server.

The form elicitation lifecycle follows these steps:

  1. User prompt: The user asks the agent to perform an action, such as creating a Calendar event.
  2. Initial tools/call request: The MCP client sends a tools/call request to the /mcp/v1 endpoint for a tool such as create_event and declares elicitation capability in params._meta.
  3. InputRequiredResult response: When the requested action requires user approval, the server pauses execution before running the tool. The server returns a result object with resultType: "input_required", an inputRequests map keyed by "approval_choice" containing an elicitation/create request with mode: "form", and an opaque requestState string.
  4. Approval dialog: The MCP client renders an approval dialog showing the target Google Workspace product and tool, the Markdown confirmation message, the decision question, and the allowed choices from enum and enumNames.
  5. User decision: The user selects an approval option, such as Allow once or Don't allow.
  6. Retry tools/call with inputResponses and requestState: The MCP client sends a second tools/call request with the identical tool name and arguments, plus top-level params.requestState and params.inputResponses fields containing the user's selected choice for "approval_choice".
  7. Tool execution result: The server verifies that requestState is bound to the exact tool arguments from the initial call, evaluates the user's decision, executes or ends the tool call, and returns a final result with resultType: "complete".

When approvals are requested

Whether a tool call triggers an elicitation/create challenge is determined dynamically by the Google Workspace MCP server based on system, user, and administrator governance policies. Policy evaluation can consider the following factors:

  • Action type: Write actions that share data with an audience or modify shared resources require user confirmation by default unless permitted by user or administrator policy, whereas self-writes such as creating a private file execute without confirmation by default. Trashing actions always require per-call confirmation without persistent approval, and read or metadata actions can also require confirmation depending on user or administrator policy.
  • Content ownership and visibility: Accessing or modifying files owned by other users or shared outside the user's organization can require approval.
  • External recipients: Sending messages, sharing files, or inviting attendees outside the user's domain typically requires explicit confirmation.
  • User and administrator preferences: Saved approval preferences from previous transactions or domain-wide administrator rules can require or bypass confirmation for specific tools.

Because Google Workspace evaluates its policies server-side on every call, your client must be prepared to handle an InputRequiredResult response on any tools/call invocation. Don't assume which tools can bypass server-side confirmation or cache server approval decisions on the client. Your MCP host or agent platform can still enforce its own permission and governance policies before sending a tool call.

Administrator user review policies

In the Google Admin console, administrators with the Security administrator privilege can customize human-in-the-loop policies for external AI agents under Agents > Settings > User review for external agents. Rules can apply to the entire organization, specific organizational units, or configuration groups.

These user review rules apply to external agents calling Google Workspace MCP tools and the Google Workspace command-line interface. They don't apply to standard Google Workspace REST APIs or partner integrations. Many self-scoped private actions that affect only the signed-in user, such as creating a Gmail draft or editing an unshared private file, run without confirmation and aren't restricted by these settings. Some self-scoped actions, such as changing vacation responder settings, still require confirmation once per call. Moving items to the trash always requires per-call confirmation with only ALLOW_ONCE and DENY_ONCE, and permanent deletion is blocked for third-party agents.

Administrators configure four activity categories:

Activity category Actions covered Default policy
External collaboration Creating, editing, and sharing data with accounts outside the organization, such as sending external emails or inviting external Calendar guests. Require user approval with Except when user always allows checked.
Internal collaboration Creating, editing, and sharing data with accounts inside the organization. Require user approval with Except when user always allows checked.
External data access Reading files, emails, Chat messages, or Calendar events owned or shared by accounts outside the organization. Require user approval with Except when user always allows checked.
Internal data access Reading files, emails, Chat messages, or Calendar events shared by accounts inside the organization. Allow

Each administrator setting changes server behavior on tools/call:

  • Allow: For matching actions, the tool executes without a confirmation prompt.
  • Require user approval with Except when user always allows checked: Returns an InputRequiredResult prompt that includes ALLOW_ONCE, DENY_ONCE, and any applicable persistent choices such as ALLOW_TOOL_ALWAYS, ALLOW_AUDIENCE_ALWAYS, ALLOW_RESOURCE_ALWAYS, or ALLOW_OWNER_ALWAYS. Saved persistent choices pre-approve matching future calls from the same agent.
  • Require user approval with Except when user always allows unchecked: Suppresses persistent Always allow choices and returns only ALLOW_ONCE and DENY_ONCE, requiring user confirmation on every matching call.
  • Block: Blocks the tool call without prompting the user and returns an AdminPolicyBlock error result.

When a single tool call spans multiple audiences, such as sending an email to both internal colleagues and external recipients, the server evaluates all matching rules and enforces the strictest policy in the order Block, Require user approval, and Allow.

Service accounts that impersonate users through domain-wide delegation are also subject to these user review policies. Unattended integrations that can't present interactive approval prompts can only run MCP actions that don't require user confirmation, such as actions set to Allow by an administrator.

For administrator setup steps and related OAuth, data loss prevention (DLP), attribution, and audit controls, see Manage AI agent access & user review.

How policies and user approvals work together

Google Workspace MCP form elicitation works alongside both Google Workspace administrator governance and your own MCP host or agent platform policies. You don't need to remove or weaken your platform's existing permission model or governance schema to use Google Workspace MCP servers.

When an AI agent attempts to call a Google Workspace MCP tool, three policy layers apply in order, and the strictest restriction wins:

  1. Agent platform and MCP host policies: Your host evaluates its own tool permissions, allowlists, denylists, and enterprise governance rules before sending or completing a tool call. If your platform's policy blocks an action, your host blocks the call locally. Server-side MCP form elicitation never overrides a client or platform policy block.
  2. Google Workspace administrator policies: The server evaluates domain, organizational unit, and group policies, including OAuth app access controls, DLP rules, and Block settings in User review for external agents. A user can't override an administrator or domain-level block. If an administrator policy blocks the action, the server rejects the call with AdminPolicyBlock without prompting the user.
  3. User-level MCP form elicitation: For actions permitted by both your agent platform and Google Workspace administrator policies, the server can request an additional human-in-the-loop confirmation so the signed-in user stays in the loop before the action executes.

If any layer denies or blocks the call, the action doesn't run.

Approval choices reference

In requestedSchema.properties.approval_choice, the server returns parallel enum and enumNames arrays representing the choices available for the current request. Across Google Workspace MCP servers, the following enum values are supported:

enum value Default enumNames label in English Allows execution When offered and behavior
ALLOW_ONCE Allow once Yes Offered on every approval prompt. Runs the current tool call once without recording a persistent rule.
DENY_ONCE Don't allow No Offered on every approval prompt. Ends the current tool call with a UserDeniedAction error without recording a persistent rule.
ALLOW_TOOL_ALWAYS Always allow this tool Yes Offered when user and administrator policies permit tool-wide persistent approval. Runs the current call and pre-approves future calls to the same tool from the same agent.
ALLOW_RESOURCE_ALWAYS Always allow for this file / folder / drive / email / event / space / chat / group chat / task / item Yes Offered when modifying or accessing up to 100 resources of the same type. Uses plural wording such as Always allow for these files when the call targets multiple resources. Runs the current call and pre-approves future calls from the same agent on the same resource IDs.
ALLOW_AUDIENCE_ALWAYS Always allow for this recipient / these recipients Yes Offered for send, share, and invite actions targeting up to 100 recipients. Runs the current call and pre-approves future calls from the same agent to the same recipient set.
ALLOW_OWNER_ALWAYS Always allow for this owner / these owners Yes Offered on read or grounding prompts touching items from up to 3 distinct owners. Runs the current call and pre-approves future calls from the same agent for items owned by those users.

Any individual InputRequiredResult includes only the subset of choices that apply to that specific tool call:

  • Destructive and trashing actions: Actions that permanently delete or trash resources, or actions governed by an administrator policy that requires confirmation on every call, offer only ALLOW_ONCE and DENY_ONCE.
  • Scoped actions: When persistent approvals are permitted, the server returns ALLOW_ONCE, the applicable narrow scope such as ALLOW_AUDIENCE_ALWAYS or ALLOW_RESOURCE_ALWAYS, ALLOW_TOOL_ALWAYS, and DENY_ONCE.

Always render the exact options returned in enum and enumNames for the current request rather than hardcoding button values.

Recommended practices for the best user experience

Standard MCP clients that support form elicitation work out of the box with /mcp/v1. However, generic form renderers often display single-select decisions as a radio group or drop-down menu paired with a separate Submit button, which requires extra clicks and hides the target Google Workspace app context.

For the best form elicitation user experience, implement the following five recommendations in your MCP client. Recommendations 1 through 3 correspond to the numbered callouts in the following approval dialog illustration:

Optimized approval dialog showing three callout zones: 1. Product icon,
    prompt, and tool, 2. Server message and arguments, and 3. One-click decision
    buttons.

1. Display product names, icons, and tools

Users should immediately see which Google Workspace product and tool the agent wants to call:

  • Map the MCP server's serverInfo metadata from initialization or server/discover, or the request hostname such as calendarmcp.googleapis.com, to the Google Workspace product name and icon.
  • Treat _meta presentation hints on InputRequiredResult such as title, icons, and isConfirmation as optional enhancements. Production Google Workspace MCP servers don't emit these _meta fields yet, so your UI shouldn't depend on them.
  • Display the target tool name from params.name so users can distinguish between operations such as create_draft and create_event.

2. Render server messages and enumNames

Keep your client presentation layer simple and render the server-provided approval content directly:

  • Render params.message as Markdown and display approval_choice.title: Google Workspace MCP servers already format action details as Markdown in inputRequests.approval_choice.params.message and provide a localized confirmation question in requestedSchema.properties.approval_choice.title. Render message directly with a safe Markdown renderer rather than displaying raw Markdown symbols or writing custom per-tool argument formatting logic, and display title clearly above the action buttons.
  • Pair enum values with enumNames labels: Inspect requestedSchema.properties.approval_choice dynamically. Pair each identifier in enum with the human-readable label at the same index in enumNames, and fall back to JSON Schema oneOf entries if interacting with other MCP servers that use oneOf.

3. Simplify decisions with one-click buttons

When requestedSchema contains a single enum property, avoid rendering a radio button list or drop-down menu that requires a separate Submit click:

  • Two options such as Allow once and Don't allow: Render two side-by-side buttons. Clicking either button immediately submits the retry request.
  • Multiple allow options: When the server returns ALLOW_ONCE, one or more persistent allow scopes such as ALLOW_AUDIENCE_ALWAYS or ALLOW_TOOL_ALWAYS, and DENY_ONCE, render a primary split button defaulting to Allow once with a caret menu for the additional allow options, paired with a separate Don't allow button.

Side-by-side comparison of one-click button layouts: Pattern A shows
    two side-by-side buttons for two-option schemas, and Pattern B shows a
    Don't allow button paired with an Allow once split button.

In Pattern A, a destructive Drive action returns only ALLOW_ONCE and DENY_ONCE, which the client renders as two side-by-side buttons for Don't allow and Allow once. In Pattern B, a Gmail action returns ALLOW_ONCE, ALLOW_AUDIENCE_ALWAYS, ALLOW_TOOL_ALWAYS, and DENY_ONCE, which the client renders as a Don't allow button alongside an Allow once split button whose menu exposes the persistent allow choices.

4. Coordinate local prompts on /mcp/v1

Many MCP hosts display a generic local confirmation prompt before calling any external tool. When calling Google Workspace MCP servers with form elicitation enabled, unconditional pre-call prompts can create a double-prompt experience because the server also enforces its own policy-aware elicitation challenge.

Adjusting local confirmation prompts is an optional user experience choice, not a requirement. Don't disable or weaken your MCP host's or agent platform's own tool permissions, allowlists, denylists, or governance policies. As described in How policies and user approvals work together, your platform's restrictions, Google Workspace administrator policies, and server-side user approvals work together in layers.

  • If you're configuring a prebuilt MCP host with form elicitation: Keep your platform's tool access restrictions and governance policies enabled. To avoid double prompts for actions that your platform already permits, you can optionally set the host's generic local confirmation setting for Google Workspace MCP servers on /mcp/v1 to Always allow and rely on server-initiated elicitation dialogs for default user confirmation. Keep local tool confirmations enabled if you want client-side prompts for actions that the server allows without prompting, such as self-scoped actions or actions set to Allow by your Google Workspace administrator. If your host doesn't support form elicitation and connects to /mcp/v1self, keep local tool confirmations enabled if you want client-side prompts for calls that don't trigger server-side approval.
  • If you're building an MCP host: Continue evaluating your host's permission model, tool blocks, enterprise governance policies, and any policy-required client confirmations before sending tools/call. If your host also shows a generic pre-call confirmation dialog on every external tool call, you can optionally skip that generic dialog when form elicitation is enabled for *mcp.googleapis.com servers, such as gmailmcp.googleapis.com, calendarmcp.googleapis.com, drivemcp.googleapis.com, and workspacemcp.googleapis.com, and your host policy already permits the call. Your host can still block calls or display its own confirmation dialogs whenever host or organization policy requires them. Your host must still render the server's elicitation dialog whenever the server returns an InputRequiredResult with resultType: "input_required".

5. Guide agent behavior for tools and denials

Reasoning models can misinterpret human-in-the-loop approval flows in two ways:

  1. Pre-emptively avoiding write tools: If a model assumes that calling a write tool such as send_message executes immediately without user review, the model might fall back to a draft tool such as create_draft even when the user asked to send an email.
  2. Retrying with alternative write tools after a denial: If the user clicks Don't allow on an approval dialog and the server returns a UserDeniedAction error result, the model might treat the denial as a transient tool failure and attempt to accomplish the same goal using another write tool, triggering an unwanted second approval prompt.

To prevent both issues, include the following instructions in your agent's system prompt:

Prompt

When calling Google Workspace MCP tools:
1. Select the tool that directly matches the user's intent (for example,
   use send_message when asked to send an email). Sensitive tools
   automatically pause for user confirmation through MCP form elicitation
   before executing.
2. If a tool call fails because the user denied, declined, or canceled the
   approval request, stop immediately and acknowledge the user's decision.
   Do not retry the same action or call an alternative write tool unless
   the user explicitly asks you to do so in a new message.

Transport and stateless protocol requirements

Google Workspace MCP servers operate over stateless Streamable HTTP. When building a custom MCP client, follow these wire requirements on every request:

  • HTTP headers: Include the following headers on all POST requests to /mcp/v1:
    • Authorization: Bearer ACCESS_TOKEN
    • Content-Type: application/json
    • Accept: application/json, text/event-stream
    • MCP-Protocol-Version: 2026-07-28
    • Accept-Language: BCP_47_LANGUAGE_TAG to localize confirmation messages, questions, and enumNames labels into the user's preferred language, such as es-419, es;q=0.9, en;q=0.8. If omitted, text defaults to en-US.
  • Response content types: Depending on the server and request type, the HTTP response body can be formatted as standard JSON with Content-Type: application/json or as Server-Sent Events (SSE) with Content-Type: text/event-stream where JSON-RPC payloads appear on data: {...} lines. Your HTTP transport parser must accept both formats.
  • Stateless discovery: Google Workspace MCP servers don't maintain stateful initialize sessions. To fetch server metadata and capabilities at startup, send a JSON-RPC request with "method": "server/discover" and "params": {}, which returns server metadata in result._meta["io.modelcontextprotocol/serverInfo"]. Custom confirmation _meta hints such as isConfirmation, title, and icons aren't emitted in production InputRequiredResult responses yet, so always treat _meta presentation fields as optional and fall back to serverInfo or the server hostname.
  • Per-request _meta capabilities: Because the transport is stateless, include _meta inside params on every tools/list and tools/call request with the following keys:
    • "io.modelcontextprotocol/protocolVersion": "2026-07-28"
    • "io.modelcontextprotocol/clientInfo": {"name": "YOUR_APP_NAME", "version": "VERSION"}
    • "io.modelcontextprotocol/clientCapabilities": {"elicitation": {"form": {}}}

Error handling and parameter binding

When a tool call is blocked or a retry fails validation, the server returns either a tool-level error result or a top-level JSON-RPC error object depending on the failure category:

  • UserDeniedAction and AdminPolicyBlock: When a user declines an approval prompt or an administrator policy blocks the action, the server returns a JSON-RPC result with "resultType": "complete", "isError": true, and a localized error message in result.content. When enabled for the service and environment, the server also includes structured error metadata in result._meta["google.com/error"]. Because result._meta["google.com/error"] is gated per service and environment, your client must fall back to reading the error message from result.content when result._meta["google.com/error"] is absent:

    • UserDeniedAction: Returned when the user selects DENY_ONCE, declines, or cancels the approval form. The default English message is "Action canceled. The user declined the confirmation request."
    • AdminPolicyBlock: Returned when an organization administrator policy prohibits the agent from performing the operation, such as when an activity category in User review for external agents is set to Block or when system policy blocks permanent deletion. The default English message is "Action could not be completed. Your administrator has blocked third-party agents from performing this action."

    JSON

    {
      "jsonrpc": "2.0",
      "id": 3,
      "result": {
        "resultType": "complete",
        "isError": true,
        "content": [
          {
            "type": "text",
            "text": "Action canceled. The user declined the confirmation request."
          }
        ],
        "_meta": {
          "google.com/error": {
            "code": 400,
            "message": "Action canceled. The user declined the confirmation request.",
            "status": "FAILED_PRECONDITION",
            "details": [
              {
                "@type": "type.googleapis.com/google.rpc.ErrorInfo",
                "reason": "UserDeniedAction",
                "domain": "mcp.googleapis.com"
              }
            ]
          }
        }
      }
    }
    
  • MissingRequiredClientCapability: Returned when a client calls a tool in a way that requires user confirmation on either /mcp/v1 or /mcp/v1self without declaring form elicitation support in _meta["io.modelcontextprotocol/clientCapabilities"]. The server translates this error into a top-level JSON-RPC error object with code -32021 and the required capability object in error.data.requiredCapabilities:

    JSON

    {
      "jsonrpc": "2.0",
      "id": 2,
      "error": {
        "code": -32021,
        "message": "Action could not be completed. This action requires user confirmation, which this client does not support. Use a client that supports form elicitation to perform this action.",
        "data": {
          "requiredCapabilities": {
            "elicitation": {
              "form": {}
            }
          }
        }
      }
    }
    
  • Parameter-binding enforcement: The requestBinding token inside requestState cryptographically binds the initial approval challenge to the exact tool arguments sent on the first call. If the client modifies any field in params.arguments on the retry call, or passes a malformed or unbound params.requestState, the server either ignores the invalid approval and returns a new InputRequiredResult challenge, or returns an invalid-parameter or failed-precondition error instructing the client to retry without inputResponses.

Example implementation

The following end-to-end walkthrough demonstrates how an MCP client calls the Calendar create_event tool, renders the server's approval prompt in a browser UI or terminal CLI, and submits the user's decision in TypeScript and Python, followed by a reusable agent skill for coding agents.

Client approval surfaces

In a browser-based MCP client, the TypeScript implementation renders a visual approval card showing the Calendar icon, server hostname, tool name, rendered Markdown message preview from the server, confirmation question, a Don't allow button, and an Allow once split button:

Google Calendar Create event approval dialog showing the Calendar icon,
    confirmation question, event details and attendee chips, a Don't allow
    button, and an Allow once split button.

In a terminal-based MCP client, the Python CLI implementation renders the same InputRequiredResult payload as an interactive numbered prompt:

CLI

=== Google Calendar (create_event) ===
Architecture Review
Tue, Oct 20 · 10:00 - 10:30 AM PDT · 🟢 No calendar conflicts
You, dana@example.com, sam@example.com
Conferencing: Google Meet

Allow Cymbal Agent to use create_event for these recipients?
  [1] Allow once (ALLOW_ONCE)
  [2] Always allow for these recipients (ALLOW_AUDIENCE_ALWAYS)
  [3] Always allow this tool (ALLOW_TOOL_ALWAYS)
  [4] Don't allow (DENY_ONCE)
Enter choice (1-4, or c to cancel):

Initial call and elicitation response

The client starts by sending a tools/call request to create the Calendar event using the create_event tool:

JSON

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "create_event",
    "arguments": {
      "calendarId": "primary",
      "summary": "Architecture Review",
      "startTime": "2026-10-20T10:00:00",
      "endTime": "2026-10-20T10:30:00",
      "timeZone": "America/Los_Angeles",
      "attendees": [
        {
          "email": "dana@example.com"
        },
        {
          "email": "sam@example.com"
        }
      ],
      "addGoogleMeetUrl": true
    },
    "_meta": {
      "io.modelcontextprotocol/protocolVersion": "2026-07-28",
      "io.modelcontextprotocol/clientInfo": {
        "name": "Cymbal Agent",
        "version": "1.0.0"
      },
      "io.modelcontextprotocol/clientCapabilities": {
        "elicitation": {
          "form": {}
        }
      }
    }
  }
}

When approval is required, the server responds with an InputRequiredResult:

JSON

{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "resultType": "input_required",
    "inputRequests": {
      "approval_choice": {
        "method": "elicitation/create",
        "params": {
          "mode": "form",
          "message": "**Architecture Review**  \nTue, Oct 20 · 10:00 - 10:30 AM PDT · 🟢 No calendar conflicts  \nYou, dana@example.com, sam@example.com  \n**Conferencing:** Google Meet",
          "requestedSchema": {
            "type": "object",
            "required": ["approval_choice"],
            "properties": {
              "approval_choice": {
                "type": "string",
                "title": "Allow Cymbal Agent to use create_event for these recipients?",
                "enum": [
                  "ALLOW_ONCE",
                  "ALLOW_AUDIENCE_ALWAYS",
                  "ALLOW_TOOL_ALWAYS",
                  "DENY_ONCE"
                ],
                "enumNames": [
                  "Allow once",
                  "Always allow for these recipients",
                  "Always allow this tool",
                  "Don't allow"
                ]
              }
            }
          }
        }
      }
    },
    "requestState": "{\"elicitationId\":\"...\",\"requestBinding\":\"...\"}"
  }
}

The InputRequiredResult response includes the following key fields:

  • result.resultType: Set to "input_required" when the server pauses execution for user input, and "complete" when the tool finishes executing.
  • result.inputRequests: A map keyed by the request identifier "approval_choice". Each entry has "method": "elicitation/create" and a params object with "mode": "form".
  • _meta presentation hints: Optional fields such as isConfirmation, title, and icons aren't emitted in production InputRequiredResult responses yet. Always treat _meta fields as optional and resolve the product name and icon from serverInfo or the server hostname when absent.
  • inputRequests.approval_choice.params.message: A Markdown-formatted preview of the action generated by the server, or the confirmation question if the tool doesn't generate a separate preview card.
  • inputRequests.approval_choice.params.requestedSchema: A JSON Schema object whose properties.approval_choice definition contains the following fields:
    • title: The localized confirmation question, such as "Allow Cymbal Agent to use create_event for these recipients?". When you provide _meta["io.modelcontextprotocol/clientInfo"].name on the request, the server incorporates your application's name into this question.
    • enum: An ordered array of ApprovalChoice identifiers, such as ALLOW_ONCE, ALLOW_AUDIENCE_ALWAYS, ALLOW_TOOL_ALWAYS, and DENY_ONCE.
    • enumNames: A parallel array of localized human-readable labels corresponding to each entry in enum, such as Allow once, Always allow for these recipients, Always allow this tool, and Don't allow.
  • result.requestState: An opaque JSON-encoded string containing the server's elicitationId and cryptographic requestBinding token. You must echo this string unchanged in params.requestState on the retry call.

Retry, denial, and cancellation payloads

After the user selects an allow option, send a second tools/call request with the exact same name and arguments, and pass requestState and inputResponses as top-level fields inside params:

JSON

{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "create_event",
    "arguments": {
      "calendarId": "primary",
      "summary": "Architecture Review",
      "startTime": "2026-10-20T10:00:00",
      "endTime": "2026-10-20T10:30:00",
      "timeZone": "America/Los_Angeles",
      "attendees": [
        {
          "email": "dana@example.com"
        },
        {
          "email": "sam@example.com"
        }
      ],
      "addGoogleMeetUrl": true
    },
    "requestState": "{\"elicitationId\":\"...\",\"requestBinding\":\"...\"}",
    "inputResponses": {
      "approval_choice": {
        "action": "accept",
        "content": {
          "approval_choice": "ALLOW_ONCE"
        }
      }
    },
    "_meta": {
      "io.modelcontextprotocol/protocolVersion": "2026-07-28",
      "io.modelcontextprotocol/clientInfo": {
        "name": "Cymbal Agent",
        "version": "1.0.0"
      },
      "io.modelcontextprotocol/clientCapabilities": {
        "elicitation": {
          "form": {}
        }
      }
    }
  }
}

The MCP Elicitation specification distinguishes between submitting a form value and dismissing the dialog. You can represent a negative user decision in params.inputResponses in two ways:

  • Submitting the DENY_ONCE choice: When the user clicks the Don't allow button corresponding to DENY_ONCE, send "action": "accept" with "content": {"approval_choice": "DENY_ONCE"}:

    JSON

    {
      "jsonrpc": "2.0",
      "id": 3,
      "method": "tools/call",
      "params": {
        "name": "create_event",
        "arguments": {
          "calendarId": "primary",
          "summary": "Architecture Review",
          "startTime": "2026-10-20T10:00:00",
          "endTime": "2026-10-20T10:30:00",
          "timeZone": "America/Los_Angeles",
          "attendees": [
            {
              "email": "dana@example.com"
            },
            {
              "email": "sam@example.com"
            }
          ],
          "addGoogleMeetUrl": true
        },
        "requestState": "{\"elicitationId\":\"...\",\"requestBinding\":\"...\"}",
        "inputResponses": {
          "approval_choice": {
            "action": "accept",
            "content": {
              "approval_choice": "DENY_ONCE"
            }
          }
        },
        "_meta": {
          "io.modelcontextprotocol/protocolVersion": "2026-07-28",
          "io.modelcontextprotocol/clientInfo": {
            "name": "Cymbal Agent",
            "version": "1.0.0"
          },
          "io.modelcontextprotocol/clientCapabilities": {
            "elicitation": {
              "form": {}
            }
          }
        }
      }
    }
    
  • Declining or canceling the dialog: If the user closes or cancels the dialog without selecting an allow option, send "action": "decline" or "action": "cancel" and omit the content field:

    JSON

    "inputResponses": {
      "approval_choice": {
        "action": "cancel"
      }
    }
    

In both cases, the server treats the response as DENY_ONCE, ends the tool execution, and returns a tool error result.

TypeScript web client

The following TypeScript example extracts the Markdown message, confirmation question, and allowed options directly from the InputRequiredResult payload, resolves the product title from optional _meta hints or the server hostname, and replays tools/call with the user's decision:

TypeScript

const PROTOCOL_VERSION = "2026-07-28";
const CLIENT_INFO = { name: "Cymbal Agent", version: "1.0.0" };
const MAX_ELICITATION_ROUNDS = 3;

const HOST_TITLES: Record<string, string> = {
  "gmailmcp.googleapis.com": "Gmail",
  "calendarmcp.googleapis.com": "Google Calendar",
  "drivemcp.googleapis.com": "Google Drive",
  "docsmcp.googleapis.com": "Google Docs",
  "sheetsmcp.googleapis.com": "Google Sheets",
  "slidesmcp.googleapis.com": "Google Slides",
  "chatmcp.googleapis.com": "Google Chat",
  "people.googleapis.com": "Google Contacts",
  "tasksmcp.googleapis.com": "Google Tasks",
  "workspacemcp.googleapis.com": "Google Workspace",
};

interface ElicitationOption {
  value: string;
  label: string;
}

export interface ElicitationCardModel {
  requestKey: string;
  serverTitle: string;
  serverIconUrl?: string;
  toolName: string;
  markdownMessage: string;
  questionTitle: string;
  decisionFieldKey: string;
  denyOption?: ElicitationOption;
  primaryAllowOption?: ElicitationOption;
  secondaryAllowOptions: ElicitationOption[];
}

function buildBaseMeta(): Record<string, unknown> {
  return {
    "io.modelcontextprotocol/protocolVersion": PROTOCOL_VERSION,
    "io.modelcontextprotocol/clientInfo": CLIENT_INFO,
    "io.modelcontextprotocol/clientCapabilities": {
      elicitation: { form: {} },
    },
  };
}

/**
 * Extracts a UI view model directly from an InputRequiredResult response.
 * Render card.markdownMessage with a safe Markdown renderer in your UI.
 */
export function extractCardModel(
  rpcResult: Record<string, any>,
  toolName: string,
  serverHost = "workspacemcp.googleapis.com",
): ElicitationCardModel | null {
  const inputRequests: Record<string, any> = rpcResult.inputRequests ?? {};
  const requestEntry = Object.entries(inputRequests).find(
    ([, req]: [string, any]) =>
      req?.method === "elicitation/create" && req?.params?.mode === "form",
  );
  if (!requestEntry) {
    return null;
  }
  const [requestKey, elicitationReq] = requestEntry;

  const reqMeta = elicitationReq.params?._meta ?? {};
  const resultMeta = rpcResult._meta ?? {};
  const serverInfo = resultMeta["io.modelcontextprotocol/serverInfo"] ?? {};
  const icons: Array<{ src: string; mimeType?: string }> =
    reqMeta.icons ?? resultMeta.icons ?? serverInfo.icons ?? [];
  const preferredIcon =
    icons.find((icon) => icon.mimeType === "image/svg+xml") ?? icons[0];

  const properties: Record<string, any> =
    elicitationReq.params?.requestedSchema?.properties ?? {};
  const firstProperty = Object.entries(properties)[0];
  if (!firstProperty) {
    return null;
  }
  const [decisionFieldKey, fieldSchema] = firstProperty as [
    string,
    Record<string, any>,
  ];

  let options: ElicitationOption[] = [];
  if (Array.isArray(fieldSchema.enum)) {
    const enumNames: string[] = Array.isArray(fieldSchema.enumNames)
      ? fieldSchema.enumNames
      : [];
    options = fieldSchema.enum.map((val: string, idx: number) => ({
      value: val,
      label: enumNames[idx] ?? val,
    }));
  } else if (Array.isArray(fieldSchema.oneOf)) {
    options = fieldSchema.oneOf.map((opt: any) => ({
      value: opt.const,
      label: opt.title ?? opt.const,
    }));
  }

  const denyOption = options.find((opt) => opt.value.startsWith("DENY"));
  const allowOptions = options.filter(
    (opt) => !opt.value.startsWith("DENY"),
  );

  return {
    requestKey,
    serverTitle:
      reqMeta.title ??
      resultMeta.title ??
      serverInfo.title ??
      serverInfo.name ??
      HOST_TITLES[serverHost] ??
      "Google Workspace",
    serverIconUrl: preferredIcon?.src,
    toolName,
    markdownMessage:
      elicitationReq.params?.message ?? "Confirm this action.",
    questionTitle: fieldSchema.title ?? "Confirm this action?",
    decisionFieldKey,
    denyOption,
    primaryAllowOption: allowOptions[0],
    secondaryAllowOptions: allowOptions.slice(1),
  };
}

/**
 * Executes tools/call and replays with requestState and inputResponses
 * when the server returns an InputRequiredResult.
 */
export async function handleToolCallWithElicitation(
  sendRpc: (payload: Record<string, unknown>) => Promise<Record<string, any>>,
  promptUserInUi: (card: ElicitationCardModel) => Promise<string | null>,
  toolName: string,
  toolArgs: Record<string, unknown>,
  serverHost = "calendarmcp.googleapis.com",
): Promise<Record<string, any>> {
  let requestId = 1;
  let response = await sendRpc({
    jsonrpc: "2.0",
    id: requestId,
    method: "tools/call",
    params: {
      name: toolName,
      arguments: structuredClone(toolArgs),
      _meta: buildBaseMeta(),
    },
  });

  for (let round = 0; round < MAX_ELICITATION_ROUNDS; round++) {
    const result = response.result ?? {};
    if (result.resultType !== "input_required") {
      return response;
    }

    const card = extractCardModel(result, toolName, serverHost);
    if (!card) {
      return response;
    }

    const selectedValue = await promptUserInUi(card);
    const userResponse = selectedValue
      ? {
          action: "accept",
          content: { [card.decisionFieldKey]: selectedValue },
        }
      : { action: "cancel" };

    requestId += 1;
    response = await sendRpc({
      jsonrpc: "2.0",
      id: requestId,
      method: "tools/call",
      params: {
        name: toolName,
        arguments: structuredClone(toolArgs),
        ...(result.requestState !== undefined
          ? { requestState: result.requestState }
          : {}),
        inputResponses: {
          [card.requestKey]: userResponse,
        },
        _meta: buildBaseMeta(),
      },
    });
  }

  return response;
}

Python CLI client

Python

import copy
import re
from typing import Any

PROTOCOL_VERSION = "2026-07-28"
CLIENT_INFO = {"name": "Cymbal CLI Agent", "version": "1.0.0"}
MAX_ELICITATION_ROUNDS = 3
HOST_TITLES = {
    "gmailmcp.googleapis.com": "Gmail",
    "calendarmcp.googleapis.com": "Google Calendar",
    "drivemcp.googleapis.com": "Google Drive",
    "docsmcp.googleapis.com": "Google Docs",
    "sheetsmcp.googleapis.com": "Google Sheets",
    "slidesmcp.googleapis.com": "Google Slides",
    "chatmcp.googleapis.com": "Google Chat",
    "people.googleapis.com": "Google Contacts",
    "tasksmcp.googleapis.com": "Google Tasks",
    "workspacemcp.googleapis.com": "Google Workspace",
}

def build_base_meta() -> dict[str, Any]:
  """Returns the required per-request _meta block for /mcp/v1 calls."""
  return {
      "io.modelcontextprotocol/protocolVersion": PROTOCOL_VERSION,
      "io.modelcontextprotocol/clientInfo": CLIENT_INFO,
      "io.modelcontextprotocol/clientCapabilities": {
          "elicitation": {"form": {}}
      },
  }

def strip_markdown(text: str) -> str:
  """Minimal example that strips basic Markdown for terminal display."""
  text = re.sub(r"\[([^\]]+)\]\(([^)]+)\)", r"\1 (\2)", text)
  text = re.sub(r"\*\*(.*?)\*\*", r"\1", text)
  return re.sub(r"`([^`]+)`", r"\1", text)

def extract_decision_options(
    requested_schema: dict[str, Any],
) -> tuple[str | None, str, list[dict[str, str]]]:
  """Extracts the property key, question title, and options from schema."""
  properties = requested_schema.get("properties", {})
  first_entry = next(iter(properties.items()), None)
  if first_entry is None:
    return None, "Confirm this action?", []

  field_key, field_schema = first_entry
  question_title = field_schema.get("title", "Confirm this action?")

  if "enum" in field_schema:
    enum_values = field_schema.get("enum", [])
    enum_names = field_schema.get("enumNames", [])
    options = [
        {
            "value": val,
            "label": enum_names[idx] if idx < len(enum_names) else val,
        }
        for idx, val in enumerate(enum_values)
    ]
  elif "oneOf" in field_schema:
    options = [
        {
            "value": item["const"],
            "label": item.get("title", item["const"]),
        }
        for item in field_schema["oneOf"]
    ]
  else:
    options = []
  return field_key, question_title, options

def prompt_user_in_cli(
    elicitation_req: dict[str, Any],
    result_meta: dict[str, Any],
    tool_name: str,
    server_host: str = "calendarmcp.googleapis.com",
) -> dict[str, Any]:
  """Renders a CLI approval prompt and returns the inputResponses entry."""
  params = elicitation_req.get("params", {})
  req_meta = params.get("_meta", {})
  server_info = result_meta.get(
      "io.modelcontextprotocol/serverInfo", {}
  )
  server_title = (
      req_meta.get("title")
      or result_meta.get("title")
      or server_info.get("title")
      or server_info.get("name")
      or HOST_TITLES.get(server_host, "Google Workspace MCP")
  )
  message = strip_markdown(params.get("message", "Confirm this action."))
  field_key, question_title, options = extract_decision_options(
      params.get("requestedSchema", {})
  )
  if not field_key or not options:
    return {"action": "cancel"}

  print(f"\n=== {server_title} ({tool_name}) ===")
  print(message)
  print(f"\n{strip_markdown(question_title)}")
  for idx, opt in enumerate(options, start=1):
    print(f"  [{idx}] {opt['label']} ({opt['value']})")

  choice = input(
      f"Enter choice (1-{len(options)}, or c to cancel): "
  ).strip()
  try:
    selected_idx = int(choice) - 1
    if 0 <= selected_idx < len(options):
      selected_value = options[selected_idx]["value"]
      return {
          "action": "accept",
          "content": {field_key: selected_value},
      }
  except ValueError:
    pass

  return {"action": "cancel"}

def handle_tool_call_with_elicitation(
    send_rpc_fn: Any, tool_name: str, tool_args: dict[str, Any]
) -> dict[str, Any]:
  """Executes tools/call and retries with inputResponses when elicited."""
  base_params = {
      "name": tool_name,
      "arguments": copy.deepcopy(tool_args),
      "_meta": build_base_meta(),
  }
  request_id = 1
  response = send_rpc_fn(
      {
          "jsonrpc": "2.0",
          "id": request_id,
          "method": "tools/call",
          "params": copy.deepcopy(base_params),
      }
  )

  for _ in range(MAX_ELICITATION_ROUNDS):
    result = response.get("result", {})
    if result.get("resultType") != "input_required":
      return response

    input_requests = result.get("inputRequests", {})
    if not isinstance(input_requests, dict) or not input_requests:
      return response

    result_meta = result.get("_meta", {})
    input_responses: dict[str, Any] = {}
    for req_key, req in input_requests.items():
      if (
          isinstance(req, dict)
          and req.get("method") == "elicitation/create"
          and req.get("params", {}).get("mode") == "form"
      ):
        input_responses[req_key] = prompt_user_in_cli(
            req, result_meta, tool_name
        )

    if not input_responses:
      return response

    request_id += 1
    retry_params = copy.deepcopy(base_params)
    request_state = result.get("requestState")
    if request_state is not None:
      retry_params["requestState"] = request_state
    retry_params["inputResponses"] = input_responses
    response = send_rpc_fn(
        {
            "jsonrpc": "2.0",
            "id": request_id,
            "method": "tools/call",
            "params": retry_params,
        }
    )

  return response

Agent skill

Use the following as a skill or prompt for your coding agent to implement form elicitation for your agent harness:

Prompt

---
name: google-workspace-mcp-elicitation
metadata:
  version: "1.0.0"
  category: GoogleWorkspace
description: >-
  Implements Model Context Protocol (MCP) form elicitation
  (`elicitation/create`) for Human-in-the-Loop (HITL) approvals with Google
  Workspace MCP servers (Gmail, Calendar, Drive, Docs, Sheets, Slides, Chat,
  Tasks, Contacts). Use when adding HITL confirmation prompts to an agent,
  handling Stateless HTTP (`2026-07-28`) Multi Round-Trip Requests
  (`resultType: "input_required"`), mapping elicitation schemas or `_meta`
  hints to UI controls, or troubleshooting Workspace MCP `401`/`403`/`405`
  and capability errors. Don't use for general OAuth 2.0 app setup unrelated
  to MCP or for authoring custom MCP servers.
---

# Implementing Google Workspace MCP Form Elicitation (HITL)

Use this guide to support **Model Context Protocol (MCP) Form Elicitation**
for Human-in-the-Loop (HITL) confirmations when integrating **Google
Workspace MCP servers** into an AI agent.

Rather than duplicating the MCP specification, this guide references the
canonical specs and focuses on **Google Workspace server nuances**, **mapping
protocol message fields to UI**, **upcoming Google Workspace `_meta`
extensions**, and **practical integration boundaries**:

- [MCP Elicitation Specification][mcp-elicitation]
- [MCP Multi Round-Trip Requests (MRTR) Specification][mcp-mrtr]
- [MCP Lifecycle & Initialization][mcp-life]
- [MCP Icons Utility Specification][mcp-icon]

---

## 1. Prerequisites, Nuances & Architectural Boundaries

### Prerequisites (Assumed Configured)

This skill focuses on **handling elicitation requests and mapping them to
UI**. It assumes the host application already has Google Workspace MCP
connectivity and OAuth 2.0 configured. If not yet set up, follow the
[Google Workspace MCP Server Configuration Guide][ws-mcp-setup] to configure:

1. **Google Cloud Project & Service Enablement**: A Google Cloud project with
   the target Google Workspace APIs and MCP endpoints enabled.
2. **OAuth 2.0 Bearer Authentication**: An OAuth 2.0 flow issuing user access
   tokens with the required service scopes, passed as
   `Authorization: Bearer {access_token}` on MCP HTTP `POST` requests. When
   using standard 3-legged OAuth 2.0, the OAuth client configuration must
   have the **"Used by an agent"** checkbox enabled.

Canonical MCP server URLs and default OAuth 2.0 scopes by service:

- **Gmail** (`https://gmailmcp.googleapis.com/mcp/v1`):
  - `https://www.googleapis.com/auth/gmail.modify`
  - `https://www.googleapis.com/auth/gmail.settings.basic`
- **Google Calendar** (`https://calendarmcp.googleapis.com/mcp/v1`):
  - `https://www.googleapis.com/auth/calendar.events`
  - `https://www.googleapis.com/auth/calendar.readonly`
- **Google Drive** (`https://drivemcp.googleapis.com/mcp/v1`):
  - `https://www.googleapis.com/auth/drive`
- **Google Docs** (`https://docsmcp.googleapis.com/mcp/v1`):
  - `https://www.googleapis.com/auth/documents`
- **Google Sheets** (`https://sheetsmcp.googleapis.com/mcp/v1`):
  - `https://www.googleapis.com/auth/spreadsheets`
- **Google Slides** (`https://slidesmcp.googleapis.com/mcp/v1`):
  - `https://www.googleapis.com/auth/presentations`
- **Google Chat** (`https://chatmcp.googleapis.com/mcp/v1`):
  - `https://www.googleapis.com/auth/chat.messages`
- **Google Contacts** (`https://people.googleapis.com/mcp/v1`):
  - `https://www.googleapis.com/auth/contacts`
- **Google Tasks** (`https://tasksmcp.googleapis.com/mcp/v1`):
  - `https://www.googleapis.com/auth/tasks`
- **Universal Search, Developer Preview**
  (`https://workspacemcp.googleapis.com/mcp/v1`):
  - `https://www.googleapis.com/auth/gmail.readonly`
  - `https://www.googleapis.com/auth/drive.readonly`
  - `https://www.googleapis.com/auth/calendar.readonly`
  - `https://www.googleapis.com/auth/chat.messages.readonly`
  - `https://www.googleapis.com/auth/chat.spaces.readonly`
  - `https://www.googleapis.com/auth/chat.memberships.readonly`

### Key Nuances for Google Workspace MCP Servers

- **Markdown Messages**: Google Workspace MCP servers format `params.message`
  as **GitHub-Flavored Markdown** (headings, bold labels, bulleted lists of
  parameters, links). Render `params.message` with a Markdown renderer rather
  than plain text.
- **Selective Server-Side Gate and Layered Policies**: Workspace form
  elicitation selectively gates sensitive operations on the server, such as
  **high-impact write operations** like sending an email, scheduling a meeting
  with external attendees, or modifying a shared document, as well as
  **reads of sensitive or externally shared data**, rather than triggering on
  every tool call or validating general agent intent. Form elicitation adds a
  server-side user approval check and doesn't replace the host's own
  permission model, tool blocks, or enterprise governance policies. Because
  sensitive actions already trigger a server-side `elicitation/create` prompt,
  enabling unconditional client-side pre-tool approvals such as
  `needsApproval: true` on all tools can double-prompt the user. Factor this
  server-side gate into your risk assessment while preserving host-level
  policy blocks and any client-side approvals your organization requires.

### Architectural Boundaries: Do Not Fight the Framework

Pausing an in-flight tool call, presenting a prompt to a user, and resuming
execution cuts across the host application's language, agent framework, MCP
SDK, and UI surface. **Do not fight the host framework or re-implement MCP
from scratch**. Reuse what the framework and SDK already provide to the
fullest extent possible:

- **Reuse Built-In Framework & MCP SDK Elicitation Support First**: Before
  writing protocol or transport code, inspect the host application's agent
  framework and MCP client library for existing MCP tool adapters, capability
  negotiation, elicitation callbacks, and HITL interrupt/checkpoint
  mechanisms. Wire elicitation through those built-in extension points rather
  than replacing the SDK with a hand-rolled JSON-RPC client or custom
  tool-calling loop.
- **Stateless HTTP (`2026-07-28`) MRTR & Adapting Stateful Implementations**:
  Google Workspace MCP servers use Stateless HTTP (`2026-07-28`)
  [Multi Round-Trip Requests (MRTR)][mcp-mrtr] (`POST`-only, where `GET`
  returns `405`) to deliver `elicitation/create` prompts inside `tools/call`
  responses via `result.resultType === "input_required"`
  (`result.requestState`, `result.inputRequests`) and resume when
  `tools/call` is replayed with `params.requestState` and
  `params.inputResponses`. Supporting older stateful transports is not
  required for Google Workspace, but existing elicitation support in an SDK
  or host application might assume stateful server-initiated streams
  (`2025-11-25`). Verify how the existing client handles elicitation: if it
  already implements Stateless HTTP MRTR, use it directly. If it only listens
  for stateful server-to-client stream requests (or strips MRTR fields during
  typed deserialization), adapt the transport layer so `input_required`
  responses route through the SDK's registered elicitation handler and replay
  `tools/call` with `requestState` and `inputResponses`.
- **Elicitation Rendering Is a Presentation-Layer Concern**: Keep protocol
  and transport handling decoupled from UI rendering. Pass the structured
  elicitation request (`message`, `requestedSchema`, and `_meta`) to the host
  application's presentation layer rather than embedding UI markup inside
  agent or transport code, and render it using the application's native UI
  paradigm rather than assuming HTML.
- **Suspension & Resumption Principles**: Regardless of how the host
  application is deployed, suspending and resuming an elicitation must
  satisfy three behaviors:
  1. *Yield Cleanly Waiting for User Input*: Pause the in-flight tool
     execution while waiting for the user's decision, using the host
     runtime's native mechanism (such as awaiting an async callback/channel
     in-memory or yielding via the framework's checkpoint/interrupt
     primitive).
  2. *Preserve Correlation & Continuation Context*: Retain the correlation ID
     (`requestId`), opaque server `requestState`, and original tool call
     context (`name`, `arguments`, and any prior `inputResponses`) across the
     pause, in memory if the session stays alive or in durable storage if the
     process or turn can terminate before the user responds.
  3. *Accumulate Multi-Round-Trip Responses*: When replaying `tools/call`
     with `requestState` and `inputResponses`, keep accumulating responses
     across rounds if the server returns subsequent `input_required` stages
     until the tool returns a final `CallToolResult`.

---

## 2. Phase 1: Core Form Elicitation Support (Priority)

Start by supporting standard [MCP Form Elicitation][mcp-elicitation]
end-to-end using your framework's and MCP SDK's built-in primitives so any
schema renders and resolves cleanly on the host UI surface.

### Step 1: Enable Elicitation & Register Handler

1. Register an `elicitation/create` handler through your agent framework or
   MCP client SDK, and ensure the client advertises the `elicitation`
   capability during initialization (and in per-request capability metadata
   when using Stateless HTTP discovery):

   ```json
 {
   "capabilities": {
     "elicitation": {}
   }
 }
 ```

2. Verify that your client handles Stateless HTTP (`2026-07-28`)
   [MRTR][mcp-mrtr] (`result.resultType === "input_required"`). If the SDK
   does not yet handle `input_required` natively, adapt the transport so each
   entry in `result.inputRequests` (preserving `_meta` hints) is passed to
   your registered elicitation handler and `tools/call` is replayed with
   `params.requestState` and `params.inputResponses`.

### Step 2: Render Prompt on the Host UI Surface & Collect User Input

1. **Map Protocol Fields to the Host UI Surface**:
   - Render `params.message` using a **Markdown renderer appropriate for the
     host surface** (for example, GFM component in a web UI, formatted text
     widgets in a chat card, or terminal Markdown in a CLI/TUI).
   - Present input controls for `params.requestedSchema.properties` covering
     all [MCP Elicitation supported schema types][mcp-schema-types]
     (`string`, `number`, `integer`, `boolean`, and `enum` / `oneOf`).
2. **Collect the User's Decision**: Format the user's response per the
   [MCP Elicitation response specification][mcp-elicitation]:
   - **Submit Form / Select Option**:
     `{ "action": "accept", "content": { ... } }` *(Note: When the schema
     presents explicit `ALLOW_*` and `DENY_*` enum options, selecting a
     `DENY_*` option is still submitted with `action: "accept"` and the
     selected enum value in `content`.)*
   - **Decline**: `{ "action": "decline" }`
   - **Cancel / Dismiss**: `{ "action": "cancel" }`

### Step 3: Return the Elicitation Result

Return the `{ action, content }` result from your elicitation handler (or
pass it to your framework's resume mechanism) so the MCP client completes the
tool call and returns the final `CallToolResult` to the agent.

---

## 3. Phase 2: Optional UX Enhancements & Custom `_meta` Extensions

Once generic form elicitation works, you can optionally enhance the UX for
single-enum prompts and Google Workspace `_meta` extensions on your target UI
surface. Always treat `_meta` fields as optional (`undefined`-safe) so the UI
degrades cleanly to the Phase 1 form.

> [!NOTE]
> Google Workspace MCP servers define custom `_meta` presentation attributes
> (`isConfirmation`, `title`, `icons`, `learn_more_url`), but do not yet emit
> them in production responses. **Enhancement A** works today for `<= 4` enum
 options using standard schema fields, whereas **Enhancements B and C** rely
> on upcoming `_meta` attributes. **Only implement Enhancements B and C if
> explicitly directed to by the user.**

### Enhancement A: Single-Enum Auto-Submitting Action Buttons / Quick Choices

Most HITL confirmations ask a single multiple-choice question (where
`requestedSchema.properties` has **1 property** defining `enum` or `oneOf`).

- **When to Apply**: Present a single-enum schema as direct auto-submitting
  action buttons (or single-step quick choices in a TUI/CLI) **if and only
  if**:
  1. The single enum has **`<= 4` options**, **or**
  2. The prompt is explicitly flagged as a HITL confirmation
     (`params._meta?.isConfirmation === true`). Otherwise (for example, a
     generic single-enum prompt with `> 4` options), fall back to the
     standard Phase 1 selection form/menu.
- **Option Labels, Hierarchy & Submission**: Use `enumNames[i]` or
  `oneOf[i].title` (falling back to a human-readable format of the enum
  value) as the option label, assign visual emphasis in enum order
  (`1st option -> primary`, `2nd option -> secondary`,
  `3rd+ option -> tertiary`), and immediately submit
  `{ "action": "accept", "content": { "{field_name}": "{selected_value}" } }`
  when chosen, even when the user selects a `DENY_*` option.
- **Hide or De-Emphasize Redundant Decline/Cancel Controls**: Because HITL
  schemas already include explicit `DENY_*` enum options (which are
  functionally equivalent to declining/canceling on the server), presenting
  separate generic `Decline` and `Cancel` buttons alongside `Allow` and
  `Deny` enum choices is redundant. In this single-enum action view, omit a
  separate `Decline` control and map `{ "action": "cancel" }` only to a
  de-emphasized dismiss affordance appropriate to the surface (such as a
  corner close `x` icon / `Escape` key in a GUI, or a `[c] Cancel` key in a
  TUI).

### Enhancement B: Dynamic Button Stacking (Only If Explicitly Requested)

- **When to Apply**: On surfaces that support grouped/split buttons (or
  grouped action menus), stack related options **if and only if**
  `params._meta?.isConfirmation === true`. Never stack options based on enum
  names alone when `isConfirmation` is not `true`.
- **Do Not Assume a Fixed Enum Set (`ALLOW_*` / `DENY_*` Convention)**: The
  exact approval enum values are not a fixed list and might change over time
  (for example, `ALLOW_ONCE`, `ALLOW_SESSION`, `ALWAYS_ALLOW`, `DENY_ONCE`),
  following the `ALLOW_*` and `DENY_*` convention.
  1. **Group by Action Prefix (`ALLOW` vs. `DENY`)**: Group options
     dynamically by their action token/prefix, normalizing leading modifiers
     like `ALWAYS_` or `ONCE_` so all `ALLOW` variants (such as `ALLOW_ONCE`,
     `ALLOW_SESSION`, `ALWAYS_ALLOW`) stack into one group and `DENY`
     variants (such as `DENY_ONCE`) group into another.
  2. **Intra-Group Order**: Within each group, use the **first option in the
     schema's enum order** as the primary action, and place remaining options
     in that group (if any) into its secondary/split menu in enum order
     (rendering a standalone button/action when a group has only one option).
  3. **Inter-Group Hierarchy**: Order groups by their first appearance in the
     enum and assign visual emphasis accordingly (`1st group -> primary`,
     `2nd group -> secondary`, `3rd+ group -> tertiary`).

### Enhancement C: Custom `_meta` & `serverInfo` Hints (Only If Requested)

When present in the elicitation request's `params._meta` or the MCP server's
`Implementation` metadata (`serverInfo` from [MCP initialization][mcp-life]
or discovery), map these optional presentation fields to the confirmation
prompt (adapting to what the host UI surface supports):

- **Title (`params._meta?.title`)**: Use `params._meta.title` if non-empty.
  Otherwise fall back to `"{server_name} confirmation"`.
- **Service Icon (`params._meta?.icons` / `serverInfo?.icons`)**: Check
  `params._meta?.icons?.[0]?.src` first, then fall back to
  `serverInfo?.icons?.[0]?.src` (per the [MCP Icons specification][mcp-icon]).
  On graphical/card surfaces, render the icon only when a URL is present and
  hide it on load error.
- **Learn More Link (`params._meta?.learn_more_url`)**: If present, display a
  subtle "Learn more" link or URL reference in the prompt footer pointing to
  `learn_more_url`.

---

## 4. Verification & Troubleshooting

### Verification: Triggering Conditions & Expected Behavior

Because Google Workspace MCP servers apply **context-aware server-side
policies**, **not every tool call or write operation triggers an
elicitation**:

- **Absence of an Elicitation Is Often Expected**: Operations confined to the
  user's own private resources (for example, creating a Calendar event with
  no attendees, or editing a private unshared Google Doc) might execute
  immediately without an elicitation prompt. Do **not** treat a tool call
  succeeding without an elicitation as a bug in your client implementation.
- **Scenarios That Reliably Trigger Elicitation**: To test your elicitation
  flow end-to-end, use prompts that cross external or shared-resource
  boundaries, such as:
  - **Google Calendar**: Creating or updating an event **with an external
    participant** (such as `dana@example.com`), or deleting an event with
    attendees.
  - **Gmail**: Sending an email to a recipient, deleting a draft, or creating
    a mail filter.
  - **Google Docs / Drive**: Updating **a shared document** or reading
    sensitive/externally shared content.
- **End-to-End Validation Checklist**: Run a test prompt against one of the
  scenarios above, verify each item below, and if any step fails, diagnose
  the failure using the troubleshooting list below, apply the fix, and re-run
  the check until all items pass:
  - [ ] `params.message` renders as formatted Markdown on the target UI
    surface.
  - [ ] Approving (`accept`) replays `tools/call` with `requestState` and
    `inputResponses` and returns the completed tool output.
  - [ ] Declining (`decline`) or canceling (`cancel`) resolves cleanly
    without hanging the agent turn.

### Troubleshooting Definitive Errors (`40x` & Protocol Failures)

- **Server refuses to execute `tools/call` stating elicitation is not
  supported**:
  - *Root cause*: Definitive signal that the client did not advertise
    `elicitation` capability correctly.
  - *Resolution*: Ensure `capabilities: { elicitation: {} }` is sent during
    initialization (and in per-request client capability metadata if using
    Stateless HTTP discovery), and verify that your 3-legged OAuth 2.0 client
    has **"Used by an agent"** enabled.
- **`tools/call` returns `resultType: "input_required"` as raw tool output
  (no prompt shown)**:
  - *Root cause*: Definitive signal that the server triggered an elicitation,
    but the MCP client did not handle the Stateless HTTP (`2026-07-28`)
    [MRTR][mcp-mrtr] response (or stripped MRTR fields during typed
    deserialization).
  - *Resolution*: Verify your MCP client library supports Stateless HTTP MRTR
    (`2026-07-28`) and preserves `resultType`, `requestState`,
    `inputRequests`, and `_meta`, or handle `input_required` and replay
    `tools/call` with `requestState` and `inputResponses`.
- **`401 Unauthorized`**:
  - *Root cause*: Missing, expired, or invalid OAuth 2.0 access token.
  - *Resolution*: Verify `Authorization: Bearer {access_token}` is attached
    to every MCP HTTP `POST` request and refresh expired tokens.
- **`403 Forbidden` (Standard JSON error body)**:
  - *Root cause*: OAuth token is missing required Google Workspace scopes for
    the target server/tool, or the user lacks resource permission.
  - *Resolution*: Compare granted token scopes against the default OAuth 2.0
    scopes in Section 1 and re-consent.
- **`403 Forbidden` (Response body contains `{"result":{"tools":[...]}}`
  schema dump)**:
  - *Root cause*: Google Cloud project has not enabled the target Workspace
    MCP service (or is not allowlisted). Because unauthenticated `tools/list`
    discovery is permitted on the endpoint, the server returns the full
    `tools/list` schema payload in the HTTP `403` error body while keeping
    the `403` status code.
  - *Resolution*: Enable the corresponding MCP service on the OAuth client's
    Google Cloud project per the [Workspace MCP setup guide][ws-mcp-setup].
    Summarize this error in logs to avoid dumping 50KB+ of tool schemas.
- **`405 Method Not Allowed`**:
  - *Root cause*: MCP client or SDK sent an HTTP `GET` request (probing for
    legacy SSE) instead of `POST`.
  - *Resolution*: Google Workspace MCP endpoints are Stateless HTTP
    `POST`-only. Configure the transport for `POST`-only or short-circuit
    `GET` probes locally with `405`.

[mcp-elicitation]:
  https://modelcontextprotocol.io/specification/latest/client/elicitation
[mcp-mrtr]:
  https://modelcontextprotocol.io/specification/latest/basic/patterns/mrtr
[mcp-life]:
  https://modelcontextprotocol.io/specification/latest/basic/lifecycle
[mcp-icon]:
  https://modelcontextprotocol.io/specification/latest/basic/utilities/icons
[mcp-schema-types]:
  https://modelcontextprotocol.io/specification/latest/client/elicitation#supported-schema-types
[ws-mcp-setup]:
  https://developers.google.com/workspace/guides/configure-mcp-servers

Next steps