Browse the docs

create_macro

Validates and saves a new macro in the Library, disabled and not exposed, for you to review.

Details #

An agent can write a macro, but it cannot turn it on. A created macro is always saved:

  • enabled: false, so no trigger fires it.

  • agent.exposed: false, approve: never, destructive: false. Only the description is kept from what the agent sent (description, or the older agent.description); it is marked as written by a model.

  • origin of kind ai, from agent; the Library shows who wrote it.

  • In the group named by group (an id or a name), or in a group called Agent, made on first use.

You review it in Switchboard, then turn it on. Until then the agent can lint_macro, dry_run and update_macro it.

{ "jsonrpc": "2.0", "id": 6, "method": "tools/call",
  "params": { "name": "create_macro", "arguments": { "json": {
    "name": "Say hello",
    "icon": "hand.wave",
    "do": [{ "id": "s1", "type": "hud", "params": { "text": "Hello" } }]
  } } } }
{
  "created": true,
  "id": "m_c10a77",
  "name": "Say hello",
  "warnings": [],
  "note": "Saved disabled and not exposed to agents. The user reviews it in Switchboard, then turns it on."
}

Gotchas #

  • An agent cannot expose a macro, enable it or change approval settings. That is deliberate.

See also #