Resource extension that synthesizes :eval and :docs generic actions for
driving an LLM agent against a scoped Lua surface.
defmodule MyApp.Agents.MCPActions do
use Ash.Resource, extensions: [AshLua.EvalActions]
eval_actions do
resource MyApp.Posts.Post, actions: [:read, :get_statistics]
resource MyApp.Posts.Comment, actions: [:read]
end
endThe synthesized actions inherit the caller's actor / tenant / context — both
the script body and the documentation rendering are constrained to the
configured (resource, action) pairs, and every Ash call inside the Lua
script flows through the standard authorization machinery.