Skip to content

Variable: MastraClientConfigSchema

const MastraClientConfigSchema: ZodObject<{ agents: ZodArray<ZodString>; basePath: ZodString; chatAlwaysAvailable: ZodDefault<ZodBoolean>; defaultAgent: ZodString; feedbackEnabled: ZodDefault<ZodBoolean>; }, $strip>

JSON-safe descriptor published by the Mastra plugin’s clientConfig().

Only the irreducible data lives here: basePath (the one path the client can’t otherwise know, since it encodes the plugin’s mount name) plus the runtime agent roster. Every concrete endpoint URL is derived from basePath by the browser client (MastraPluginClient) using the shared MASTRA_ROUTES segments, so there’s nothing to publish per-route.

Fields:

  • basePath: plugin mount path. Always /api/<pluginName>. Feed it to new MastraPluginClient(config) (from @dbx-tools/ui-mastra) to get a typed client over every route plus the standard agent stream.
  • defaultAgent: agent id the client converses with when it doesn’t name one.
  • agents: every registered agent id in registration order.
  • feedbackEnabled: whether the server can log user feedback to MLflow (MLflow tracing is configured). Drives whether the chat UI surfaces thumbs / comment controls. Defaults to false so a config published by an older server (without the field) parses cleanly to “off”.
  • chatAlwaysAvailable: whether the agents’ Databricks calls run as the app service principal rather than on-behalf-of the signed-in user. When true the chat works for any caller who can open the app, so a UI that hides chat when the OBO token is absent should show it anyway. Defaults to false (the OBO / "user" identity mode), so an older server without the field keeps the OBO-gated behavior.