Skip to content

Tool

Plugin ID: eca_tool:eca_tool

Available since: 1.0.0

Provided tokens

Token Description
[user] The current user.
Alias: current_user
[htmx] Information about the current HTMX request.
[htmx:is_request] Whether the current request was sent by HTMX ("1" or "0").
[htmx:boosted] Whether the current request was boosted by HTMX ("1" or "0").
[htmx:history_restore] Whether the current request is for HTMX history restoration ("1" or "0").
[htmx:target] The identifier of the element the response is targeted at.
[htmx:trigger] The identifier of the element that triggered the request. On Drupal 11 this is the element id, on Drupal 12 and later it is the CSS selector that htmx 4 sends. Prefer "trigger_name", which means the same thing on both.
[htmx:trigger_name] The name attribute of the element that triggered the request, or empty if it has none. This has the same meaning on all supported Drupal versions.
[htmx:source] The CSS selector of the element that triggered the request, for example button[name="first_item"]. Empty on Drupal 11, which does not send this information.
[htmx:request_type] Whether the request targets a full page or a fragment: "full" or "partial". Empty on Drupal 11, which does not send this information.
[htmx:current_url] The URL of the page the request was sent from.
[event] The event.
[event:machine_name] The machine name of the ECA event.
[VARIOUS] All tokens forwarded by the dispatcher.
[session_user] The user account that dispatched the event, regardless if ECA is processing models under a different account. This is only available if ECA is configured to always run under a specific account.

Defines an ECA-based tool that can be invoked by an AI agent or other automated system. The tool description and arguments are critically important for AI agents to understand when and how to use the tool.

Fields

Description — config key: description

Summarizes what this tool is for. This plain text property is particularly important to the AI agent because it provides context and explicitly defines the use case using natural language.

Type: textarea · Required: yes · Default: empty string

Arguments — config key: arguments

The arguments that the AI agent passes into the tool. They must be written in YAML format. This property is also important to the AI agent. Note that the top-level keys (e.g. node, user) become the names of the tokens that are then available to successors of this event.

Type: textarea · Required: no · Default: empty string

Outputs — config key: outputs

The values that the tool returns to its caller. They use the same YAML format as the arguments above. Each top-level key becomes a declared output of the tool, which the "Set tool output" action can then target by that name. When left empty, the tool declares a single output called tool_output.

Type: textarea · Required: no · Default: empty string

Operation — config key: operation

The nature of what this tool does. Callers use it to decide whether the tool modifies state and whether it is safe to repeat.

Type: select · Required: no · Default: write

Allowed values: explain, read, transform, trigger, write

Destructive — config key: destructive

Whether running this tool has consequences that cannot be undone. Callers use it to prompt for confirmation before they execute the tool.

Type: checkbox · Required: no · Default: true

Permission — config key: permission

The permission that a caller must have to execute this tool. When left empty, the Execute ECA tools permission is required. Naming a different permission here replaces that requirement.

Type: textfield · Required: no · Default: empty string

Value format: A permission machine name, for example "administer nodes". The available permissions depend on the modules installed on the target site.