MCPcopy Create free account
hub / github.com/Noumena-Network/code / handleElicitation

Method handleElicitation

src/cli/structuredIO.ts:693–720  ·  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

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

Callers 2

drainCommandQueueFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected