MCPcopy
hub / github.com/modelcontextprotocol/python-sdk / elicit_url

Method elicit_url

src/mcp/shared/peer.py:183–201  ·  view source on GitHub ↗

Send a URL-mode `elicitation/create` request. Raises: MCPError: The peer responded with an error. NoBackChannelError: No back-channel for server-initiated requests. pydantic.ValidationError: The peer's result does not match the expected result type.

(
        self,
        message: str,
        url: str,
        elicitation_id: str,
        *,
        meta: Meta | None = None,
        opts: CallOptions | None = None,
    )

Source from the content-addressed store, hash-verified

181 return ElicitResult.model_validate(result, by_name=False)
182
183 async def elicit_url(
184 self,
185 message: str,
186 url: str,
187 elicitation_id: str,
188 *,
189 meta: Meta | None = None,
190 opts: CallOptions | None = None,
191 ) -> ElicitResult:
192 """Send a URL-mode `elicitation/create` request.
193
194 Raises:
195 MCPError: The peer responded with an error.
196 NoBackChannelError: No back-channel for server-initiated requests.
197 pydantic.ValidationError: The peer's result does not match the expected result type.
198 """
199 params = ElicitRequestURLParams(message=message, url=url, elicitation_id=elicitation_id)
200 result = await self.send_raw_request("elicitation/create", dump_params(params, meta), opts)
201 return ElicitResult.model_validate(result, by_name=False)
202
203 @deprecated("The roots capability is deprecated as of 2026-07-28 (SEP-2577).", category=MCPDeprecationWarning)
204 async def list_roots(self, *, meta: Meta | None = None, opts: CallOptions | None = None) -> ListRootsResult:

Callers 9

request_api_keyFunction · 0.45
oauth_flowFunction · 0.45
payment_flowFunction · 0.45
check_url_responseFunction · 0.45
direct_elicit_urlFunction · 0.45
call_toolFunction · 0.45
secure_paymentFunction · 0.45

Calls 3

send_raw_requestMethod · 0.95
dump_paramsFunction · 0.85

Tested by 8

request_api_keyFunction · 0.36
oauth_flowFunction · 0.36
payment_flowFunction · 0.36
check_url_responseFunction · 0.36
direct_elicit_urlFunction · 0.36
call_toolFunction · 0.36