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