Skip to contents

Stops the call of a tool, a resource or a prompt with the error that the MCP specification names URLElicitationRequiredError (-32042): the client shows the user message and offers to open url, where the user gives what a form must never ask, such as a password, an API key or a payment, or authorizes a third-party service. The client then calls again. The page belongs to the package: it must check that the user who opens it is the one who made the call, and keep what it receives on the server, out of the client. A client that cannot open a page gets an error saying so. Over HTTP, once the user is done, the server of the page can send {"elicitationId": id} in a POST to /elicitation/complete on the MCP server, with its token if it has one: the client that got id is then told with notifications/elicitation/complete, and can call again by itself. A 2026-07-28 client gets instead a result that asks for the page, under id, and calls again once the user is done or declined: the function runs again, and calls elicit_url() again as long as the page has not received what it needs.

Usage

elicit_url(url, message, id)

Arguments

url

The http or https URL of the page, without credentials or personal data in it. Use https outside development.

message

A sentence telling the user why the page must be opened.

id

The ID of this elicitation, unique, which the page uses to find the call it completes.

Value

Does not return: it signals an error.

Examples

# In a tool: the call stops, and the client offers the page to the user.
connect_account <- function() {
  elicit_url(
    "https://runlog.example/connect",
    "Connect your running account.",
    "connect-1"
  )
}