Function: buildGenieTools()
buildGenieTools(
opts):MastraTools
Build the flat Mastra tools record for every configured Genie
space. Two shared, space-agnostic tools (get_statement,
prepare_chart) are registered once regardless of how many
spaces are wired; the per-space tools (ask_genie,
get_space_description, get_space_serialized) are suffixed
with _<alias> for non-default aliases so multi-space
deployments stay disambiguated.
Returns a record keyed by tool id, ready to spread into the
central Agent’s tools map (or surfaced via the
plugins.genie?.toolkit() callback). Returns an empty record
when spaces resolves to zero entries so the caller can spread
safely.
Parameters
Section titled “Parameters”config
Section titled “config”spaces
Section titled “spaces”GenieSpacesConfig | Record<string, GenieSpaceConfig>