* 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,
)
| 717 | * Sends an elicitation request to the SDK consumer and returns the response. |
| 718 | */ |
| 719 | async handleElicitation( |
| 720 | serverName: string, |
| 721 | message: string, |
| 722 | requestedSchema?: Record<string, unknown>, |
| 723 | signal?: AbortSignal, |
| 724 | mode?: 'form' | 'url', |
| 725 | url?: string, |
| 726 | elicitationId?: string, |
| 727 | ): Promise<ElicitResult> { |
| 728 | try { |
| 729 | const result = await this.sendRequest<ElicitResult>( |
| 730 | { |
| 731 | subtype: 'elicitation', |
| 732 | mcp_server_name: serverName, |
| 733 | message, |
| 734 | mode, |
| 735 | url, |
| 736 | elicitation_id: elicitationId, |
| 737 | requested_schema: requestedSchema, |
| 738 | }, |
| 739 | SDKControlElicitationResponseSchema(), |
| 740 | signal, |
| 741 | ) |
| 742 | return result |
| 743 | } catch { |
| 744 | return { action: 'cancel' as const } |
| 745 | } |
| 746 | } |
| 747 | |
| 748 | /** |
| 749 | * Creates a SandboxAskCallback that forwards sandbox network permission |
no outgoing calls
no test coverage detected