Agent Client Protocol - v1.2.1
    Preparing search index...

    Variable CreateElicitationRequestExperimental

    CreateElicitationRequest: {
        isForm(
            value: CreateElicitationRequest,
        ): value is (ElicitationFormMode & { mode: "form"; }) & Pick<
            CreateElicitationRequest,
            "message"
            | "_meta",
        >;
        isUrl(
            value: CreateElicitationRequest,
        ): value is (ElicitationUrlMode & { mode: "url"; }) & Pick<
            CreateElicitationRequest,
            "message"
            | "_meta",
        >;
        isCustom(
            value: CreateElicitationRequest,
        ): value is (
            (ElicitationSessionScope | ElicitationRequestScope) & { [key: string]: unknown; mode: string; }
        ) & Pick<CreateElicitationRequest, "message" | "_meta">;
    }

    Validated type guards for CreateElicitationRequest's known variants.

    Each guard validates the variant's payload, not just its discriminant tag: a malformed known variant (right tag, wrong payload) matches no guard — mirroring wire validation, which rejects such values instead of classifying them as custom.

    Guards check the value as given: fields that wire deserialization salvages to a default (e.g. a malformed _meta) are only normalized by parsing, and for ambiguous raw shapes (a known tag combined with another variant's payload) guards are conservative where wire parsing may still accept the value — narrow wire-parsed values when exact parity matters.

    Type Declaration

    • isForm: function
      • Narrow to the form variant, validating its payload.

        Parameters

        • value: CreateElicitationRequest

        Returns value is (ElicitationFormMode & { mode: "form"; }) & Pick<
            CreateElicitationRequest,
            "message"
            | "_meta",
        >

    • isUrl: function
      • Narrow to the url variant, validating its payload.

        Parameters

        • value: CreateElicitationRequest

        Returns value is (ElicitationUrlMode & { mode: "url"; }) & Pick<
            CreateElicitationRequest,
            "message"
            | "_meta",
        >

    • isCustom: function
      • Narrow to a custom or future variant: the mode tag matches no known variant, with a valid payload.

        TypeScript keeps the known variants in the narrowed union (they are structural subtypes of the catch-all), so read vendor payload keys via a widening cast: (value as Record<string, unknown>).someKey.

        Parameters

        • value: CreateElicitationRequest

        Returns value is (
            (ElicitationSessionScope | ElicitationRequestScope) & { [key: string]: unknown; mode: string; }
        ) & Pick<CreateElicitationRequest, "message" | "_meta">