Create Template Macro
create_template_macroCreates and registers custom Jinja2 macros for use in Google Workspace templates. Enables dynamic template customization by storing macros persistently or in-memory.
Instructions
Create and register a new Jinja2 template macro dynamically
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| macro_name | Yes | Name of the macro to create (must be a valid Python identifier) | |
| description | No | Optional description of the macro's purpose and functionality | |
| macro_content | Yes | Complete Jinja2 macro definition including {% macro %} and {% endmacro %} tags | |
| usage_example | No | Optional usage example showing how to call the macro in templates | |
| persist_to_file | No | Whether to save the macro to a .j2 file for permanent availability across server restarts | |
| user_google_email | No | Use 'me' or 'myself' for auto-resolution to authenticated user, or provide specific email address. If None, uses current authenticated user (auto-injected by middleware). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| macro | No | Created macro information if successful | |
| errors | No | List of error messages if creation failed | |
| success | Yes | Whether the macro was created successfully | |
| usage_info | No | Usage information for the created macro |