Create a macro
create-macroCreate chat or script macros in Foundry VTT by specifying a name, command, optional icon, and folder path. Macros can hold chat text, rolls, or JavaScript.
Instructions
Create a macro. A chat macro holds chat text or a chat command such as /roll 1d20. A script macro holds JavaScript that can do anything a Gamemaster can once someone runs it. Creating runs nothing.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>",
"type": "<type>",
"command": "<command>"
},
"name": "create-macro"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| img | No | Optional icon path | |
| name | Yes | Name of the macro | |
| type | Yes | "chat" or "script" | |
| command | Yes | Chat text or JavaScript | |
| folderPath | No | Folder for the macro; nested levels separated by "/" are created |