mcp-use TypeScript API
    Preparing search index...

    Interface Elicit

    Requests or reads one keyed elicitation in a multi-round-trip tool callback.

    The explicit key correlates the request with the client's response on re-entry. On the first entry, or after an invalid form response, this returns { status: "required", result }; return that result from the tool. On re-entry it returns accept, decline, or cancel and validates accepted Standard Schema form data before exposing it. Validation may be synchronous or asynchronous.

    const confirmation = await ctx.elicit(
    "confirm",
    "Deploy to production?",
    schema,
    );
    if (confirmation.status === "required") {
    return confirmation.result;
    }
    • Request or read a typed form-mode elicitation.

      Type Parameters

      • S extends StandardSchemaWithJSON<unknown, unknown>

      Parameters

      • key: string
      • message: string
      • schema: S

      Returns Promise<ElicitationResult<InferOutput<S>>>

    • Request or read a URL-mode elicitation.

      Parameters

      • key: string
      • message: string
      • url: string

      Returns Promise<ElicitationResult<never>>