The doc tag lets you add documentation to your scripts. Documentation is displayed as a hover tooltip in the editor when you hover over a function or run handle that references the script.
The doc block is ignored at runtime — it produces no output and has no effect on script execution.
Syntax
{% doc %} Description of what this script does.@param{type}param_name- Description of the parameter@example {% function"handle", param_name:"value"asresult %}{% enddoc %}
Place the doc block at the top of your script, before any logic.
Tags
@description
Describes what the script does. You can also write the description as plain text at the top of the block — if no @description tag is present, the first lines of text are used as the description.
Explicit:
{% doc %}@descriptionSends a tracking event to Klaviyo.{%enddoc%}
Implicit (no @description tag needed):
Both produce the same result.
@param
Documents a parameter that the script expects. Supports type annotations, optional markers, and descriptions.
Full format:
{string} — parameter type (e.g. string, number, object, array, boolean)
email — parameter name
- The customer's email address — description
Optional parameters — wrap the name in square brackets:
Minimal format — only the name is required:
@example
Shows a usage example. Everything after @example until the next tag or end of the block is treated as example code.
You can include multiple @example tags for different use cases.
Full example
Function script (handle: send_metric_to_klaviyo):
When you hover over "send_metric_to_klaviyo" in another script, the editor displays:
The script name
The description
A list of parameters with types and descriptions
Usage examples
Editor integration
The doc block is syntax highlighted in the editor:
@param, @description, @example tags are displayed in bold green
All other content is displayed in grey
This makes documentation blocks visually distinct from executable code.