Raxol.Headless.McpTools (Raxol v2.6.0)

View Source

MCP tool definitions for Raxol headless sessions.

Registers raxol_start, raxol_screenshot, raxol_send_key, raxol_get_model, raxol_stop, and raxol_list as MCP tools via Raxol.MCP.Registry.

Summary

Functions

Injects Raxol tools into Tidewave's ETS-based tool registry.

Register all headless tools with the given MCP Registry.

Returns the list of Raxol MCP tool definitions.

Functions

inject_into_tidewave()

@spec inject_into_tidewave() ::
  :ok
  | {:error,
     :inject_timeout
     | :tidewave_not_started
     | :tidewave_owner_not_alive
     | {:sys_replace_failed, term()}}

Injects Raxol tools into Tidewave's ETS-based tool registry.

Call after Tidewave.MCP has initialized (typically from Application.start). Safe to call multiple times -- tools are merged, not duplicated.

The Tidewave ETS table is :protected, so the insert must run in the owning process. We spawn a task linked to that process to do the write.

register(registry \\ Raxol.MCP.Registry)

@spec register(GenServer.server()) :: :ok

Register all headless tools with the given MCP Registry.

Called from Raxol.Application after the MCP supervisor and Headless are both running.

tools()

@spec tools() :: [Raxol.MCP.Registry.tool_def()]

Returns the list of Raxol MCP tool definitions.