For AI agents: the complete documentation index is available at /hclapi/llms.txt, the full documentation bundle is available at /hclapi/llms-full.txt, and this page is available as Markdown at /hclapi/docs/manifest/functions/collections/contains.md.

contains

Determines whether a list contains a specific value.

Signature

contains(list: list, value: any) -> bool

Parameters

ParameterTypeRequiredDescription
list, valuelist, anyyesList and candidate value

Return value

Returns the documented result for the function signature.

Example

respond {
  condition = !contains(["admin", "editor"], ctx.request.headers.x_role)
  status = 403
  body = { error = "Forbidden: Insufficient privileges" }
}