Skip to main content
Glama

rex_action_do

Runs a named Rex action or Lua script with optional block, session, or client context, enforcing writable-session and allowlist permissions.

Instructions

Perform an action (rex do NAME --args JSON) or run Lua (script). Block actions need a writable session; init.lua actions and scripts need allowLua; client actions need allowClientActions.

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": "rex_action_do"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsNo
nameNo
blockNoBlock label, ID, or ID suffix
clientNo
scriptNoLua source to run
sessionNoSession label or ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden, and it does disclose real behavioral gates: writable-session requirement, allowLua, and allowClientActions. It omits side effects, whether actions are destructive, error behavior when a gate fails, and result format, so the disclosure is partial rather than complete.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two compact sentences with no filler, front-loading the primary action mode before the Lua alternative and then the permission gates. Parenthetical CLI syntax is dense but earns its place by mapping to the parameter names.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 6-parameter polymorphic dispatcher with nested object input, no output schema, and no annotations, the description covers modes and permissions but leaves the mode-selection contract unclear (0 required params) and says nothing about return values or failure modes. Adequate as a starting point, incomplete for safe invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 50% (block, script, session documented; args, name, client not). The description compensates somewhat by linking block actions to a writable session and client actions to the client parameter, and by noting `script` is Lua source, but it never explains `name` vs `script` selection, `args` structure, or whether they are mutually exclusive.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a concrete verb (perform an action) plus an alternate mode (run Lua via `script`), and shows the CLI equivalent `rex do NAME --args JSON`. The two execution paths are identifiable, but the description never distinguishes this dispatcher from siblings such as rex_run or rex_api_call, so an agent cannot route between them from this text alone.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives conditional prerequisites tied to parameter choice (block actions need a writable session; init.lua actions and scripts need allowLua; client actions need allowClientActions), which implies when each mode is usable. It never states when to prefer this tool over a sibling, nor when not to use it, leaving mode selection to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.