MCPcopy
hub / github.com/claude-code-best/claude-code / handleElicitation

Method handleElicitation

src/cli/structuredIO.ts:719–746  ·  view source on GitHub ↗

* 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,
  )

Source from the content-addressed store, hash-verified

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

Callers 2

drainCommandQueueFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected