Function

handle-response

Handle a response from the client to a previous server request

Servers can send requests to clients (e.g., sampling, root list requests). When the client responds, this function is called with the response.

The request-id is optional because notifications don't have IDs. Handlers should:

  1. Match the response to their pending request using the ID
  2. Resume any suspended operations waiting for this response
  3. Forward unrecognized responses downstream

https://spec.modelcontextprotocol.io/specification/client/elicitation

handle-response: func(id: option​<request-id>, response: result​<client-response, error-code>);