Generates Lua-side API documentation suitable for an MCP search_docs / get_docs
surface (notably for ash_ai).
The rendered output is intended for external consumers — humans reading hexdocs or
LLM clients picking which callable to invoke — so it deliberately avoids internal
vocabulary. Operations are described as get / list / create / update /
delete / call; stored, computed, and summary fields are all just "fields";
related records are described by cardinality and a link to the related record
type's page.
topics/1lists general topics of functionality, e.g."filters","pagination","error-handling";topic_doc/2renders one.list_callables/1andlist_types/1enumerate the documentable surface.callable_doc/2renders one operation (e.g."posts.post.create").type_doc/2renders one type (record type identified by its Lua path"posts.post", or named type by its readable name).full_doc/1concatenates everything into a single page.
Summary
Functions
Renders the markdown for one operation, addressed by its dotted path.
Renders a single page containing every operation and every type.
Returns the dotted callable paths (e.g. "posts.post.create") exposed to Lua,
in stable sorted order.
Returns the documentable type identifiers — record types as their Lua path
(e.g. "posts.post") and named types by their readable name (e.g. "PostStatus").
Sorted.
Searches the documentable surface for entries matching term.
Renders the markdown for one general topic by name.
Returns the available general-topic identifiers in stable sorted order.
Renders the markdown for one type. Accepts either
Types
@type manifest_or_opts() :: Ash.Info.Manifest.t() | keyword()
Functions
@spec callable_doc(manifest_or_opts(), String.t()) :: {:ok, String.t()} | {:error, :not_found}
Renders the markdown for one operation, addressed by its dotted path.
Returns {:ok, markdown} or {:error, :not_found}.
@spec full_doc(manifest_or_opts()) :: String.t()
Renders a single page containing every operation and every type.
The "Named types" section is omitted when there are none.
@spec list_callables(manifest_or_opts()) :: [String.t()]
Returns the dotted callable paths (e.g. "posts.post.create") exposed to Lua,
in stable sorted order.
@spec list_types(manifest_or_opts()) :: [String.t()]
Returns the documentable type identifiers — record types as their Lua path
(e.g. "posts.post") and named types by their readable name (e.g. "PostStatus").
Sorted.
@spec search(manifest_or_opts(), String.t()) :: String.t()
Searches the documentable surface for entries matching term.
Returns markdown — a header plus a bulleted list of matching callables,
record types, named types, and topics, ranked by relevance. The list is
intended as a discovery aid: the LLM (or human) picks one name and follows
up with callable_doc/2 / type_doc/2 / topic_doc/2 for the full page.
An empty / blank term returns an empty result page. The match limit is 20.
@spec topic_doc(manifest_or_opts(), String.t()) :: {:ok, String.t()} | {:error, :not_found}
Renders the markdown for one general topic by name.
Returns {:ok, markdown} or {:error, :not_found}.
@spec topics(manifest_or_opts()) :: [String.t()]
Returns the available general-topic identifiers in stable sorted order.
Topics are short reference pages — explanations of how reserved input keys work, the error-handling convention, etc. — rather than per-callable or per-type pages.
@spec type_doc(manifest_or_opts(), String.t() | module()) :: {:ok, String.t()} | {:error, :not_found}
Renders the markdown for one type. Accepts either:
- A Lua path string like
"posts.post"(record type). - A named-type readable name (the
:namefield onAsh.Info.Manifest.Type). - A module — looked up first as a named type, then as a record type.
Returns {:ok, markdown} or {:error, :not_found}.