Skip to content

Documentation / @agentick/mcp / ElicitAPI

Interface: ElicitAPI ​

Defined in: protocol/types.ts:899

Sugar surface exposed at MCPHandlerContext.elicit (undefined when the client did not advertise any elicitation sub-capability).

Methods ​

canDoForm() ​

canDoForm(): boolean

Defined in: protocol/types.ts:1013

Returns ​

boolean


canDoUrl() ​

canDoUrl(): boolean

Defined in: protocol/types.ts:1014

Returns ​

boolean


confirm() ​

confirm(message, opts?): Promise<boolean>

Defined in: protocol/types.ts:936

Parameters ​

message ​

string

opts? ​
default? ​

boolean

timeoutMs? ​

ElicitTimeoutOption

Returns ​

Promise<boolean>


multiSelect() ​

multiSelect<T>(message, options, opts?): Promise<T[number][]>

Defined in: protocol/types.ts:924

Type Parameters ​

T ​

T extends readonly string[]

Parameters ​

message ​

string

options ​

T

opts? ​
default? ​

T[number][]

labels? ​

Partial<Record<T[number], string>>

max? ​

number

min? ​

number

timeoutMs? ​

ElicitTimeoutOption

Returns ​

Promise<T[number][]>


number() ​

number(message, opts?): Promise<number>

Defined in: protocol/types.ts:941

Parameters ​

message ​

string

opts? ​
default? ​

number

integer? ​

boolean

max? ​

number

min? ​

number

timeoutMs? ​

ElicitTimeoutOption

Returns ​

Promise<number>


object() ​

object<T>(message, schema, opts?): Promise<T>

Defined in: protocol/types.ts:957

Arbitrary structured input via Zod schema. Validated for spec flatness (no nested objects, no arrays of objects beyond enums) BEFORE dispatching to the client — fail fast on the server side.

Type Parameters ​

T ​

T

Parameters ​

message ​

string

schema ​

ZodType<T, unknown, $ZodTypeInternals<T, unknown>>

opts? ​
timeoutMs? ​

ElicitTimeoutOption

Returns ​

Promise<T>


requireUrls() ​

requireUrls(elicitations): never

Defined in: protocol/types.ts:977

Throws a URLElicitationRequiredError (-32042 protocol error) containing one or more URL-mode elicitation specs the client should walk before retrying. Used for OAuth-style deferred-auth flows. Never returns.

Parameters ​

elicitations ​

object[]

Returns ​

never


select() ​

select<T>(message, options, opts?): Promise<T[number]>

Defined in: protocol/types.ts:914

Type Parameters ​

T ​

T extends readonly string[]

Parameters ​

message ​

string

options ​

T

opts? ​
default? ​

T[number]

labels? ​

Partial<Record<T[number], string>>

timeoutMs? ​

ElicitTimeoutOption

Returns ​

Promise<T[number]>


text() ​

text(message, opts?): Promise<string>

Defined in: protocol/types.ts:902

Parameters ​

message ​

string

opts? ​
default? ​

string

format? ​

"email" | "uri" | "date" | "date-time"

maxLength? ​

number

minLength? ​

number

pattern? ​

string

timeoutMs? ​

ElicitTimeoutOption

Returns ​

Promise<string>


tryConfirm() ​

tryConfirm(message, opts?): Promise<ElicitOutcome<boolean>>

Defined in: protocol/types.ts:992

Parameters ​

message ​

string

opts? ​
default? ​

boolean

timeoutMs? ​

ElicitTimeoutOption

Returns ​

Promise<ElicitOutcome<boolean>>


tryMultiSelect() ​

tryMultiSelect<T>(message, options, opts?): Promise<ElicitOutcome<T[number][]>>

Defined in: protocol/types.ts:987

Type Parameters ​

T ​

T extends readonly string[]

Parameters ​

message ​

string

options ​

T

opts? ​
default? ​

string[]

labels? ​

Partial<Record<string, string>>

max? ​

number

min? ​

number

timeoutMs? ​

ElicitTimeoutOption

Returns ​

Promise<ElicitOutcome<T[number][]>>


tryNumber() ​

tryNumber(message, opts?): Promise<ElicitOutcome<number>>

Defined in: protocol/types.ts:996

Parameters ​

message ​

string

opts? ​
default? ​

number

integer? ​

boolean

max? ​

number

min? ​

number

timeoutMs? ​

ElicitTimeoutOption

Returns ​

Promise<ElicitOutcome<number>>


tryObject() ​

tryObject<T>(message, schema, opts?): Promise<ElicitOutcome<T>>

Defined in: protocol/types.ts:1000

Type Parameters ​

T ​

T

Parameters ​

message ​

string

schema ​

ZodType<T, unknown, $ZodTypeInternals<T, unknown>>

opts? ​
timeoutMs? ​

ElicitTimeoutOption

Returns ​

Promise<ElicitOutcome<T>>


trySelect() ​

trySelect<T>(message, options, opts?): Promise<ElicitOutcome<T[number]>>

Defined in: protocol/types.ts:982

Type Parameters ​

T ​

T extends readonly string[]

Parameters ​

message ​

string

options ​

T

opts? ​
default? ​

string

labels? ​

Partial<Record<string, string>>

timeoutMs? ​

ElicitTimeoutOption

Returns ​

Promise<ElicitOutcome<T[number]>>


tryText() ​

tryText(message, opts?): Promise<ElicitOutcome<string>>

Defined in: protocol/types.ts:981

Parameters ​

message ​

string

opts? ​
default? ​

string

format? ​

"email" | "uri" | "date" | "date-time"

maxLength? ​

number

minLength? ​

number

pattern? ​

string

timeoutMs? ​

ElicitTimeoutOption

Returns ​

Promise<ElicitOutcome<string>>


tryUrl() ​

tryUrl(opts): Promise<UrlElicitOutcome>

Defined in: protocol/types.ts:1005

Parameters ​

opts ​
message ​

string

timeoutMs? ​

ElicitTimeoutOption

url ​

string

Returns ​

Promise<UrlElicitOutcome>


url() ​

url(opts): Promise<UrlElicitOutcome>

Defined in: protocol/types.ts:965

Parameters ​

opts ​
message ​

string

timeoutMs? ​

ElicitTimeoutOption

url ​

string

Returns ​

Promise<UrlElicitOutcome>

Released under the ISC License.