* Sends an elicitation request to the SDK consumer and returns the response.
(
serverName: string,
message: string,
requestedSchema?: Record<string, unknown>,
signal?: AbortSignal,
mode?: 'form' | 'url',
url?: string,
elicitationId?: string,
)
| 692 | * Sends an elicitation request to the SDK consumer and returns the response. |
| 693 | */ |
| 694 | async handleElicitation( |
| 695 | serverName: string, |
| 696 | message: string, |
| 697 | requestedSchema?: Record<string, unknown>, |
| 698 | signal?: AbortSignal, |
| 699 | mode?: 'form' | 'url', |
| 700 | url?: string, |
| 701 | elicitationId?: string, |
| 702 | ): Promise<ElicitResult> { |
| 703 | try { |
| 704 | const result = await this.sendRequest<ElicitResult>( |
| 705 | { |
| 706 | subtype: 'elicitation', |
| 707 | mcp_server_name: serverName, |
| 708 | message, |
| 709 | mode, |
| 710 | url, |
| 711 | elicitation_id: elicitationId, |
| 712 | requested_schema: requestedSchema, |
| 713 | }, |
| 714 | SDKControlElicitationResponseSchema(), |
| 715 | signal, |
| 716 | ) |
| 717 | return result |
| 718 | } catch { |
| 719 | return { action: 'cancel' as const } |
| 720 | } |
| 721 | } |
| 722 | |
| 723 | /** |
| 724 | * Creates a SandboxAskCallback that forwards sandbox network permission |
no outgoing calls
no test coverage detected