generate_code
Generate TypeScript or JavaScript tracking code from a data layer spec, including type definitions, helper functions, and event tracking.
Instructions
Generates TypeScript or JavaScript code from a tracking specification or data layer. Includes type definitions, helper functions, and event tracking code.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "generate_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spec | No | Tracking specification with variables and events | |
| language | No | Target language | typescript |
| dataLayer | No | Data layer object to generate types from | |
| includeHelpers | No | Include helper functions like trackEvent() |