Class: MastraPluginClient
@mastra/client-js MastraClient extended with the Mastra plugin’s
custom routes. One client drives everything the chat UI needs:
- Conversation streaming through Mastra’s official AI SDK
chatRouteand the browser-native AI SDKDefaultChatTransport. - Native Mastra memory history and thread management, plus the model
catalogue (
models), Genie starter prompts (suggestions), MLflow feedback logging (feedback), and inline embed resolution (chart/statement) over the plugin’s own routes - all derived frombasePath+ routes.MASTRA_ROUTES.
Built from the plugin’s published clientConfig() payload
(MastraClientConfig). credentials: "include" is set once at
construction so the session cookie (which pins the server-side
thread id) travels with every request, streaming included.
Extends
Section titled “Extends”MastraClient
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MastraPluginClient(
config):MastraPluginClient
Parameters
Section titled “Parameters”config
Section titled “config”agents
Section titled “agents”string[] = ...
backgroundTurns?
Section titled “backgroundTurns?”boolean = ...
basePath
Section titled “basePath”string = ...
chatAlwaysAvailable?
Section titled “chatAlwaysAvailable?”boolean = ...
defaultAgent
Section titled “defaultAgent”string = ...
feedbackEnabled?
Section titled “feedbackEnabled?”boolean = ...
Returns
Section titled “Returns”MastraPluginClient
Overrides
Section titled “Overrides”MastraClient.constructor
Properties
Section titled “Properties”agents
Section titled “agents”
readonlyagents: readonlystring[]
Registered agent ids, surfaced for pickers.
apiPrefix
Section titled “apiPrefix”
protectedreadonlyapiPrefix:string
Inherited from
Section titled “Inherited from”MastraClient.apiPrefix
backgroundTurns
Section titled “backgroundTurns”
readonlybackgroundTurns:boolean
Whether turns continue server-side after the initiating stream disconnects.
basePath
Section titled “basePath”
readonlybasePath:string
Plugin mount prefix (/api/<plugin-name>); all custom routes derive from it.
channels
Section titled “channels”
readonlychannels:Channels
Inherited from
Section titled “Inherited from”MastraClient.channels
chatAlwaysAvailable
Section titled “chatAlwaysAvailable”
readonlychatAlwaysAvailable:boolean
Whether the agents run their Databricks calls 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 regardless. false (the default "user" identity
mode) keeps the OBO-gated behavior.
conversations
Section titled “conversations”
readonlyconversations:Conversations
Inherited from
Section titled “Inherited from”MastraClient.conversations
defaultAgent
Section titled “defaultAgent”
readonlydefaultAgent:string
Agent the bare (un-suffixed) routes resolve to.
feedbackEnabled
Section titled “feedbackEnabled”
readonlyfeedbackEnabled:boolean
Whether the server can log feedback to MLflow. When false, the
chat UI hides thumbs / comment controls and feedback would
be rejected server-side, so callers gate on this before offering
feedback affordances.
options
Section titled “options”
readonlyoptions:ClientOptions
Inherited from
Section titled “Inherited from”MastraClient.options
responses
Section titled “responses”
readonlyresponses:Responses
Inherited from
Section titled “Inherited from”MastraClient.responses
Methods
Section titled “Methods”abortAgentRun()
Section titled “abortAgentRun()”abortAgentRun(
params):Promise<boolean>
Explicitly stop one background agent run on the server.
Parameters
Section titled “Parameters”params
Section titled “params”agentId
Section titled “agentId”string
string
signal?
Section titled “signal?”AbortSignal
threadId?
Section titled “threadId?”string
Returns
Section titled “Returns”Promise<boolean>
addDatasetItem()
Section titled “addDatasetItem()”addDatasetItem(
params):Promise<{createdAt:string;datasetId:string;datasetVersion:number;expectedTrajectory?:unknown;externalId?:string|null;groundTruth?:unknown;id:string;input:unknown;metadata?: {[key:string]:unknown; } |null;requestContext?: {[key:string]:unknown; } |null;scorerIds?:string[] |null;source?: {referenceId?:string;type:"csv"|"json"|"trace"|"llm"|"experiment-result"|"candidate-screener"; } |null;toolMocks?:object[] |null;unmockedToolPolicy?:"allow"|"deny"|null;updatedAt:string; }>
Adds an item to a dataset
Parameters
Section titled “Parameters”params
Section titled “params”AddDatasetItemParams
Returns
Section titled “Returns”Promise<{ createdAt: string; datasetId: string; datasetVersion: number; expectedTrajectory?: unknown; externalId?: string | null; groundTruth?: unknown; id: string; input: unknown; metadata?: {[key: string]: unknown; } | null; requestContext?: {[key: string]: unknown; } | null; scorerIds?: string[] | null; source?: { referenceId?: string; type: "csv" | "json" | "trace" | "llm" | "experiment-result" | "candidate-screener"; } | null; toolMocks?: object[] | null; unmockedToolPolicy?: "allow" | "deny" | null; updatedAt: string; }>
Inherited from
Section titled “Inherited from”MastraClient.addDatasetItem
approveToolCallStream()
Section titled “approveToolCallStream()”approveToolCallStream(
agentId,params):Promise<MastraStreamResponse>
Resume a suspended requireApproval tool through the same official chat
route using Mastra’s native resumeData contract.
Parameters
Section titled “Parameters”agentId
Section titled “agentId”string
params
Section titled “params”requestContext?
Section titled “requestContext?”string
signal?
Section titled “signal?”AbortSignal
threadId?
Section titled “threadId?”string
toolCallId
Section titled “toolCallId”string
Returns
Section titled “Returns”Promise<MastraStreamResponse>
awaitBufferStatus()
Section titled “awaitBufferStatus()”awaitBufferStatus(
params):Promise<{record: {activeObservations:string;bufferedObservationChunks?:object[];bufferedObservations?:string;bufferedReflection?:string;config: {[key:string]:unknown; };createdAt:string;generationCount:number;id:string;isObserving:boolean;isReflecting:boolean;lastObservedAt?:string;metadata?: {[key:string]:unknown; };observationTokenCount:number;originType:"initial"|"observation"|"reflection";pendingMessageTokens:number;resourceId:string;scope:"thread"|"resource";threadId:string|null;totalTokensObserved:number;updatedAt:string; } |null; }>
Blocks until any in-flight observational memory buffering completes, then returns the updated record
Parameters
Section titled “Parameters”params
Section titled “params”AwaitBufferStatusParams
Parameters containing agentId, resourceId, threadId
Returns
Section titled “Returns”Promise<{ record: { activeObservations: string; bufferedObservationChunks?: object[]; bufferedObservations?: string; bufferedReflection?: string; config: {[key: string]: unknown; }; createdAt: string; generationCount: number; id: string; isObserving: boolean; isReflecting: boolean; lastObservedAt?: string; metadata?: {[key: string]: unknown; }; observationTokenCount: number; originType: "initial" | "observation" | "reflection"; pendingMessageTokens: number; resourceId: string; scope: "thread" | "resource"; threadId: string | null; totalTokensObserved: number; updatedAt: string; } | null; }>
Promise containing the updated OM record after buffering completes
Inherited from
Section titled “Inherited from”MastraClient.awaitBufferStatus
batchDeleteDatasetItems()
Section titled “batchDeleteDatasetItems()”batchDeleteDatasetItems(
params):Promise<{deletedCount:number;success:boolean; }>
Batch deletes items from a dataset
Parameters
Section titled “Parameters”params
Section titled “params”BatchDeleteDatasetItemsParams
Returns
Section titled “Returns”Promise<{ deletedCount: number; success: boolean; }>
Inherited from
Section titled “Inherited from”MastraClient.batchDeleteDatasetItems
batchInsertDatasetItems()
Section titled “batchInsertDatasetItems()”batchInsertDatasetItems(
params):Promise<{count:number;items:object[]; }>
Batch inserts items to a dataset
Parameters
Section titled “Parameters”params
Section titled “params”BatchInsertDatasetItemsParams
Returns
Section titled “Returns”Promise<{ count: number; items: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.batchInsertDatasetItems
chart()
Section titled “chart()”chart(
id,signal?):Promise<{chartId:string;error?:string;result?: {chartType:"custom"|"bar"|"horizontalBar"|"line"|"area"|"combo"|"waterfall"|"scatter"|"heatmap"|"radar"|"pie"|"funnel"|"treemap";option:Record<string,unknown>; }; } |undefined>
Resolve a [chart:<id>] marker from
GET ${basePath}/embed/chart/:id. The chart planner runs in the
background, so the server long-polls the cache and returns the
settled entry in one response. A 404 (unknown / expired id)
resolves to undefined so the slot renders nothing.
Parameters
Section titled “Parameters”string
signal?
Section titled “signal?”AbortSignal
Returns
Section titled “Returns”Promise<{ chartId: string; error?: string; result?: { chartType: "custom" | "bar" | "horizontalBar" | "line" | "area" | "combo" | "waterfall" | "scatter" | "heatmap" | "radar" | "pie" | "funnel" | "treemap"; option: Record<string, unknown>; }; } | undefined>
clearHistory()
Section titled “clearHistory()”clearHistory(
options):Promise<void>
Delete one native memory thread so the same id can start cleanly.
Parameters
Section titled “Parameters”options
Section titled “options”agentId?
Section titled “agentId?”string
signal?
Section titled “signal?”AbortSignal
threadId
Section titled “threadId”string
Returns
Section titled “Returns”Promise<void>
clusterFailures()
Section titled “clusterFailures()”clusterFailures(
params):Promise<{clusters:object[];proposedTags?:object[]; }>
Cluster experiment failures using AI to identify common failure patterns.
Parameters
Section titled “Parameters”params
Section titled “params”PostDatasetsClusterFailures_Body
Returns
Section titled “Returns”Promise<{ clusters: object[]; proposedTags?: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.clusterFailures
compareExperiments()
Section titled “compareExperiments()”compareExperiments(
params):Promise<{baselineId:string;items:object[]; }>
Compares two dataset experiments for regression detection
Parameters
Section titled “Parameters”params
Section titled “params”CompareExperimentsParams
Returns
Section titled “Returns”Promise<{ baselineId: string; items: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.compareExperiments
createDataset()
Section titled “createDataset()”createDataset(
params):Promise<{createdAt:string;description?:string|null;groundTruthSchema?: {[key:string]:unknown; };id:string;inputSchema?: {[key:string]:unknown; };metadata?: {[key:string]:unknown; } |null;name:string;requestContextSchema?: {[key:string]:unknown; };scorerIds?:string[] |null;tags?:string[] |null;targetIds?:string[] |null;targetType?:string|null;updatedAt:string;version:number; }>
Creates a new dataset
Parameters
Section titled “Parameters”params
Section titled “params”CreateDatasetParams
Returns
Section titled “Returns”Promise<{ createdAt: string; description?: string | null; groundTruthSchema?: {[key: string]: unknown; }; id: string; inputSchema?: {[key: string]: unknown; }; metadata?: {[key: string]: unknown; } | null; name: string; requestContextSchema?: {[key: string]: unknown; }; scorerIds?: string[] | null; tags?: string[] | null; targetIds?: string[] | null; targetType?: string | null; updatedAt: string; version: number; }>
Inherited from
Section titled “Inherited from”MastraClient.createDataset
createDatasetExperiment()
Section titled “createDatasetExperiment()”createDatasetExperiment(
params):Promise<{completedAt:string|null;datasetVersion?:number;experimentId:string;failedCount:number;results:object[];startedAt:string|null;status:"running"|"pending"|"completed"|"failed";succeededCount:number;totalItems:number; }>
Creates an experiment without starting the in-process runner, so the caller
drives the loop (e.g. a Temporal workflow). With a target, execute items
server-side via runExperimentItem; without one, ingest results via
submitExperimentResult. Idempotent when a caller-supplied id is provided.
Parameters
Section titled “Parameters”params
Section titled “params”CreateDatasetExperimentParams
Returns
Section titled “Returns”Promise<{ completedAt: string | null; datasetVersion?: number; experimentId: string; failedCount: number; results: object[]; startedAt: string | null; status: "running" | "pending" | "completed" | "failed"; succeededCount: number; totalItems: number; }>
Inherited from
Section titled “Inherited from”MastraClient.createDatasetExperiment
createFeedback()
Section titled “createFeedback()”createFeedback(
params):Promise<{success:boolean; }>
Creates a single feedback record in the observability store.
Parameters
Section titled “Parameters”params
Section titled “params”PostObservabilityFeedback_Body
Returns
Section titled “Returns”Promise<{ success: boolean; }>
Inherited from
Section titled “Inherited from”MastraClient.createFeedback
createMemoryThread()
Section titled “createMemoryThread()”createMemoryThread(
params):Promise<{createdAt:string;id:string;metadata?: {[key:string]:unknown; };resourceId:string;title?:string;updatedAt:string; }>
Creates a new memory thread
Parameters
Section titled “Parameters”params
Section titled “params”CreateMemoryThreadParams
Parameters for creating the memory thread including optional request context
Returns
Section titled “Returns”Promise<{ createdAt: string; id: string; metadata?: {[key: string]: unknown; }; resourceId: string; title?: string; updatedAt: string; }>
Promise containing the created memory thread
Inherited from
Section titled “Inherited from”MastraClient.createMemoryThread
createSchedule()
Section titled “createSchedule()”createSchedule(
options):Promise<ScheduleResponse>
Creates a schedule. Pass agentId (plus prompt) to schedule an agent,
or workflowId (plus optional inputData) to schedule a workflow.
By default each call creates a new schedule with a random id
(agent_<uuid> for agents, schedule_<uuid> for workflows) — pass id
to choose a stable id instead; creating one with an id that already
exists throws.
Trigger (fire) history is read through listScheduleTriggers(schedule.id).
Parameters
Section titled “Parameters”options
Section titled “options”CreateScheduleInput
Returns
Section titled “Returns”Promise<ScheduleResponse>
Inherited from
Section titled “Inherited from”MastraClient.createSchedule
createScore()
Section titled “createScore()”createScore(
params):Promise<{success:boolean; }>
Creates a single score record in the observability store.
Parameters
Section titled “Parameters”params
Section titled “params”PostObservabilityScores_Body
Returns
Section titled “Returns”Promise<{ success: boolean; }>
Inherited from
Section titled “Inherited from”MastraClient.createScore
createStoredAgent()
Section titled “createStoredAgent()”createStoredAgent(
params):Promise<{activeVersionId?:string;agents?:object[] | {[key:string]:object; };author?: {avatarUrl?:string;email?:string;id:string;name?:string; };authorId?:string;browser?:boolean| {config: {headless?:boolean;provider:string;screencast?: {everyNthFrame?:number;format?:"jpeg"|"png";maxHeight?:number;maxWidth?:number;quality?:number; };timeout?:number;viewport?: {height:number;width:number; }; };type:"inline"; } |object[] |null;createdAt:string;defaultOptions?: {[key:string]:unknown;activeTools?:string[];autoResumeSuspendedTools?:boolean;eagerToolExecution?:boolean;includeRawChunks?:boolean;maxProcessorRetries?:number;maxSteps?:number;modelSettings?: {frequencyPenalty?:number;maxRetries?:number;maxTokens?:number;presencePenalty?:number;seed?:number;stopSequences?:string[];temperature?:number;topK?:number;topP?:number; };requireToolApproval?:boolean;returnScorerData?:boolean;runId?:string;savePerStep?:boolean;toolCallConcurrency?:number| {limit?:number;strategy?:"available"|"called"; };toolChoice?:"none"|"auto"|"required"| {toolName:string;type:"tool"; };tracingOptions?: {attributes?: {[key:string]:unknown; };spanId?:string;traceId?:string;traceName?:string; }; } |object[];description?:string;durable?:boolean| {cleanupTimeoutMs?:number;maxSteps?:number; };favoriteCount?:number;id:string;inputProcessors?: {steps: ({step: {config: {[key:string]:unknown; };enabledPhases: ("processInput"|"processInputStep"|"processOutputStream"|"processOutputResult"|"processOutputStep"|"processToolResult")[];id:string;providerId:string; };type:"step"; } | {branches: ({step: …;type: …; } | {branches: …;type: …; } | {conditions: …;type: …; })[][];type:"parallel"; } | {conditions:object[];type:"conditional"; })[]; } |object[];instructions:string| ({content:string;type:"text"; } | {id:string;type:"prompt_block_ref"; } | {content:string;rules?: {conditions: ({field: …;operator: …;value?: …; } | {conditions: …;operator: …; })[];operator:"AND"|"OR"; };type:"prompt_block"; })[];integrationTools?: {[key:string]:object; } |object[];isFavorited?:boolean;mcpClients?: {[key:string]:object; } |object[];memory?: {embedder?:string;embedderOptions?: {[key:string]:unknown; };observationalMemory?:boolean| {model?:string;observation?: {blockAfter?:number;bufferActivation?:number;bufferTokens?:number|false;maxTokensPerBatch?:number;messageTokens?:number;model?:string;modelSettings?: {[key:string]:unknown; };providerOptions?: {[key:string]: … | …; }; };reflection?: {blockAfter?:number;bufferActivation?:number;model?:string;modelSettings?: {[key:string]:unknown; };observationTokens?:number;providerOptions?: {[key:string]: … | …; }; };scope?:"thread"|"resource";shareTokenBudget?:boolean; };options?: {generateTitle?:boolean| {emitEvent?:boolean;instructions?:string;minMessages?:number;model?:string; };lastMessages?:number|false;messageHistory?: {atMaxRemoveTokens?:number;maxTokens:number; };readOnly?:boolean;semanticRecall?:boolean| {indexName?:string;messageRange:number| {after:number;before:number; };scope?:"thread"|"resource";threshold?:number;topK:number; }; };vector?:string|false; } |object[];metadata?: {[key:string]:unknown; };model: {[key:string]:unknown;name:string;provider:string; } |object[];name:string;outputProcessors?: {steps: ({step: {config: {[key:string]:unknown; };enabledPhases: ("processInput"|"processInputStep"|"processOutputStream"|"processOutputResult"|"processOutputStep"|"processToolResult")[];id:string;providerId:string; };type:"step"; } | {branches: ({step: …;type: …; } | {branches: …;type: …; } | {conditions: …;type: …; })[][];type:"parallel"; } | {conditions:object[];type:"conditional"; })[]; } |object[];requestContextSchema?: {[key:string]:unknown; };scorers?: {[key:string]:object; } |object[];skills?: {[key:string]:object; } |object[];status:string;toolProviders?: {[key:string]:object; } |object[];tools?: {[key:string]:object; } |object[];updatedAt:string;visibility?:"public"|"private";workflows?:object[] | {[key:string]:object; };workspace?: {type:"id";workspaceId:string; } | {config: {autoSync?:boolean;description?:string;filesystem?: {config: {[key:string]:unknown; };provider:string; };mounts?: {[key:string]:object; };name:string;operationTimeout?:number;sandbox?: {config: {[key:string]:unknown; };provider:string; };search?: {autoIndexPaths?:string[];bm25?:boolean| {b?:number;k1?:number; };embedderConfig?: {[key:string]:unknown; };embedderModel?:string;embedderProvider?:string;searchIndexName?:string;vectorConfig?: {[key:string]:unknown; };vectorProvider?:string; };skills?:string[];tools?: {enabled?:boolean;requireApproval?:boolean;tools?: {[key:string]:object; }; }; };type:"inline"; } | {config: {[key:string]:unknown; };provider:string;type:"provider"; } |object[]; }>
Creates a new stored agent
Parameters
Section titled “Parameters”params
Section titled “params”Agent configuration including id, name, instructions, model, etc.
agents?
Section titled “agents?”{[key: string]: object; } | object[]
Agent keys with optional per-agent config — static or conditional
authorId?
Section titled “authorId?”string
Author identifier for multi-tenant filtering
autoPublish?
Section titled “autoPublish?”boolean
Publish the initial version so the agent resolves at status=“published”. Defaults to true when omitted. Pass false to stage the agent as an unpublished draft — useful when overriding a code-defined agent, whose code definition keeps serving traffic until the override is published.
browser?
Section titled “browser?”boolean | { config: { headless?: boolean; provider: string; screencast?: { everyNthFrame?: number; format?: "jpeg" | "png"; maxHeight?: number; maxWidth?: number; quality?: number; }; timeout?: number; viewport?: { height: number; width: number; }; }; type: "inline"; } | object[] | null
Browser configuration — object config, true (apply default), false/null (disable)
defaultOptions?
Section titled “defaultOptions?”{[key: string]: unknown; activeTools?: string[]; autoResumeSuspendedTools?: boolean; eagerToolExecution?: boolean; includeRawChunks?: boolean; maxProcessorRetries?: number; maxSteps?: number; modelSettings?: { frequencyPenalty?: number; maxRetries?: number; maxTokens?: number; presencePenalty?: number; seed?: number; stopSequences?: string[]; temperature?: number; topK?: number; topP?: number; }; requireToolApproval?: boolean; returnScorerData?: boolean; runId?: string; savePerStep?: boolean; toolCallConcurrency?: number | { limit?: number; strategy?: "available" | "called"; }; toolChoice?: "none" | "auto" | "required" | { toolName: string; type: "tool"; }; tracingOptions?: { attributes?: {[key: string]: unknown; }; spanId?: string; traceId?: string; traceName?: string; }; } | object[]
Default options for generate/stream calls — static or conditional
description?
Section titled “description?”string
Description of the agent
durable?
Section titled “durable?”boolean | { cleanupTimeoutMs?: number; maxSteps?: number; }
Opt this agent into durable execution when it is hydrated. Cache and pubsub are inherited from the Mastra instance; without distributed backends durability is process-local. Does not enable automatic recovery — that stays recovery.durableAgents.
string
Unique identifier for the agent. If not provided, derived from name.
inputProcessors?
Section titled “inputProcessors?”{ steps: ({ step: { config: {[key: string]: unknown; }; enabledPhases: ("processInput" | "processInputStep" | "processOutputStream" | "processOutputResult" | "processOutputStep" | "processToolResult")[]; id: string; providerId: string; }; type: "step"; } | { branches: ({ step: { config: …; enabledPhases: …; id: …; providerId: …; }; type: "step"; } | { branches: …[]; type: "parallel"; } | { conditions: …[]; type: "conditional"; })[][]; type: "parallel"; } | { conditions: object[]; type: "conditional"; })[]; } | object[]
Input processor graph — static or conditional
instructions
Section titled “instructions”string | ({ content: string; type: "text"; } | { id: string; type: "prompt_block_ref"; } | { content: string; rules?: { conditions: ({ field: string; operator: InputShared_Type_31; value?: unknown; } | { conditions: …[]; operator: … | …; })[]; operator: "AND" | "OR"; }; type: "prompt_block"; })[]
System instructions for the agent (string or array of instruction blocks)
integrationTools?
Section titled “integrationTools?”{[key: string]: object; } | object[]
Map of tool provider IDs to their tool configurations — static or conditional
mcpClients?
Section titled “mcpClients?”object[] | {[key: string]: object; }
Map of stored MCP client IDs to their tool configurations — static or conditional
memory?
Section titled “memory?”{ embedder?: string; embedderOptions?: {[key: string]: unknown; }; observationalMemory?: boolean | { model?: string; observation?: { blockAfter?: number; bufferActivation?: number; bufferTokens?: number | false; maxTokensPerBatch?: number; messageTokens?: number; model?: string; modelSettings?: {[key: string]: unknown; }; providerOptions?: {[key: string]: {[key: …]: …; } | undefined; }; }; reflection?: { blockAfter?: number; bufferActivation?: number; model?: string; modelSettings?: {[key: string]: unknown; }; observationTokens?: number; providerOptions?: {[key: string]: {[key: …]: …; } | undefined; }; }; scope?: "thread" | "resource"; shareTokenBudget?: boolean; }; options?: { generateTitle?: boolean | { emitEvent?: boolean; instructions?: string; minMessages?: number; model?: string; }; lastMessages?: number | false; messageHistory?: { atMaxRemoveTokens?: number; maxTokens: number; }; readOnly?: boolean; semanticRecall?: boolean | { indexName?: string; messageRange: number | { after: number; before: number; }; scope?: "thread" | "resource"; threshold?: number; topK: number; }; }; vector?: string | false; } | object[]
Memory configuration — static or conditional
metadata?
Section titled “metadata?”{[key: string]: unknown; }
Additional metadata for the agent
model?
Section titled “model?”{[key: string]: unknown; name: string; provider: string; } | object[]
Model configuration — static value or array of conditional variants. When omitted, the builder default model is applied server-side.
string
Name of the agent
outputProcessors?
Section titled “outputProcessors?”{ steps: ({ step: { config: {[key: string]: unknown; }; enabledPhases: ("processInput" | "processInputStep" | "processOutputStream" | "processOutputResult" | "processOutputStep" | "processToolResult")[]; id: string; providerId: string; }; type: "step"; } | { branches: ({ step: { config: …; enabledPhases: …; id: …; providerId: …; }; type: "step"; } | { branches: …[]; type: "parallel"; } | { conditions: …[]; type: "conditional"; })[][]; type: "parallel"; } | { conditions: object[]; type: "conditional"; })[]; } | object[]
Output processor graph — static or conditional
requestContextSchema?
Section titled “requestContextSchema?”{[key: string]: unknown; }
JSON Schema defining valid request context variables for conditional rule evaluation
scorers?
Section titled “scorers?”{[key: string]: object; } | object[]
Scorer keys with optional sampling config — static or conditional
skills?
Section titled “skills?”{[key: string]: object; } | object[]
Skill IDs mapped to per-skill config — static or conditional
toolProviders?
Section titled “toolProviders?”{[key: string]: object; } | object[]
Tool provider connections and per-tool config (provider-agnostic). Coexists with the deprecated integrationTools field.
tools?
Section titled “tools?”{[key: string]: object; } | object[]
Tool keys mapped to per-tool config — static or conditional
visibility?
Section titled “visibility?”"public" | "private"
Agent visibility: private (owner/admin only) or public (any reader)
workflows?
Section titled “workflows?”{[key: string]: object; } | object[]
Workflow keys with optional per-workflow config — static or conditional
workspace?
Section titled “workspace?”{ type: "id"; workspaceId: string; } | { config: { autoSync?: boolean; description?: string; filesystem?: { config: {[key: string]: unknown; }; provider: string; }; mounts?: {[key: string]: object; }; name: string; operationTimeout?: number; sandbox?: { config: {[key: string]: unknown; }; provider: string; }; search?: { autoIndexPaths?: string[]; bm25?: boolean | { b?: number; k1?: number; }; embedderConfig?: {[key: string]: unknown; }; embedderModel?: string; embedderProvider?: string; searchIndexName?: string; vectorConfig?: {[key: string]: unknown; }; vectorProvider?: string; }; skills?: string[]; tools?: { enabled?: boolean; requireApproval?: boolean; tools?: {[key: string]: object; }; }; }; type: "inline"; } | { config: {[key: string]: unknown; }; provider: string; type: "provider"; } | object[]
Workspace reference (stored ID or inline config) — static or conditional
Returns
Section titled “Returns”Promise<{ activeVersionId?: string; agents?: object[] | {[key: string]: object; }; author?: { avatarUrl?: string; email?: string; id: string; name?: string; }; authorId?: string; browser?: boolean | { config: { headless?: boolean; provider: string; screencast?: { everyNthFrame?: number; format?: "jpeg" | "png"; maxHeight?: number; maxWidth?: number; quality?: number; }; timeout?: number; viewport?: { height: number; width: number; }; }; type: "inline"; } | object[] | null; createdAt: string; defaultOptions?: {[key: string]: unknown; activeTools?: string[]; autoResumeSuspendedTools?: boolean; eagerToolExecution?: boolean; includeRawChunks?: boolean; maxProcessorRetries?: number; maxSteps?: number; modelSettings?: { frequencyPenalty?: number; maxRetries?: number; maxTokens?: number; presencePenalty?: number; seed?: number; stopSequences?: string[]; temperature?: number; topK?: number; topP?: number; }; requireToolApproval?: boolean; returnScorerData?: boolean; runId?: string; savePerStep?: boolean; toolCallConcurrency?: number | { limit?: number; strategy?: "available" | "called"; }; toolChoice?: "none" | "auto" | "required" | { toolName: string; type: "tool"; }; tracingOptions?: { attributes?: {[key: string]: unknown; }; spanId?: string; traceId?: string; traceName?: string; }; } | object[]; description?: string; durable?: boolean | { cleanupTimeoutMs?: number; maxSteps?: number; }; favoriteCount?: number; id: string; inputProcessors?: { steps: ({ step: { config: {[key: string]: unknown; }; enabledPhases: ("processInput" | "processInputStep" | "processOutputStream" | "processOutputResult" | "processOutputStep" | "processToolResult")[]; id: string; providerId: string; }; type: "step"; } | { branches: ({ step: …; type: …; } | { branches: …; type: …; } | { conditions: …; type: …; })[][]; type: "parallel"; } | { conditions: object[]; type: "conditional"; })[]; } | object[]; instructions: string | ({ content: string; type: "text"; } | { id: string; type: "prompt_block_ref"; } | { content: string; rules?: { conditions: ({ field: …; operator: …; value?: …; } | { conditions: …; operator: …; })[]; operator: "AND" | "OR"; }; type: "prompt_block"; })[]; integrationTools?: {[key: string]: object; } | object[]; isFavorited?: boolean; mcpClients?: {[key: string]: object; } | object[]; memory?: { embedder?: string; embedderOptions?: {[key: string]: unknown; }; observationalMemory?: boolean | { model?: string; observation?: { blockAfter?: number; bufferActivation?: number; bufferTokens?: number | false; maxTokensPerBatch?: number; messageTokens?: number; model?: string; modelSettings?: {[key: string]: unknown; }; providerOptions?: {[key: string]: … | …; }; }; reflection?: { blockAfter?: number; bufferActivation?: number; model?: string; modelSettings?: {[key: string]: unknown; }; observationTokens?: number; providerOptions?: {[key: string]: … | …; }; }; scope?: "thread" | "resource"; shareTokenBudget?: boolean; }; options?: { generateTitle?: boolean | { emitEvent?: boolean; instructions?: string; minMessages?: number; model?: string; }; lastMessages?: number | false; messageHistory?: { atMaxRemoveTokens?: number; maxTokens: number; }; readOnly?: boolean; semanticRecall?: boolean | { indexName?: string; messageRange: number | { after: number; before: number; }; scope?: "thread" | "resource"; threshold?: number; topK: number; }; }; vector?: string | false; } | object[]; metadata?: {[key: string]: unknown; }; model: {[key: string]: unknown; name: string; provider: string; } | object[]; name: string; outputProcessors?: { steps: ({ step: { config: {[key: string]: unknown; }; enabledPhases: ("processInput" | "processInputStep" | "processOutputStream" | "processOutputResult" | "processOutputStep" | "processToolResult")[]; id: string; providerId: string; }; type: "step"; } | { branches: ({ step: …; type: …; } | { branches: …; type: …; } | { conditions: …; type: …; })[][]; type: "parallel"; } | { conditions: object[]; type: "conditional"; })[]; } | object[]; requestContextSchema?: {[key: string]: unknown; }; scorers?: {[key: string]: object; } | object[]; skills?: {[key: string]: object; } | object[]; status: string; toolProviders?: {[key: string]: object; } | object[]; tools?: {[key: string]: object; } | object[]; updatedAt: string; visibility?: "public" | "private"; workflows?: object[] | {[key: string]: object; }; workspace?: { type: "id"; workspaceId: string; } | { config: { autoSync?: boolean; description?: string; filesystem?: { config: {[key: string]: unknown; }; provider: string; }; mounts?: {[key: string]: object; }; name: string; operationTimeout?: number; sandbox?: { config: {[key: string]: unknown; }; provider: string; }; search?: { autoIndexPaths?: string[]; bm25?: boolean | { b?: number; k1?: number; }; embedderConfig?: {[key: string]: unknown; }; embedderModel?: string; embedderProvider?: string; searchIndexName?: string; vectorConfig?: {[key: string]: unknown; }; vectorProvider?: string; }; skills?: string[]; tools?: { enabled?: boolean; requireApproval?: boolean; tools?: {[key: string]: object; }; }; }; type: "inline"; } | { config: {[key: string]: unknown; }; provider: string; type: "provider"; } | object[]; }>
Promise containing the created stored agent
Inherited from
Section titled “Inherited from”MastraClient.createStoredAgent
createStoredMCPClient()
Section titled “createStoredMCPClient()”createStoredMCPClient(
params):Promise<{activeVersionId?:string;authorId?:string;createdAt:string;description?:string;id:string;metadata?: {[key:string]:unknown; };name:string;servers: {[key:string]:object; };status:string;updatedAt:string; }>
Creates a new stored MCP client
Parameters
Section titled “Parameters”params
Section titled “params”MCP client configuration
authorId?
Section titled “authorId?”string
Author identifier for multi-tenant filtering
description?
Section titled “description?”string
Description of the MCP client
string
Unique identifier. If not provided, derived from name.
metadata?
Section titled “metadata?”{[key: string]: unknown; }
Additional metadata for the MCP client
string
Name of the MCP client
servers
Section titled “servers”{[key: string]: object; }
Map of server name to server configuration
Returns
Section titled “Returns”Promise<{ activeVersionId?: string; authorId?: string; createdAt: string; description?: string; id: string; metadata?: {[key: string]: unknown; }; name: string; servers: {[key: string]: object; }; status: string; updatedAt: string; }>
Promise containing the created stored MCP client
Inherited from
Section titled “Inherited from”MastraClient.createStoredMCPClient
createStoredPromptBlock()
Section titled “createStoredPromptBlock()”createStoredPromptBlock(
params):Promise<{activeVersionId?:string;authorId?:string;content:string;createdAt:string;description?:string;hasDraft?:boolean;id:string;metadata?: {[key:string]:unknown; };name:string;requestContextSchema?: {[key:string]:unknown; };rules?: {conditions: ({field:string;operator:Shared_Type_8;value?:unknown; } | {conditions: ({field:string;operator:Shared_Type_8;value?:unknown; } | {conditions: …[];operator: … | …; })[];operator:"AND"|"OR"; })[];operator:"AND"|"OR"; };status:string;updatedAt:string; }>
Creates a new stored prompt block
Parameters
Section titled “Parameters”params
Section titled “params”Prompt block configuration including name, content, rules, etc.
authorId?
Section titled “authorId?”string
Author identifier for multi-tenant filtering
content
Section titled “content”string
Template content with {{variable}} interpolation
description?
Section titled “description?”string
Purpose description
string
Unique identifier. If not provided, derived from name.
metadata?
Section titled “metadata?”{[key: string]: unknown; }
Additional metadata for the prompt block
string
Display name of the prompt block
requestContextSchema?
Section titled “requestContextSchema?”{[key: string]: unknown; }
JSON Schema defining available variables for {{variableName}} interpolation and conditions
rules?
Section titled “rules?”{ conditions: ({ field: string; operator: InputShared_Type_31; value?: unknown; } | { conditions: ({ field: string; operator: InputShared_Type_31; value?: unknown; } | { conditions: object[]; operator: "AND" | "OR"; })[]; operator: "AND" | "OR"; })[]; operator: "AND" | "OR"; }
Rules for conditional inclusion
rules.conditions
Section titled “rules.conditions”({ field: string; operator: InputShared_Type_31; value?: unknown; } | { conditions: ({ field: string; operator: InputShared_Type_31; value?: unknown; } | { conditions: object[]; operator: "AND" | "OR"; })[]; operator: "AND" | "OR"; })[]
rules.operator
Section titled “rules.operator”"AND" | "OR"
Returns
Section titled “Returns”Promise<{ activeVersionId?: string; authorId?: string; content: string; createdAt: string; description?: string; hasDraft?: boolean; id: string; metadata?: {[key: string]: unknown; }; name: string; requestContextSchema?: {[key: string]: unknown; }; rules?: { conditions: ({ field: string; operator: Shared_Type_8; value?: unknown; } | { conditions: ({ field: string; operator: Shared_Type_8; value?: unknown; } | { conditions: …[]; operator: … | …; })[]; operator: "AND" | "OR"; })[]; operator: "AND" | "OR"; }; status: string; updatedAt: string; }>
Promise containing the created stored prompt block
Inherited from
Section titled “Inherited from”MastraClient.createStoredPromptBlock
createStoredScorer()
Section titled “createStoredScorer()”createStoredScorer(
params):Promise<{activeVersionId?:string;authorId?:string;createdAt:string;defaultSampling?: {type:"none"; } | {rate:number;type:"ratio"; };description?:string;id:string;instructions?:string;metadata?: {[key:string]:unknown; };model?: {[key:string]:unknown;name:string;provider:string; };name:string;presetConfig?: {[key:string]:unknown; };scoreRange?: {max?:number;min?:number; };status:string;type:Shared_Type_76;updatedAt:string; }>
Creates a new stored scorer definition
Parameters
Section titled “Parameters”params
Section titled “params”Scorer definition configuration
authorId?
Section titled “authorId?”string
Author identifier for multi-tenant filtering
defaultSampling?
Section titled “defaultSampling?”{ type: "none"; } | { rate: number; type: "ratio"; }
Default sampling configuration
description?
Section titled “description?”string
Description of the scorer
string
Unique identifier. If not provided, derived from name.
instructions?
Section titled “instructions?”string
System instructions for the judge LLM (used when type is llm-judge)
metadata?
Section titled “metadata?”{[key: string]: unknown; }
Additional metadata for the scorer
model?
Section titled “model?”{[key: string]: unknown; name: string; provider: string; }
Model configuration for LLM judge
model.name
Section titled “model.name”string
Model name (e.g., gpt-4o, claude-3-opus)
model.provider
Section titled “model.provider”string
Model provider (e.g., openai, anthropic)
string
Name of the scorer
presetConfig?
Section titled “presetConfig?”{[key: string]: unknown; }
Serializable config options for preset scorers
scoreRange?
Section titled “scoreRange?”{ max?: number; min?: number; }
Score range configuration (used when type is llm-judge)
scoreRange.max?
Section titled “scoreRange.max?”number
Maximum score value (default: 1)
scoreRange.min?
Section titled “scoreRange.min?”number
Minimum score value (default: 0)
InputShared_Type_90
Scorer type: llm-judge for custom, or a preset type name
Returns
Section titled “Returns”Promise<{ activeVersionId?: string; authorId?: string; createdAt: string; defaultSampling?: { type: "none"; } | { rate: number; type: "ratio"; }; description?: string; id: string; instructions?: string; metadata?: {[key: string]: unknown; }; model?: {[key: string]: unknown; name: string; provider: string; }; name: string; presetConfig?: {[key: string]: unknown; }; scoreRange?: { max?: number; min?: number; }; status: string; type: Shared_Type_76; updatedAt: string; }>
Promise containing the created stored scorer definition
Inherited from
Section titled “Inherited from”MastraClient.createStoredScorer
createStoredSkill()
Section titled “createStoredSkill()”createStoredSkill(
params):Promise<{activeVersionId?:string;assets?:string[];authorId?:string;compatibility?:unknown;createdAt:string;description:string;favoriteCount?:number;files?:object[];id:string;instructions:string;isFavorited?:boolean;license?:string;metadata?: {[key:string]:unknown; };name:string;references?:string[];scripts?:string[];source?: {packagePath:string;type:"external"; } | {projectPath:string;type:"local"; } | {mastraPath:string;type:"managed"; };status:string;updatedAt:string;visibility?:"public"|"private"; }>
Creates a new stored skill
Parameters
Section titled “Parameters”params
Section titled “params”Skill configuration
assets?
Section titled “assets?”string[]
List of asset file paths
authorId?
Section titled “authorId?”string
Author identifier for multi-tenant filtering
compatibility?
Section titled “compatibility?”unknown
Compatibility requirements
description
Section titled “description”string
Description of what the skill does and when to use it
files?
Section titled “files?”object[]
Full file tree structure for the skill
string
Unique identifier. If not provided, derived from name.
instructions
Section titled “instructions”string
Markdown instructions for the skill
license?
Section titled “license?”string
License identifier for the skill
metadata?
Section titled “metadata?”{[key: string]: unknown; }
Additional metadata for the skill
string
Name of the skill
references?
Section titled “references?”string[]
List of reference file paths
scripts?
Section titled “scripts?”string[]
List of script file paths
source?
Section titled “source?”{ packagePath: string; type: "external"; } | { projectPath: string; type: "local"; } | { mastraPath: string; type: "managed"; }
Source location of the skill
visibility?
Section titled “visibility?”"public" | "private"
Skill visibility: private (owner/admin only) or public (any reader)
Returns
Section titled “Returns”Promise<{ activeVersionId?: string; assets?: string[]; authorId?: string; compatibility?: unknown; createdAt: string; description: string; favoriteCount?: number; files?: object[]; id: string; instructions: string; isFavorited?: boolean; license?: string; metadata?: {[key: string]: unknown; }; name: string; references?: string[]; scripts?: string[]; source?: { packagePath: string; type: "external"; } | { projectPath: string; type: "local"; } | { mastraPath: string; type: "managed"; }; status: string; updatedAt: string; visibility?: "public" | "private"; }>
Promise containing the created stored skill
Inherited from
Section titled “Inherited from”MastraClient.createStoredSkill
declineToolCallStream()
Section titled “declineToolCallStream()”declineToolCallStream(
agentId,params):Promise<MastraStreamResponse>
Deny a suspended tool through the same native resume contract.
Parameters
Section titled “Parameters”agentId
Section titled “agentId”string
params
Section titled “params”reason?
Section titled “reason?”string
requestContext?
Section titled “requestContext?”string
signal?
Section titled “signal?”AbortSignal
threadId?
Section titled “threadId?”string
toolCallId
Section titled “toolCallId”string
Returns
Section titled “Returns”Promise<MastraStreamResponse>
defaultModel()
Section titled “defaultModel()”defaultModel(
agentId?,signal?):Promise<string|null>
Fetch the humanized name of the static default model agentId falls back
to when no model is pinned, from GET ${basePath}/default-model. Returns
the server-humanized displayName (never a raw endpoint id), or null
when the agent resolves its model dynamically at call time (or the agent
id is unknown) - there’s nothing static to advertise. The picker uses this
to label its default option on load, before the /models catalogue
arrives. Defaults to the server’s default agent when agentId is omitted.
Parameters
Section titled “Parameters”agentId?
Section titled “agentId?”string
signal?
Section titled “signal?”AbortSignal
Returns
Section titled “Returns”Promise<string | null>
defaultModelDetails()
Section titled “defaultModelDetails()”defaultModelDetails(
agentId?,signal?):Promise<{agentId:string;displayName:string|null;model:string|null; }>
Fetch the complete resolved default-model descriptor for an agent.
Parameters
Section titled “Parameters”agentId?
Section titled “agentId?”string
signal?
Section titled “signal?”AbortSignal
Returns
Section titled “Returns”Promise<{ agentId: string; displayName: string | null; model: string | null; }>
deleteDataset()
Section titled “deleteDataset()”deleteDataset(
datasetId,tenancy?):Promise<{success:boolean; }>
Deletes a dataset. When tenancy fields are supplied, the server only deletes the dataset if it belongs to the given tenant (silent no-op otherwise).
Parameters
Section titled “Parameters”datasetId
Section titled “datasetId”string
tenancy?
Section titled “tenancy?”GetDatasetsDatasetId_QueryParams
Returns
Section titled “Returns”Promise<{ success: boolean; }>
Inherited from
Section titled “Inherited from”MastraClient.deleteDataset
deleteDatasetExperiment()
Section titled “deleteDatasetExperiment()”deleteDatasetExperiment(
datasetId,experimentId,tenancy?):Promise<{success:boolean; }>
Deletes a dataset experiment and its results. Tenancy fields, when provided, scope the dataset lookup on the server side.
The server also attempts to delete the experiment’s observability traces, cascading to their spans and trace-linked signals. Stores without observability or trace deletion support leave the traces in place.
Parameters
Section titled “Parameters”datasetId
Section titled “datasetId”string
experimentId
Section titled “experimentId”string
tenancy?
Section titled “tenancy?”GetDatasetsDatasetId_QueryParams
Returns
Section titled “Returns”Promise<{ success: boolean; }>
Inherited from
Section titled “Inherited from”MastraClient.deleteDatasetExperiment
deleteDatasetItem()
Section titled “deleteDatasetItem()”deleteDatasetItem(
datasetId,itemId):Promise<{success:boolean; }>
Deletes a dataset item
Parameters
Section titled “Parameters”datasetId
Section titled “datasetId”string
itemId
Section titled “itemId”string
Returns
Section titled “Returns”Promise<{ success: boolean; }>
Inherited from
Section titled “Inherited from”MastraClient.deleteDatasetItem
deleteExperiment()
Section titled “deleteExperiment()”deleteExperiment(
experimentId,options?):Promise<{success:boolean; }>
Deletes an experiment and its results regardless of dataset association (including experiments orphaned by dataset deletion). When tenancy fields are supplied, the server only deletes the experiment if it belongs to the given tenant (silent no-op otherwise).
The server also attempts to delete the experiment’s observability traces, cascading to their spans and trace-linked signals. Stores without observability or trace deletion support leave the traces in place.
Parameters
Section titled “Parameters”experimentId
Section titled “experimentId”string
options?
Section titled “options?”GetDatasetsDatasetId_QueryParams
Returns
Section titled “Returns”Promise<{ success: boolean; }>
Inherited from
Section titled “Inherited from”MastraClient.deleteExperiment
deleteFeedback()
Section titled “deleteFeedback()”deleteFeedback(
params):Promise<{success:boolean; }>
Deletes feedback records by feedbackId, optionally scoped to a tenant.
Parameters
Section titled “Parameters”params
Section titled “params”DeleteObservabilityFeedback_Body
Returns
Section titled “Returns”Promise<{ success: boolean; }>
Inherited from
Section titled “Inherited from”MastraClient.deleteFeedback
deleteMessages()
Section titled “deleteMessages()”deleteMessages(
threadId,messageIds,options?):Promise<void>
Delete selected persisted messages before regenerating a turn.
Parameters
Section titled “Parameters”threadId
Section titled “threadId”string
messageIds
Section titled “messageIds”string[]
options?
Section titled “options?”agentId?
Section titled “agentId?”string
signal?
Section titled “signal?”AbortSignal
Returns
Section titled “Returns”Promise<void>
deleteSchedule()
Section titled “deleteSchedule()”deleteSchedule(
scheduleId):Promise<PostAgentsAgentIdModel_Response>
Deletes a schedule.
Parameters
Section titled “Parameters”scheduleId
Section titled “scheduleId”string
Returns
Section titled “Returns”Promise<PostAgentsAgentIdModel_Response>
Inherited from
Section titled “Inherited from”MastraClient.deleteSchedule
deleteScores()
Section titled “deleteScores()”deleteScores(
params):Promise<{success:boolean; }>
Deletes score records by scoreId, optionally scoped to a tenant.
Parameters
Section titled “Parameters”params
Section titled “params”DeleteObservabilityScores_Body
Returns
Section titled “Returns”Promise<{ success: boolean; }>
Inherited from
Section titled “Inherited from”MastraClient.deleteScores
deleteThread()
Section titled “deleteThread()”deleteThread(
threadId,opts):Promise<DeleteMemoryThreadsThreadId_Response>
Parameters
Section titled “Parameters”threadId
Section titled “threadId”string
{ agentId: string; networkId?: undefined; requestContext?: RequestContext<unknown> | Record<string, any>; } | { agentId?: undefined; networkId: string; requestContext?: RequestContext<unknown> | Record<string, any>; }
Returns
Section titled “Returns”Promise<DeleteMemoryThreadsThreadId_Response>
Inherited from
Section titled “Inherited from”MastraClient.deleteThread
deleteTraces()
Section titled “deleteTraces()”deleteTraces(
params):Promise<{success:true; }>
Deletes traces by ID, cascading to all associated spans and trace-linked signal events (scores, feedback, metrics, logs). Signals without a trace ID are untouched. On ClickHouse-backed stores, reads may briefly return deleted rows until the delete is fully applied.
Parameters
Section titled “Parameters”params
Section titled “params”PostObservabilityTracesDelete_Body
Returns
Section titled “Returns”Promise<{ success: true; }>
Inherited from
Section titled “Inherited from”MastraClient.deleteTraces
feedback()
Section titled “feedback()”feedback(
input):Promise<{assessmentId?:string;ok:boolean; }>
Log user feedback for a turn to POST ${basePath}/route/feedback.
traceId is the tr-<hex> value the server sent on the stream
response (via MLFLOW_TRACE_ID_HEADER) for that assistant message;
value carries a thumbs (boolean) / rating, and/or comment
carries freeform text. The server logs it as a HUMAN assessment on
the trace, attributed to the signed-in user.
Resolves with { ok: false } (not a throw) when the assessment
couldn’t be recorded yet - most often because the trace is still
exporting to MLflow - so callers can prompt a retry. Throws only on
a transport / HTTP-level failure.
Parameters
Section titled “Parameters”comment?
Section titled “comment?”string = ...
string = ...
traceId
Section titled “traceId”string = ...
value?
Section titled “value?”string | number | boolean = ...
Returns
Section titled “Returns”Promise<{ assessmentId?: string; ok: boolean; }>
finalizeExperiment()
Section titled “finalizeExperiment()”finalizeExperiment(
params):Promise<{agentVersion?:string|null;comparisonId?:string|null;completedAt:string|null;createdAt:string;datasetId:string|null;datasetVersion:number|null;description?:string;experimentSetId?:string|null;failedCount:number;id:string;metadata?: {[key:string]:unknown; };name?:string;provenance?: {metadata?: {[key:string]:unknown; };source?:string;sourceId?:string;sourceVersion?:string; } |null;runnerAttestation?: {invocationId:string;runnerId:string;runnerVersion?:string; } |null;scorerIds?:string[] |null;skippedCount:number;startedAt:string|null;status:"running"|"pending"|"completed"|"failed";succeededCount:number;targetId:string|null;targetType:"agent"|"workflow"|"scorer"|"processor"|null;totalItems:number;trialIndex?:number|null;updatedAt:string;variantId?:string|null; }>
Finalizes an external experiment. The server computes counts from persisted results. Idempotent.
Parameters
Section titled “Parameters”params
Section titled “params”PostDatasetsDatasetIdExperimentsExperimentIdResults_PathParams
Returns
Section titled “Returns”Promise<{ agentVersion?: string | null; comparisonId?: string | null; completedAt: string | null; createdAt: string; datasetId: string | null; datasetVersion: number | null; description?: string; experimentSetId?: string | null; failedCount: number; id: string; metadata?: {[key: string]: unknown; }; name?: string; provenance?: { metadata?: {[key: string]: unknown; }; source?: string; sourceId?: string; sourceVersion?: string; } | null; runnerAttestation?: { invocationId: string; runnerId: string; runnerVersion?: string; } | null; scorerIds?: string[] | null; skippedCount: number; startedAt: string | null; status: "running" | "pending" | "completed" | "failed"; succeededCount: number; targetId: string | null; targetType: "agent" | "workflow" | "scorer" | "processor" | null; totalItems: number; trialIndex?: number | null; updatedAt: string; variantId?: string | null; }>
Inherited from
Section titled “Inherited from”MastraClient.finalizeExperiment
generateDatasetItems()
Section titled “generateDatasetItems()”generateDatasetItems(
params):Promise<{items:object[]; }>
Generates synthetic dataset items using AI. Items are returned for review, not auto-saved.
Parameters
Section titled “Parameters”params
Section titled “params”GenerateDatasetItemsParams
Returns
Section titled “Returns”Promise<{ items: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.generateDatasetItems
getA2A()
Section titled “getA2A()”getA2A(
agentId):A2A
Gets an A2A client for interacting with an agent via the A2A protocol
Parameters
Section titled “Parameters”agentId
Section titled “agentId”string
ID of the agent to interact with
Returns
Section titled “Returns”A2A
A2A client instance
Inherited from
Section titled “Inherited from”MastraClient.getA2A
getA2AV1()
Section titled “getA2AV1()”getA2AV1(
agentId):A2AV1
Gets an A2A Protocol v1.0 client for an agent.
Parameters
Section titled “Parameters”agentId
Section titled “agentId”string
ID of the agent to interact with
Returns
Section titled “Returns”A2AV1
Inherited from
Section titled “Inherited from”MastraClient.getA2AV1
getAgent()
Section titled “getAgent()”getAgent(
agentId,version?,routeOverrides?):Agent
Gets an agent instance by ID
Parameters
Section titled “Parameters”agentId
Section titled “agentId”string
ID of the agent to retrieve
version?
Section titled “version?”AgentVersionIdentifier
Optional version selector for stored agent overrides
routeOverrides?
Section titled “routeOverrides?”stream?
Section titled “stream?”string
Returns
Section titled “Returns”Agent
Agent instance
Inherited from
Section titled “Inherited from”MastraClient.getAgent
getAgentBuilderAction()
Section titled “getAgentBuilderAction()”getAgentBuilderAction(
actionId):AgentBuilder
Gets an agent builder instance for executing agent-builder workflows
Parameters
Section titled “Parameters”actionId
Section titled “actionId”string
Returns
Section titled “Returns”AgentBuilder
AgentBuilder instance
Inherited from
Section titled “Inherited from”MastraClient.getAgentBuilderAction
getAgentBuilderActions()
Section titled “getAgentBuilderActions()”getAgentBuilderActions():
Promise<{[key:string]:object; }>
Gets all available agent builder actions
Returns
Section titled “Returns”Promise<{[key: string]: object; }>
Promise containing map of action IDs to action details
Inherited from
Section titled “Inherited from”MastraClient.getAgentBuilderActions
getAgentController()
Section titled “getAgentController()”getAgentController(
controllerId):AgentController
Scopes to an agent controller hosted on the connected Mastra instance. Use
getAgentController(id).session(resourceId) to create/resume a session,
stream its events, and send messages.
Parameters
Section titled “Parameters”controllerId
Section titled “controllerId”string
The id the agent controller is registered under on Mastra
Returns
Section titled “Returns”AgentController
Inherited from
Section titled “Inherited from”MastraClient.getAgentController
getBackgroundTask()
Section titled “getBackgroundTask()”getBackgroundTask(
backgroundTaskId):Promise<{agentId:string;args: {[key:string]:unknown; };completedAt?:string;createdAt:string;error?: {message:string;stack?:string; };id:string;maxRetries:number;resourceId?:string;result?:unknown;retryCount:number;runId:string;startedAt?:string;status:"suspended"|"running"|"pending"|"completed"|"failed"|"cancelled"|"timed_out";suspendPayload?:unknown;threadId?:string;timeoutMs:number;toolCallId:string;toolName:string; }>
Gets a single background task by ID.
Parameters
Section titled “Parameters”backgroundTaskId
Section titled “backgroundTaskId”string
Returns
Section titled “Returns”Promise<{ agentId: string; args: {[key: string]: unknown; }; completedAt?: string; createdAt: string; error?: { message: string; stack?: string; }; id: string; maxRetries: number; resourceId?: string; result?: unknown; retryCount: number; runId: string; startedAt?: string; status: "suspended" | "running" | "pending" | "completed" | "failed" | "cancelled" | "timed_out"; suspendPayload?: unknown; threadId?: string; timeoutMs: number; toolCallId: string; toolName: string; }>
Inherited from
Section titled “Inherited from”MastraClient.getBackgroundTask
getBranch()
Section titled “getBranch()”getBranch(
params):Promise<{spans:object[];traceId:string; }>
Retrieves the subtree of spans rooted at a given span. The optional depth field
bounds descendant levels below the anchor (0 = anchor only; omitted = full subtree).
Parameters
Section titled “Parameters”params
Section titled “params”GetBranchArgs
Returns
Section titled “Returns”Promise<{ spans: object[]; traceId: string; }>
Inherited from
Section titled “Inherited from”MastraClient.getBranch
getBuilderAvailableModels()
Section titled “getBuilderAvailableModels()”getBuilderAvailableModels():
Promise<{providers:object[]; }>
Retrieves the AI providers/models available under the active builder model policy. The server applies the EE allowlist, so the result can be rendered directly in the model picker.
Returns
Section titled “Returns”Promise<{ providers: object[]; }>
Promise containing the policy-filtered providers/models
Inherited from
Section titled “Inherited from”MastraClient.getBuilderAvailableModels
getBuilderRegistryPopular()
Section titled “getBuilderRegistryPopular()”getBuilderRegistryPopular(
registryId,params?):Promise<{count:number;limit:number;offset:number;skills:object[]; }>
Fetch the popular skills feed from a builder skill registry.
Requires stored-skills:read permission.
Parameters
Section titled “Parameters”registryId
Section titled “registryId”string
params?
Section titled “params?”limit?
Section titled “limit?”number
offset?
Section titled “offset?”number
Returns
Section titled “Returns”Promise<{ count: number; limit: number; offset: number; skills: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.getBuilderRegistryPopular
getBuilderRegistryPreview()
Section titled “getBuilderRegistryPreview()”getBuilderRegistryPreview(
registryId,params):Promise<{content:string; }>
Fetch the rendered preview content for a single registry skill.
Requires stored-skills:read permission.
Parameters
Section titled “Parameters”registryId
Section titled “registryId”string
params
Section titled “params”string
string
string
Returns
Section titled “Returns”Promise<{ content: string; }>
Inherited from
Section titled “Inherited from”MastraClient.getBuilderRegistryPreview
getBuilderSettings()
Section titled “getBuilderSettings()”getBuilderSettings():
Promise<{configuration?: {agent?: {[key:string]:unknown;agents?: {allowed?:string[]; };models?: {allowed?: (… | …)[];default?: {kind:"custom";modelId:string;provider:string; } | {modelId:string;provider:string; }; };tools?: {allowed?:string[]; };workflows?: {allowed?:string[]; }; }; };enabled:boolean;features?: {agent?: {agents?:boolean;avatarUpload?:boolean;browser?:boolean;favorites?:boolean;memory?:boolean;model?:boolean;scorers?:boolean;skills?:boolean;tools?:boolean;variables?:boolean;workflows?:boolean; }; };modelPolicy?: {active:boolean;allowed?: ({kind:"custom";modelId?:string;provider:string; } | {modelId?:string;provider:string; })[];default?: {kind:"custom";modelId:string;provider:string; } | {modelId:string;provider:string; };pickerVisible?:boolean; };modelPolicyWarnings?:string[];picker?: {visibleAgents:string[] |null;visibleTools:string[] |null;visibleWorkflows:string[] |null; }; }>
Retrieves agent builder settings for UI gating. Returns feature flags and configuration set by admin.
Returns
Section titled “Returns”Promise<{ configuration?: { agent?: {[key: string]: unknown; agents?: { allowed?: string[]; }; models?: { allowed?: (… | …)[]; default?: { kind: "custom"; modelId: string; provider: string; } | { modelId: string; provider: string; }; }; tools?: { allowed?: string[]; }; workflows?: { allowed?: string[]; }; }; }; enabled: boolean; features?: { agent?: { agents?: boolean; avatarUpload?: boolean; browser?: boolean; favorites?: boolean; memory?: boolean; model?: boolean; scorers?: boolean; skills?: boolean; tools?: boolean; variables?: boolean; workflows?: boolean; }; }; modelPolicy?: { active: boolean; allowed?: ({ kind: "custom"; modelId?: string; provider: string; } | { modelId?: string; provider: string; })[]; default?: { kind: "custom"; modelId: string; provider: string; } | { modelId: string; provider: string; }; pickerVisible?: boolean; }; modelPolicyWarnings?: string[]; picker?: { visibleAgents: string[] | null; visibleTools: string[] | null; visibleWorkflows: string[] | null; }; }>
Promise containing builder settings
Inherited from
Section titled “Inherited from”MastraClient.getBuilderSettings
getDataset()
Section titled “getDataset()”getDataset(
datasetId,tenancy?):Promise<SerializedRouteResponse<"GET /datasets/:datasetId">>
Gets a single dataset by ID. Optionally scope the lookup to a specific tenant organization/project — the server returns 404 if the dataset does not belong to the given tenant.
Parameters
Section titled “Parameters”datasetId
Section titled “datasetId”string
tenancy?
Section titled “tenancy?”GetDatasetsDatasetId_QueryParams
Returns
Section titled “Returns”Promise<SerializedRouteResponse<"GET /datasets/:datasetId">>
Inherited from
Section titled “Inherited from”MastraClient.getDataset
getDatasetExperiment()
Section titled “getDatasetExperiment()”getDatasetExperiment(
datasetId,experimentId):Promise<SerializedRouteResponse<"GET /datasets/:datasetId/experiments/:experimentId">>
Gets a single dataset experiment by ID
Parameters
Section titled “Parameters”datasetId
Section titled “datasetId”string
experimentId
Section titled “experimentId”string
Returns
Section titled “Returns”Promise<SerializedRouteResponse<"GET /datasets/:datasetId/experiments/:experimentId">>
Inherited from
Section titled “Inherited from”MastraClient.getDatasetExperiment
getDatasetItem()
Section titled “getDatasetItem()”getDatasetItem(
datasetId,itemId):Promise<{createdAt:string;datasetId:string;datasetVersion:number;expectedTrajectory?:unknown;externalId?:string|null;groundTruth?:unknown;id:string;input:unknown;metadata?: {[key:string]:unknown; } |null;requestContext?: {[key:string]:unknown; } |null;scorerIds?:string[] |null;source?: {referenceId?:string;type:"csv"|"json"|"trace"|"llm"|"experiment-result"|"candidate-screener"; } |null;toolMocks?:object[] |null;unmockedToolPolicy?:"allow"|"deny"|null;updatedAt:string; }>
Gets a single dataset item by ID
Parameters
Section titled “Parameters”datasetId
Section titled “datasetId”string
itemId
Section titled “itemId”string
Returns
Section titled “Returns”Promise<{ createdAt: string; datasetId: string; datasetVersion: number; expectedTrajectory?: unknown; externalId?: string | null; groundTruth?: unknown; id: string; input: unknown; metadata?: {[key: string]: unknown; } | null; requestContext?: {[key: string]: unknown; } | null; scorerIds?: string[] | null; source?: { referenceId?: string; type: "csv" | "json" | "trace" | "llm" | "experiment-result" | "candidate-screener"; } | null; toolMocks?: object[] | null; unmockedToolPolicy?: "allow" | "deny" | null; updatedAt: string; }>
Inherited from
Section titled “Inherited from”MastraClient.getDatasetItem
getDatasetItemVersion()
Section titled “getDatasetItemVersion()”getDatasetItemVersion(
datasetId,itemId,datasetVersion):Promise<{createdAt:string;datasetId:string;datasetVersion:number;expectedTrajectory?:unknown;externalId?:string|null;groundTruth?:unknown;id:string;input:unknown;metadata?: {[key:string]:unknown; } |null;requestContext?: {[key:string]:unknown; } |null;scorerIds?:string[] |null;source?: {referenceId?:string;type:"csv"|"json"|"trace"|"llm"|"experiment-result"|"candidate-screener"; } |null;toolMocks?:object[] |null;unmockedToolPolicy?:"allow"|"deny"|null;updatedAt:string; }>
Gets a specific version of a dataset item
Parameters
Section titled “Parameters”datasetId
Section titled “datasetId”string
itemId
Section titled “itemId”string
datasetVersion
Section titled “datasetVersion”number
Returns
Section titled “Returns”Promise<{ createdAt: string; datasetId: string; datasetVersion: number; expectedTrajectory?: unknown; externalId?: string | null; groundTruth?: unknown; id: string; input: unknown; metadata?: {[key: string]: unknown; } | null; requestContext?: {[key: string]: unknown; } | null; scorerIds?: string[] | null; source?: { referenceId?: string; type: "csv" | "json" | "trace" | "llm" | "experiment-result" | "candidate-screener"; } | null; toolMocks?: object[] | null; unmockedToolPolicy?: "allow" | "deny" | null; updatedAt: string; }>
Inherited from
Section titled “Inherited from”MastraClient.getDatasetItemVersion
getDynamicWorkflow()
Section titled “getDynamicWorkflow()”getDynamicWorkflow(
dynamicWorkflowId):DynamicWorkflow
Gets a dynamic workflow instance by ID for further operations (details, delete).
To execute a dynamic workflow, use getWorkflow(id).createRun() like any other workflow.
Parameters
Section titled “Parameters”dynamicWorkflowId
Section titled “dynamicWorkflowId”string
ID of the dynamic workflow definition
Returns
Section titled “Returns”DynamicWorkflow
DynamicWorkflow instance
Inherited from
Section titled “Inherited from”MastraClient.getDynamicWorkflow
getEntityNames()
Section titled “getEntityNames()”getEntityNames(
params?):Promise<{names:string[]; }>
Returns distinct entity names with optional type filtering.
Parameters
Section titled “Parameters”params?
Section titled “params?”GetObservabilityDiscoveryEntityNames_QueryParams
Returns
Section titled “Returns”Promise<{ names: string[]; }>
Inherited from
Section titled “Inherited from”MastraClient.getEntityNames
getEntityTypes()
Section titled “getEntityTypes()”getEntityTypes():
Promise<{entityTypes:Shared_Type_58[]; }>
Returns distinct entity types from observability data.
Returns
Section titled “Returns”Promise<{ entityTypes: Shared_Type_58[]; }>
Inherited from
Section titled “Inherited from”MastraClient.getEntityTypes
getEnvironments()
Section titled “getEnvironments()”getEnvironments():
Promise<{environments:string[]; }>
Returns distinct environments from observability data.
Returns
Section titled “Returns”Promise<{ environments: string[]; }>
Inherited from
Section titled “Inherited from”MastraClient.getEnvironments
getExperimentReviewSummary()
Section titled “getExperimentReviewSummary()”getExperimentReviewSummary():
Promise<{counts:object[]; }>
Gets review status counts aggregated per experiment
Returns
Section titled “Returns”Promise<{ counts: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.getExperimentReviewSummary
getFeedbackAggregate()
Section titled “getFeedbackAggregate()”getFeedbackAggregate(
params):Promise<{changePercent?:number|null;previousValue?:number|null;value:number|null; }>
Returns an aggregated feedback value with optional period-over-period comparison.
Parameters
Section titled “Parameters”params
Section titled “params”PostObservabilityFeedbackAggregate_Body
Returns
Section titled “Returns”Promise<{ changePercent?: number | null; previousValue?: number | null; value: number | null; }>
Inherited from
Section titled “Inherited from”MastraClient.getFeedbackAggregate
getFeedbackBreakdown()
Section titled “getFeedbackBreakdown()”getFeedbackBreakdown(
params):Promise<{groups:object[]; }>
Returns feedback values grouped by specified dimensions.
Parameters
Section titled “Parameters”params
Section titled “params”PostObservabilityFeedbackBreakdown_Body
Returns
Section titled “Returns”Promise<{ groups: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.getFeedbackBreakdown
getFeedbackPercentiles()
Section titled “getFeedbackPercentiles()”getFeedbackPercentiles(
params):Promise<{series:object[]; }>
Returns percentile values for feedback bucketed by time interval.
Parameters
Section titled “Parameters”params
Section titled “params”PostObservabilityFeedbackPercentiles_Body
Returns
Section titled “Returns”Promise<{ series: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.getFeedbackPercentiles
getFeedbackTimeSeries()
Section titled “getFeedbackTimeSeries()”getFeedbackTimeSeries(
params):Promise<{series:object[]; }>
Returns feedback values bucketed by time interval with optional grouping.
Parameters
Section titled “Parameters”params
Section titled “params”PostObservabilityFeedbackTimeseries_Body
Returns
Section titled “Returns”Promise<{ series: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.getFeedbackTimeSeries
getInfrastructureStatus()
Section titled “getInfrastructureStatus()”getInfrastructureStatus():
Promise<{browser: {availableProviders:string[];config:object[];env:string|null;provider:string|null;registered:boolean;type:string|null; };channels: {providers:object[]; };registries: {skillsSh: {enabled:boolean; }; };workspace: {config:object[];filesystemProvider:string|null;hasFilesystem:boolean;hasSandbox:boolean;name:string|null;registered:boolean;sandboxProvider:string|null;source:string|null;type:string|null;workspaceId:string|null; }; }>
Retrieves Agent Builder infrastructure configuration and resolution status.
Requires infrastructure:read permission.
Returns
Section titled “Returns”Promise<{ browser: { availableProviders: string[]; config: object[]; env: string | null; provider: string | null; registered: boolean; type: string | null; }; channels: { providers: object[]; }; registries: { skillsSh: { enabled: boolean; }; }; workspace: { config: object[]; filesystemProvider: string | null; hasFilesystem: boolean; hasSandbox: boolean; name: string | null; registered: boolean; sandboxProvider: string | null; source: string | null; type: string | null; workspaceId: string | null; }; }>
Promise containing infrastructure status
Inherited from
Section titled “Inherited from”MastraClient.getInfrastructureStatus
getItemHistory()
Section titled “getItemHistory()”getItemHistory(
datasetId,itemId):Promise<{history:object[]; }>
Lists versions for a dataset item
Parameters
Section titled “Parameters”datasetId
Section titled “datasetId”string
itemId
Section titled “itemId”string
Returns
Section titled “Returns”Promise<{ history: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.getItemHistory
getLogForRun()
Section titled “getLogForRun()”getLogForRun(
params):Promise<{hasMore:boolean;logs:object[];page:number;perPage:number|false;total:number; }>
Gets logs for a specific run
Parameters
Section titled “Parameters”params
Section titled “params”GetLogParams
Parameters containing run ID to retrieve
Returns
Section titled “Returns”Promise<{ hasMore: boolean; logs: object[]; page: number; perPage: number | false; total: number; }>
Promise containing array of log messages
Inherited from
Section titled “Inherited from”MastraClient.getLogForRun
getMcpServerDetails()
Section titled “getMcpServerDetails()”getMcpServerDetails(
serverId,params?):Promise<GetMcpV0ServersId_Response>
Retrieves detailed information for a specific MCP server.
Parameters
Section titled “Parameters”serverId
Section titled “serverId”string
The ID of the MCP server to retrieve.
params?
Section titled “params?”GetMcpV0ServersId_QueryParams
Optional parameters, e.g., specific version.
Returns
Section titled “Returns”Promise<GetMcpV0ServersId_Response>
Promise containing the detailed MCP server information.
Inherited from
Section titled “Inherited from”MastraClient.getMcpServerDetails
getMcpServerResources()
Section titled “getMcpServerResources()”getMcpServerResources(
serverId):Promise<GetMcpServerIdResources_Response>
Lists resources available on an MCP server.
Parameters
Section titled “Parameters”serverId
Section titled “serverId”string
The ID of the MCP server.
Returns
Section titled “Returns”Promise<GetMcpServerIdResources_Response>
Promise containing the list of resources.
Inherited from
Section titled “Inherited from”MastraClient.getMcpServerResources
getMcpServers()
Section titled “getMcpServers()”getMcpServers(
params?):Promise<{next:string|null;servers:object[];total_count:number; }>
Retrieves a list of available MCP servers.
Parameters
Section titled “Parameters”params?
Section titled “params?”Optional parameters for pagination (page, perPage, or deprecated offset, limit).
limit?
Section titled “limit?”number
Deprecated
Use perPage instead
offset?
Section titled “offset?”number
Deprecated
Use page instead
number
perPage?
Section titled “perPage?”number
Returns
Section titled “Returns”Promise<{ next: string | null; servers: object[]; total_count: number; }>
Promise containing the list of MCP servers and pagination info.
Inherited from
Section titled “Inherited from”MastraClient.getMcpServers
getMcpServerTool()
Section titled “getMcpServerTool()”getMcpServerTool(
serverId,toolId):MCPTool
Gets an MCPTool resource instance for a specific tool on an MCP server. This instance can then be used to fetch details or execute the tool.
Parameters
Section titled “Parameters”serverId
Section titled “serverId”string
The ID of the MCP server.
toolId
Section titled “toolId”string
The ID of the tool.
Returns
Section titled “Returns”MCPTool
MCPTool instance.
Inherited from
Section titled “Inherited from”MastraClient.getMcpServerTool
getMcpServerTools()
Section titled “getMcpServerTools()”getMcpServerTools(
serverId):Promise<{tools:object[]; }>
Retrieves a list of tools for a specific MCP server.
Parameters
Section titled “Parameters”serverId
Section titled “serverId”string
The ID of the MCP server.
Returns
Section titled “Returns”Promise<{ tools: object[]; }>
Promise containing the list of tools.
Inherited from
Section titled “Inherited from”MastraClient.getMcpServerTools
getMemoryConfig()
Section titled “getMemoryConfig()”getMemoryConfig(
params):Promise<{config: {lastMessages?:number|false;messageHistory?: {atMaxRemoveTokens?:number;maxTokens:number; };observationalMemory?: {enabled:boolean;messageTokens?:number| {max:number;min:number; };observationModel?:string;observationModelRouting?:object[];observationTokens?:number| {max:number;min:number; };reflectionModel?:string;reflectionModelRouting?:object[];scope?:"thread"|"resource";shareTokenBudget?:boolean; };semanticRecall?:unknown;workingMemory?: {[key:string]:unknown;enabled?:boolean;schema?:unknown;scope?:"thread"|"resource";template?:string;version?:"stable"|"vnext"; }; } |null;memoryType?:"local"|"gateway"; }>
Retrieves memory config for a resource
Parameters
Section titled “Parameters”params
Section titled “params”GetMemoryConfigParams
Parameters containing the resource ID and optional request context
Returns
Section titled “Returns”Promise<{ config: { lastMessages?: number | false; messageHistory?: { atMaxRemoveTokens?: number; maxTokens: number; }; observationalMemory?: { enabled: boolean; messageTokens?: number | { max: number; min: number; }; observationModel?: string; observationModelRouting?: object[]; observationTokens?: number | { max: number; min: number; }; reflectionModel?: string; reflectionModelRouting?: object[]; scope?: "thread" | "resource"; shareTokenBudget?: boolean; }; semanticRecall?: unknown; workingMemory?: {[key: string]: unknown; enabled?: boolean; schema?: unknown; scope?: "thread" | "resource"; template?: string; version?: "stable" | "vnext"; }; } | null; memoryType?: "local" | "gateway"; }>
Promise containing memory configuration
Inherited from
Section titled “Inherited from”MastraClient.getMemoryConfig
getMemoryStatus()
Section titled “getMemoryStatus()”getMemoryStatus(
agentId,requestContext?,opts?):Promise<{memoryType?:"local"|"gateway";observationalMemory?: {enabled:boolean;hasRecord?:boolean;isObserving?:boolean;isReflecting?:boolean;lastObservedAt?:string;observationTokenCount?:number;originType?:string;tokenCount?:number; };result:boolean; }>
Gets the status of the memory system
Parameters
Section titled “Parameters”agentId
Section titled “agentId”string
The agent ID
requestContext?
Section titled “requestContext?”RequestContext<unknown> | Record<string, any>
Optional parameters including resourceId, threadId, and requestContext
resourceId?
Section titled “resourceId?”string
threadId?
Section titled “threadId?”string
Returns
Section titled “Returns”Promise<{ memoryType?: "local" | "gateway"; observationalMemory?: { enabled: boolean; hasRecord?: boolean; isObserving?: boolean; isReflecting?: boolean; lastObservedAt?: string; observationTokenCount?: number; originType?: string; tokenCount?: number; }; result: boolean; }>
Promise containing memory system status including observational memory info
Inherited from
Section titled “Inherited from”MastraClient.getMemoryStatus
getMemoryThread()
Section titled “getMemoryThread()”getMemoryThread(
threadId):MemoryThread
Gets a memory thread instance by ID
Parameters
Section titled “Parameters”threadId
Section titled “threadId”ID of the memory thread to retrieve
agentId?
Section titled “agentId?”string
threadId
Section titled “threadId”string
Returns
Section titled “Returns”MemoryThread
MemoryThread instance
Inherited from
Section titled “Inherited from”MastraClient.getMemoryThread
getMetricAggregate()
Section titled “getMetricAggregate()”getMetricAggregate(
params):Promise<{changePercent?:number|null;costChangePercent?:number|null;costUnit?:string|null;estimatedCost?:number|null;previousEstimatedCost?:number|null;previousValue?:number|null;value:number|null; }>
Returns an aggregated metric value with optional period-over-period comparison.
Parameters
Section titled “Parameters”params
Section titled “params”PostObservabilityMetricsAggregate_Body
Returns
Section titled “Returns”Promise<{ changePercent?: number | null; costChangePercent?: number | null; costUnit?: string | null; estimatedCost?: number | null; previousEstimatedCost?: number | null; previousValue?: number | null; value: number | null; }>
Inherited from
Section titled “Inherited from”MastraClient.getMetricAggregate
getMetricBreakdown()
Section titled “getMetricBreakdown()”getMetricBreakdown(
params):Promise<{groups:object[]; }>
Returns metric values grouped by specified dimensions.
Parameters
Section titled “Parameters”params
Section titled “params”PostObservabilityMetricsBreakdown_Body
Returns
Section titled “Returns”Promise<{ groups: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.getMetricBreakdown
getMetricLabelKeys()
Section titled “getMetricLabelKeys()”getMetricLabelKeys(
params):Promise<{keys:string[]; }>
Returns distinct label keys for a given metric.
Parameters
Section titled “Parameters”params
Section titled “params”GetObservabilityDiscoveryMetricLabelKeys_QueryParams
Returns
Section titled “Returns”Promise<{ keys: string[]; }>
Inherited from
Section titled “Inherited from”MastraClient.getMetricLabelKeys
getMetricLabelValues()
Section titled “getMetricLabelValues()”getMetricLabelValues(
params):Promise<{values:string[]; }>
Returns distinct values for a given metric label key.
Parameters
Section titled “Parameters”params
Section titled “params”GetObservabilityDiscoveryMetricLabelValues_QueryParams
Returns
Section titled “Returns”Promise<{ values: string[]; }>
Inherited from
Section titled “Inherited from”MastraClient.getMetricLabelValues
getMetricNames()
Section titled “getMetricNames()”getMetricNames(
params?):Promise<{names:string[]; }>
Returns distinct metric names with optional prefix filtering.
Parameters
Section titled “Parameters”params?
Section titled “params?”GetObservabilityDiscoveryMetricNames_QueryParams
Returns
Section titled “Returns”Promise<{ names: string[]; }>
Inherited from
Section titled “Inherited from”MastraClient.getMetricNames
getMetricPercentiles()
Section titled “getMetricPercentiles()”getMetricPercentiles(
params):Promise<{series:object[]; }>
Returns percentile values for a metric bucketed by time interval.
Parameters
Section titled “Parameters”params
Section titled “params”PostObservabilityMetricsPercentiles_Body
Returns
Section titled “Returns”Promise<{ series: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.getMetricPercentiles
getMetricTimeSeries()
Section titled “getMetricTimeSeries()”getMetricTimeSeries(
params):Promise<{series:object[]; }>
Returns metric values bucketed by time interval with optional grouping.
Parameters
Section titled “Parameters”params
Section titled “params”PostObservabilityMetricsTimeseries_Body
Returns
Section titled “Returns”Promise<{ series: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.getMetricTimeSeries
getObservabilityCapabilities()
Section titled “getObservabilityCapabilities()”getObservabilityCapabilities():
Promise<{capabilities: {deltaPolling:boolean;discovery: {entityNames:boolean;entityTypes:boolean;environments:boolean;metrics:boolean;serviceNames:boolean;tags:boolean; };feedback:boolean;logs:boolean;metrics:boolean;threadQuery:boolean;traceQuery:boolean;traceQueryDiscovery:boolean;traceQueryRootDuration:boolean;traceQueryTenantScope:boolean; };observabilityStorageType:string|null; }>
Returns which optional observability APIs the configured observability storage supports.
Returns
Section titled “Returns”Promise<{ capabilities: { deltaPolling: boolean; discovery: { entityNames: boolean; entityTypes: boolean; environments: boolean; metrics: boolean; serviceNames: boolean; tags: boolean; }; feedback: boolean; logs: boolean; metrics: boolean; threadQuery: boolean; traceQuery: boolean; traceQueryDiscovery: boolean; traceQueryRootDuration: boolean; traceQueryTenantScope: boolean; }; observabilityStorageType: string | null; }>
Inherited from
Section titled “Inherited from”MastraClient.getObservabilityCapabilities
getObservationalMemory()
Section titled “getObservationalMemory()”getObservationalMemory(
params):Promise<{history?:object[];record: {activeObservations:string;bufferedObservationChunks?:object[];bufferedObservations?:string;bufferedReflection?:string;config: {[key:string]:unknown; };createdAt:string;generationCount:number;id:string;isObserving:boolean;isReflecting:boolean;lastObservedAt?:string;metadata?: {[key:string]:unknown; };observationTokenCount:number;originType:"initial"|"observation"|"reflection";pendingMessageTokens:number;resourceId:string;scope:"thread"|"resource";threadId:string|null;totalTokensObserved:number;updatedAt:string; } |null; }>
Gets observational memory data for a resource or thread
Parameters
Section titled “Parameters”params
Section titled “params”GetObservationalMemoryParams
Parameters containing agentId, resourceId, threadId, and optional request context
Returns
Section titled “Returns”Promise<{ history?: object[]; record: { activeObservations: string; bufferedObservationChunks?: object[]; bufferedObservations?: string; bufferedReflection?: string; config: {[key: string]: unknown; }; createdAt: string; generationCount: number; id: string; isObserving: boolean; isReflecting: boolean; lastObservedAt?: string; metadata?: {[key: string]: unknown; }; observationTokenCount: number; originType: "initial" | "observation" | "reflection"; pendingMessageTokens: number; resourceId: string; scope: "thread" | "resource"; threadId: string | null; totalTokensObserved: number; updatedAt: string; } | null; }>
Promise containing the current OM record and history
Inherited from
Section titled “Inherited from”MastraClient.getObservationalMemory
getPermissionPatterns()
Section titled “getPermissionPatterns()”getPermissionPatterns():
Promise<{patterns:string[]; }>
Retrieves the authoritative list of valid permission-pattern strings. Used by Studio to validate route→permission literals and gate the sidebar.
Returns
Section titled “Returns”Promise<{ patterns: string[]; }>
Promise containing the permission patterns
Inherited from
Section titled “Inherited from”MastraClient.getPermissionPatterns
getProcessor()
Section titled “getProcessor()”getProcessor(
processorId):Processor
Gets a processor instance by ID
Parameters
Section titled “Parameters”processorId
Section titled “processorId”string
ID of the processor to retrieve
Returns
Section titled “Returns”Processor
Processor instance
Inherited from
Section titled “Inherited from”MastraClient.getProcessor
getProcessorProvider()
Section titled “getProcessorProvider()”getProcessorProvider(
providerId):ProcessorProvider
Gets a processor provider instance by ID for further operations
Parameters
Section titled “Parameters”providerId
Section titled “providerId”string
ID of the processor provider
Returns
Section titled “Returns”ProcessorProvider
ProcessorProvider instance
Inherited from
Section titled “Inherited from”MastraClient.getProcessorProvider
getProcessorProviders()
Section titled “getProcessorProviders()”getProcessorProviders():
Promise<GetProcessorProvidersResponse>
Lists all registered processor providers
Returns
Section titled “Returns”Promise<GetProcessorProvidersResponse>
Promise containing list of processor provider info
Inherited from
Section titled “Inherited from”MastraClient.getProcessorProviders
getSchedule()
Section titled “getSchedule()”getSchedule(
scheduleId):Promise<ScheduleResponse>
Gets a single schedule by ID.
Parameters
Section titled “Parameters”scheduleId
Section titled “scheduleId”string
Returns
Section titled “Returns”Promise<ScheduleResponse>
Inherited from
Section titled “Inherited from”MastraClient.getSchedule
getScoreAggregate()
Section titled “getScoreAggregate()”getScoreAggregate(
params):Promise<{changePercent?:number|null;previousValue?:number|null;value:number|null; }>
Returns an aggregated score value with optional period-over-period comparison.
Parameters
Section titled “Parameters”params
Section titled “params”PostObservabilityScoresAggregate_Body
Returns
Section titled “Returns”Promise<{ changePercent?: number | null; previousValue?: number | null; value: number | null; }>
Inherited from
Section titled “Inherited from”MastraClient.getScoreAggregate
getScoreBreakdown()
Section titled “getScoreBreakdown()”getScoreBreakdown(
params):Promise<{groups:object[]; }>
Returns score values grouped by specified dimensions.
Parameters
Section titled “Parameters”params
Section titled “params”PostObservabilityScoresBreakdown_Body
Returns
Section titled “Returns”Promise<{ groups: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.getScoreBreakdown
getScorePercentiles()
Section titled “getScorePercentiles()”getScorePercentiles(
params):Promise<{series:object[]; }>
Returns percentile values for scores bucketed by time interval.
Parameters
Section titled “Parameters”params
Section titled “params”PostObservabilityScoresPercentiles_Body
Returns
Section titled “Returns”Promise<{ series: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.getScorePercentiles
getScorer()
Section titled “getScorer()”getScorer(
scorerId):Promise<GetScorerResponse>
Retrieves a scorer by ID
Parameters
Section titled “Parameters”scorerId
Section titled “scorerId”string
ID of the scorer to retrieve
Returns
Section titled “Returns”Promise<GetScorerResponse>
Promise containing the scorer
Inherited from
Section titled “Inherited from”MastraClient.getScorer
getScoreTimeSeries()
Section titled “getScoreTimeSeries()”getScoreTimeSeries(
params):Promise<{series:object[]; }>
Returns score values bucketed by time interval with optional grouping.
Parameters
Section titled “Parameters”params
Section titled “params”PostObservabilityScoresTimeseries_Body
Returns
Section titled “Returns”Promise<{ series: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.getScoreTimeSeries
getServiceNames()
Section titled “getServiceNames()”getServiceNames():
Promise<{serviceNames:string[]; }>
Returns distinct service names from observability data.
Returns
Section titled “Returns”Promise<{ serviceNames: string[]; }>
Inherited from
Section titled “Inherited from”MastraClient.getServiceNames
getSpan()
Section titled “getSpan()”getSpan(
traceId,spanId):Promise<{span: {attributes?: {[key:string]:unknown; } |null;createdAt:string;endedAt?:string|null;entityId?:string|null;entityName?:string|null;entityType?:Shared_Type_58|null;entityVersionId?:string|null;environment?:string|null;error?:unknown;experimentId?:string|null;input?:unknown;isEvent:boolean;links?:unknown[] |null;metadata?: {[key:string]:unknown; } |null;name:string;organizationId?:string|null;output?:unknown;parentEntityId?:string|null;parentEntityName?:string|null;parentEntityType?:Shared_Type_58|null;parentEntityVersionId?:string|null;parentSpanId?:string|null;requestContext?: {[key:string]:unknown; } |null;requestId?:string|null;resourceId?:string|null;rootEntityId?:string|null;rootEntityName?:string|null;rootEntityType?:Shared_Type_58|null;rootEntityVersionId?:string|null;runId?:string|null;scope?: {[key:string]:unknown; } |null;serviceName?:string|null;sessionId?:string|null;source?:string|null;spanId:string;spanType:Shared_Type_57;startedAt:string;tags?:string[] |null;threadId?:string|null;traceId:string;updatedAt:string|null;userId?:string|null; }; }>
Retrieves a single span with full details by trace ID and span ID.
Parameters
Section titled “Parameters”traceId
Section titled “traceId”string
spanId
Section titled “spanId”string
Returns
Section titled “Returns”Promise<{ span: { attributes?: {[key: string]: unknown; } | null; createdAt: string; endedAt?: string | null; entityId?: string | null; entityName?: string | null; entityType?: Shared_Type_58 | null; entityVersionId?: string | null; environment?: string | null; error?: unknown; experimentId?: string | null; input?: unknown; isEvent: boolean; links?: unknown[] | null; metadata?: {[key: string]: unknown; } | null; name: string; organizationId?: string | null; output?: unknown; parentEntityId?: string | null; parentEntityName?: string | null; parentEntityType?: Shared_Type_58 | null; parentEntityVersionId?: string | null; parentSpanId?: string | null; requestContext?: {[key: string]: unknown; } | null; requestId?: string | null; resourceId?: string | null; rootEntityId?: string | null; rootEntityName?: string | null; rootEntityType?: Shared_Type_58 | null; rootEntityVersionId?: string | null; runId?: string | null; scope?: {[key: string]: unknown; } | null; serviceName?: string | null; sessionId?: string | null; source?: string | null; spanId: string; spanType: Shared_Type_57; startedAt: string; tags?: string[] | null; threadId?: string | null; traceId: string; updatedAt: string | null; userId?: string | null; }; }>
Inherited from
Section titled “Inherited from”MastraClient.getSpan
getStoredAgent()
Section titled “getStoredAgent()”getStoredAgent(
storedAgentId):StoredAgent
Gets a stored agent instance by ID for further operations (details, update, delete)
Parameters
Section titled “Parameters”storedAgentId
Section titled “storedAgentId”string
ID of the stored agent to retrieve
Returns
Section titled “Returns”StoredAgent
StoredAgent instance
Inherited from
Section titled “Inherited from”MastraClient.getStoredAgent
getStoredMCPClient()
Section titled “getStoredMCPClient()”getStoredMCPClient(
storedMCPClientId):StoredMCPClient
Gets a stored MCP client instance by ID for further operations (details, update, delete)
Parameters
Section titled “Parameters”storedMCPClientId
Section titled “storedMCPClientId”string
ID of the stored MCP client
Returns
Section titled “Returns”StoredMCPClient
StoredMCPClient instance
Inherited from
Section titled “Inherited from”MastraClient.getStoredMCPClient
getStoredPromptBlock()
Section titled “getStoredPromptBlock()”getStoredPromptBlock(
storedPromptBlockId):StoredPromptBlock
Gets a stored prompt block instance by ID for further operations (details, update, delete)
Parameters
Section titled “Parameters”storedPromptBlockId
Section titled “storedPromptBlockId”string
ID of the stored prompt block to retrieve
Returns
Section titled “Returns”StoredPromptBlock
StoredPromptBlock instance
Inherited from
Section titled “Inherited from”MastraClient.getStoredPromptBlock
getStoredScorer()
Section titled “getStoredScorer()”getStoredScorer(
storedScorerId):StoredScorer
Gets a stored scorer definition instance by ID for further operations (details, update, delete)
Parameters
Section titled “Parameters”storedScorerId
Section titled “storedScorerId”string
ID of the stored scorer definition
Returns
Section titled “Returns”StoredScorer
StoredScorer instance
Inherited from
Section titled “Inherited from”MastraClient.getStoredScorer
getStoredSkill()
Section titled “getStoredSkill()”getStoredSkill(
storedSkillId):StoredSkill
Gets a stored skill instance by ID for further operations (details, update, delete)
Parameters
Section titled “Parameters”storedSkillId
Section titled “storedSkillId”string
ID of the stored skill
Returns
Section titled “Returns”StoredSkill
StoredSkill instance
Inherited from
Section titled “Inherited from”MastraClient.getStoredSkill
getStoredWorkspace()
Section titled “getStoredWorkspace()”getStoredWorkspace(
id):Promise<{activeVersionId?:string;authorId?:string;autoSync?:boolean;createdAt:string;description?:string;filesystem?: {config: {[key:string]:unknown; };provider:string; };id:string;metadata?: {[key:string]:unknown; };mounts?: {[key:string]:object; };name:string;operationTimeout?:number;sandbox?: {config: {[key:string]:unknown; };provider:string; };search?: {autoIndexPaths?:string[];bm25?:boolean| {b?:number;k1?:number; };embedderConfig?: {[key:string]:unknown; };embedderModel?:string;embedderProvider?:string;searchIndexName?:string;vectorConfig?: {[key:string]:unknown; };vectorProvider?:string; };skills?:string[];status:string;tools?: {enabled?:boolean;requireApproval?:boolean;tools?: {[key:string]:object; }; };updatedAt:string; }>
Gets a specific stored workspace by ID
Parameters
Section titled “Parameters”string
The workspace ID
Returns
Section titled “Returns”Promise<{ activeVersionId?: string; authorId?: string; autoSync?: boolean; createdAt: string; description?: string; filesystem?: { config: {[key: string]: unknown; }; provider: string; }; id: string; metadata?: {[key: string]: unknown; }; mounts?: {[key: string]: object; }; name: string; operationTimeout?: number; sandbox?: { config: {[key: string]: unknown; }; provider: string; }; search?: { autoIndexPaths?: string[]; bm25?: boolean | { b?: number; k1?: number; }; embedderConfig?: {[key: string]: unknown; }; embedderModel?: string; embedderProvider?: string; searchIndexName?: string; vectorConfig?: {[key: string]: unknown; }; vectorProvider?: string; }; skills?: string[]; status: string; tools?: { enabled?: boolean; requireApproval?: boolean; tools?: {[key: string]: object; }; }; updatedAt: string; }>
Promise containing the stored workspace
Inherited from
Section titled “Inherited from”MastraClient.getStoredWorkspace
getSystemPackages()
Section titled “getSystemPackages()”getSystemPackages():
Promise<{cmsEnabled:boolean;editorSource?:"code"|"db";editorSourceCapabilities?: {canOpenChangeRequest:boolean;canSave:boolean;provider?: {displayName:string;id:string; };source:"code"|"db";storage:"filesystem"|"database"|"source-provider"|"unavailable";unavailableReason?:string; };isDev:boolean;liveKitConnectionRouteEnabled:boolean;observabilityEnabled:boolean;observabilityRuntimeStrategy?:"realtime"|"batch-with-updates"|"insert-only"|"event-sourced";observabilityStorageCapabilities?: {deltaPolling:boolean;discovery: {entityNames:boolean;entityTypes:boolean;environments:boolean;metrics:boolean;serviceNames:boolean;tags:boolean; };feedback:boolean;logs:boolean;metrics:boolean;threadQuery:boolean;traceQuery:boolean;traceQueryDiscovery:boolean;traceQueryRootDuration:boolean;traceQueryTenantScope:boolean; };observabilityStorageType?:string;packages:object[];storageType?:string; }>
Retrieves installed Mastra packages and their versions
Returns
Section titled “Returns”Promise<{ cmsEnabled: boolean; editorSource?: "code" | "db"; editorSourceCapabilities?: { canOpenChangeRequest: boolean; canSave: boolean; provider?: { displayName: string; id: string; }; source: "code" | "db"; storage: "filesystem" | "database" | "source-provider" | "unavailable"; unavailableReason?: string; }; isDev: boolean; liveKitConnectionRouteEnabled: boolean; observabilityEnabled: boolean; observabilityRuntimeStrategy?: "realtime" | "batch-with-updates" | "insert-only" | "event-sourced"; observabilityStorageCapabilities?: { deltaPolling: boolean; discovery: { entityNames: boolean; entityTypes: boolean; environments: boolean; metrics: boolean; serviceNames: boolean; tags: boolean; }; feedback: boolean; logs: boolean; metrics: boolean; threadQuery: boolean; traceQuery: boolean; traceQueryDiscovery: boolean; traceQueryRootDuration: boolean; traceQueryTenantScope: boolean; }; observabilityStorageType?: string; packages: object[]; storageType?: string; }>
Promise containing the list of installed Mastra packages
Inherited from
Section titled “Inherited from”MastraClient.getSystemPackages
getTags()
Section titled “getTags()”getTags(
params?):Promise<{tags:string[]; }>
Returns distinct tags with optional entity type filtering.
Parameters
Section titled “Parameters”params?
Section titled “params?”GetObservabilityDiscoveryEntityNames_QueryParams
Returns
Section titled “Returns”Promise<{ tags: string[]; }>
Inherited from
Section titled “Inherited from”MastraClient.getTags
getTool()
Section titled “getTool()”getTool(
toolId):Tool
Gets a tool instance by ID
Parameters
Section titled “Parameters”toolId
Section titled “toolId”string
ID of the tool to retrieve
Returns
Section titled “Returns”Tool
Tool instance
Inherited from
Section titled “Inherited from”MastraClient.getTool
getToolProvider()
Section titled “getToolProvider()”getToolProvider(
providerId):ToolProvider
Gets a tool provider instance by ID for further operations (listToolkits, listTools, getToolSchema)
Parameters
Section titled “Parameters”providerId
Section titled “providerId”string
ID of the tool provider
Returns
Section titled “Returns”ToolProvider
ToolProvider instance
Inherited from
Section titled “Inherited from”MastraClient.getToolProvider
getTrace()
Section titled “getTrace()”getTrace(
traceId):Promise<{spans:object[];traceId:string; }>
Retrieves a specific trace by ID.
Parameters
Section titled “Parameters”traceId
Section titled “traceId”string
Returns
Section titled “Returns”Promise<{ spans: object[]; traceId: string; }>
Inherited from
Section titled “Inherited from”MastraClient.getTrace
getTraceLight()
Section titled “getTraceLight()”getTraceLight(
traceId):Promise<{spans:object[];traceId:string; }>
Retrieves a lightweight trace by ID (timeline fields only, excludes heavy fields).
Parameters
Section titled “Parameters”traceId
Section titled “traceId”string
Returns
Section titled “Returns”Promise<{ spans: object[]; traceId: string; }>
Inherited from
Section titled “Inherited from”MastraClient.getTraceLight
getTraceQueryFields()
Section titled “getTraceQueryFields()”getTraceQueryFields(
params,options?):Promise<{canonicalFields:object[];observedFields:object[];observedFieldsTruncated:boolean; }>
Returns canonical and observed fields available to the advanced trace-query grammar.
Parameters
Section titled “Parameters”params
Section titled “params”PostObservabilityTracesQueryFields_Body
options?
Section titled “options?”signal?
Section titled “signal?”AbortSignal
Returns
Section titled “Returns”Promise<{ canonicalFields: object[]; observedFields: object[]; observedFieldsTruncated: boolean; }>
Inherited from
Section titled “Inherited from”MastraClient.getTraceQueryFields
getTraceQueryValues()
Section titled “getTraceQueryValues()”getTraceQueryValues(
params,options?):Promise<{values:object[];valuesTruncated:boolean; }>
Returns bounded string suggestions for one eligible trace-query field.
Parameters
Section titled “Parameters”params
Section titled “params”PostObservabilityTracesQueryValues_Body
options?
Section titled “options?”signal?
Section titled “signal?”AbortSignal
Returns
Section titled “Returns”Promise<{ values: object[]; valuesTruncated: boolean; }>
Inherited from
Section titled “Inherited from”MastraClient.getTraceQueryValues
getTraces()
Section titled “getTraces()”getTraces(
params):Promise<LegacyGetTracesResponse>
Retrieves paginated list of traces with optional filtering. This is the legacy API preserved for backward compatibility.
Parameters
Section titled “Parameters”params
Section titled “params”LegacyTracesPaginatedArg
Parameters for pagination and filtering (legacy format)
Returns
Section titled “Returns”Promise<LegacyGetTracesResponse>
Promise containing paginated traces and pagination info
Deprecated
Section titled “Deprecated”Use listTraces instead for new features like ordering and more filters.
Inherited from
Section titled “Inherited from”MastraClient.getTraces
getTraceTrajectory()
Section titled “getTraceTrajectory()”getTraceTrajectory(
traceId):Promise<Trajectory>
Extracts a structured trajectory from a trace’s spans.
Parameters
Section titled “Parameters”traceId
Section titled “traceId”string
Returns
Section titled “Returns”Promise<Trajectory>
Inherited from
Section titled “Inherited from”MastraClient.getTraceTrajectory
getVector()
Section titled “getVector()”getVector(
vectorName):Vector
Gets a vector instance by name
Parameters
Section titled “Parameters”vectorName
Section titled “vectorName”string
Name of the vector to retrieve
Returns
Section titled “Returns”Vector
Vector instance
Inherited from
Section titled “Inherited from”MastraClient.getVector
getWorkflow()
Section titled “getWorkflow()”getWorkflow(
workflowId):Workflow
Gets a workflow instance by ID
Parameters
Section titled “Parameters”workflowId
Section titled “workflowId”string
ID of the workflow to retrieve
Returns
Section titled “Returns”Workflow
Workflow instance
Inherited from
Section titled “Inherited from”MastraClient.getWorkflow
getWorkflowBuilderSettings()
Section titled “getWorkflowBuilderSettings()”getWorkflowBuilderSettings():
Promise<{enabled:boolean;modelPolicy?: {active:boolean;allowed?: ({kind:"custom";modelId?:string;provider:string; } | {modelId?:string;provider:string; })[];default?: {kind:"custom";modelId:string;provider:string; } | {modelId:string;provider:string; };pickerVisible?:boolean; }; }>
Retrieves workflow builder settings for UI gating.
Returns
Section titled “Returns”Promise<{ enabled: boolean; modelPolicy?: { active: boolean; allowed?: ({ kind: "custom"; modelId?: string; provider: string; } | { modelId?: string; provider: string; })[]; default?: { kind: "custom"; modelId: string; provider: string; } | { modelId: string; provider: string; }; pickerVisible?: boolean; }; }>
Inherited from
Section titled “Inherited from”MastraClient.getWorkflowBuilderSettings
getWorkingMemory()
Section titled “getWorkingMemory()”getWorkingMemory(
agentId):Promise<unknown>
Retrieves the working memory for a specific thread (optionally resource-scoped).
Parameters
Section titled “Parameters”agentId
Section titled “agentId”ID of the agent.
agentId
Section titled “agentId”string
requestContext?
Section titled “requestContext?”RequestContext<unknown> | Record<string, any>
resourceId?
Section titled “resourceId?”string
threadId
Section titled “threadId”string
Returns
Section titled “Returns”Promise<unknown>
Working memory for the specified thread or resource.
Inherited from
Section titled “Inherited from”MastraClient.getWorkingMemory
getWorkspace()
Section titled “getWorkspace()”getWorkspace(
workspaceId):Workspace
Gets the workspace resource for filesystem, search, and skills operations
Parameters
Section titled “Parameters”workspaceId
Section titled “workspaceId”string
Workspace ID to target
Returns
Section titled “Returns”Workspace
Workspace instance
Inherited from
Section titled “Inherited from”MastraClient.getWorkspace
history()
Section titled “history()”history(
options):Promise<ListMemoryThreadMessagesResponse>
Fetch one page from Mastra’s native resource-scoped memory route.
Parameters
Section titled “Parameters”options
Section titled “options”agentId?
Section titled “agentId?”string
number
perPage?
Section titled “perPage?”number
signal?
Section titled “signal?”AbortSignal
threadId
Section titled “threadId”string
Returns
Section titled “Returns”Promise<ListMemoryThreadMessagesResponse>
installBuilderRegistrySkill()
Section titled “installBuilderRegistrySkill()”installBuilderRegistrySkill(
registryId,body):Promise<{filesWritten:number;name:string;storedSkillId:string; }>
Install a registry skill into the builder’s stored-skills DB.
Returns 409 when a stored skill with the derived id already exists.
Requires stored-skills:write permission.
Parameters
Section titled “Parameters”registryId
Section titled “registryId”string
string
GitHub repository owner
string
GitHub repository name
skillName
Section titled “skillName”string
Skill name from the registry
visibility?
Section titled “visibility?”"public" | "private"
Visibility for the new stored skill
Returns
Section titled “Returns”Promise<{ filesWritten: number; name: string; storedSkillId: string; }>
Inherited from
Section titled “Inherited from”MastraClient.installBuilderRegistrySkill
listAgentControllers()
Section titled “listAgentControllers()”listAgentControllers():
Promise<object[]>
Lists the agent controllers hosted on the connected Mastra instance.
Returns
Section titled “Returns”Promise<object[]>
Promise containing one record per agent controller, carrying its id
Inherited from
Section titled “Inherited from”MastraClient.listAgentControllers
listAgents()
Section titled “listAgents()”listAgents(
requestContext?,partial?):Promise<Record<string,GetAgentResponse>>
Retrieves all available agents
Parameters
Section titled “Parameters”requestContext?
Section titled “requestContext?”RequestContext<unknown> | Record<string, any>
Optional request context to pass as query parameter
partial?
Section titled “partial?”boolean
Returns
Section titled “Returns”Promise<Record<string, GetAgentResponse>>
Promise containing map of agent IDs to agent details
Inherited from
Section titled “Inherited from”MastraClient.listAgents
listAgentsModelProviders()
Section titled “listAgentsModelProviders()”listAgentsModelProviders():
Promise<{providers:object[]; }>
Returns
Section titled “Returns”Promise<{ providers: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.listAgentsModelProviders
listBackgroundTasks()
Section titled “listBackgroundTasks()”listBackgroundTasks(
params?):Promise<{tasks:object[];total:number; }>
Lists background tasks with optional filtering and pagination.
Parameters
Section titled “Parameters”params?
Section titled “params?”agentId?
Section titled “agentId?”string
dateFilterBy?
Section titled “dateFilterBy?”"createdAt" | "suspendedAt" | "startedAt" | "completedAt"
fromDate?
Section titled “fromDate?”Date
orderBy?
Section titled “orderBy?”"createdAt" | "suspendedAt" | "startedAt" | "completedAt"
orderDirection?
Section titled “orderDirection?”"asc" | "desc"
number
perPage?
Section titled “perPage?”number
resourceId?
Section titled “resourceId?”string
runId?
Section titled “runId?”string
status?
Section titled “status?”"suspended" | "running" | "pending" | "completed" | "failed" | "cancelled" | "timed_out"
threadId?
Section titled “threadId?”string
toDate?
Section titled “toDate?”Date
toolCallId?
Section titled “toolCallId?”string
toolName?
Section titled “toolName?”string
Returns
Section titled “Returns”Promise<{ tasks: object[]; total: number; }>
Inherited from
Section titled “Inherited from”MastraClient.listBackgroundTasks
listBranches()
Section titled “listBranches()”listBranches(
params?):Promise<{branches:object[];delta?: {hasMore:boolean;limit:number; };deltaCursor?:string;pagination?: {hasMore:boolean;page:number;perPage:number|false;total:number; }; }>
Retrieves a paginated list of trace branches with optional filtering and sorting. Each row is a branch-anchor span (AGENT_RUN, WORKFLOW_RUN, TOOL_CALL, etc.) including ones nested under a different root entity. Pairs with getBranch to expand a single branch into its subtree.
Parameters
Section titled “Parameters”params?
Section titled “params?”after?
Section titled “after?”string
filters?
Section titled “filters?”Omit<GetObservabilityBranches_QueryParams, "page" | "perPage" | "mode" | "limit" | "after" | "field" | "direction">
limit?
Section titled “limit?”number
Maximum number of updates to return in one delta poll
"page" | "delta"
orderBy?
Section titled “orderBy?”Pick<GetObservabilityBranches_QueryParams, "field" | "direction">
pagination?
Section titled “pagination?”Pick<GetObservabilityBranches_QueryParams, "page" | "perPage">
Returns
Section titled “Returns”Promise<{ branches: object[]; delta?: { hasMore: boolean; limit: number; }; deltaCursor?: string; pagination?: { hasMore: boolean; page: number; perPage: number | false; total: number; }; }>
Inherited from
Section titled “Inherited from”MastraClient.listBranches
listBuilderRegistries()
Section titled “listBuilderRegistries()”listBuilderRegistries():
Promise<{registries:object[]; }>
Lists known skill registries surfaced by the Agent Builder config.
Each entry reports whether the registry is enabled. Disabled or unknown
registries return 404 from registry-scoped routes.
Requires stored-skills:read permission.
Returns
Section titled “Returns”Promise<{ registries: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.listBuilderRegistries
listDatasetExperimentResults()
Section titled “listDatasetExperimentResults()”listDatasetExperimentResults(
datasetId,experimentId,options?):Promise<ListDatasetExperimentResultsResponse>
Lists results for a dataset experiment.
tags restricts the list to results that have all of the given tags.
Parameters
Section titled “Parameters”datasetId
Section titled “datasetId”string
experimentId
Section titled “experimentId”string
options?
Section titled “options?”GetDatasetsDatasetIdExperimentsExperimentIdResults_QueryParams
Returns
Section titled “Returns”Promise<ListDatasetExperimentResultsResponse>
Inherited from
Section titled “Inherited from”MastraClient.listDatasetExperimentResults
listDatasetExperiments()
Section titled “listDatasetExperiments()”listDatasetExperiments(
datasetId,params?):Promise<{experiments:object[];pagination: {hasMore:boolean;page:number;perPage:number|false;total:number; }; }>
Lists experiments for a dataset
Parameters
Section titled “Parameters”datasetId
Section titled “datasetId”string
params?
Section titled “params?”GetExperiments_QueryParams
Returns
Section titled “Returns”Promise<{ experiments: object[]; pagination: { hasMore: boolean; page: number; perPage: number | false; total: number; }; }>
Inherited from
Section titled “Inherited from”MastraClient.listDatasetExperiments
listDatasetItems()
Section titled “listDatasetItems()”listDatasetItems(
datasetId,params?):Promise<{items:object[];pagination: {hasMore:boolean;page:number;perPage:number|false;total:number; }; }>
Lists items in a dataset with optional pagination, search, and version filter
Parameters
Section titled “Parameters”datasetId
Section titled “datasetId”string
params?
Section titled “params?”GetDatasetsDatasetIdItems_QueryParams
Returns
Section titled “Returns”Promise<{ items: object[]; pagination: { hasMore: boolean; page: number; perPage: number | false; total: number; }; }>
Inherited from
Section titled “Inherited from”MastraClient.listDatasetItems
listDatasets()
Section titled “listDatasets()”listDatasets(
params?):Promise<{datasets:object[];pagination: {hasMore:boolean;page:number;perPage:number|false;total:number; }; }>
Lists all datasets with optional pagination
Parameters
Section titled “Parameters”params?
Section titled “params?”orderBy?
Section titled “orderBy?”{ direction: "ASC" | "DESC"; field: "name" | "createdAt" | "updatedAt"; }
orderBy.direction
Section titled “orderBy.direction”"ASC" | "DESC"
orderBy.field
Section titled “orderBy.field”"name" | "createdAt" | "updatedAt"
number
perPage?
Section titled “perPage?”number
targetIds?
Section titled “targetIds?”string[]
Only return datasets attached to at least one of these target IDs
targetType?
Section titled “targetType?”"agent" | "workflow" | "scorer" | "processor"
Only return records attached to targets of this type
Returns
Section titled “Returns”Promise<{ datasets: object[]; pagination: { hasMore: boolean; page: number; perPage: number | false; total: number; }; }>
Inherited from
Section titled “Inherited from”MastraClient.listDatasets
listDatasetVersions()
Section titled “listDatasetVersions()”listDatasetVersions(
datasetId,pagination?):Promise<{pagination: {hasMore:boolean;page:number;perPage:number|false;total:number; };versions:object[]; }>
Lists versions for a dataset
Parameters
Section titled “Parameters”datasetId
Section titled “datasetId”string
pagination?
Section titled “pagination?”GetScoresRunRunId_QueryParams
Returns
Section titled “Returns”Promise<{ pagination: { hasMore: boolean; page: number; perPage: number | false; total: number; }; versions: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.listDatasetVersions
listDynamicWorkflows()
Section titled “listDynamicWorkflows()”listDynamicWorkflows(
params?):Promise<{total:number;workflows:object[]; }>
Lists dynamic workflow definitions, optionally filtered by status or author
Parameters
Section titled “Parameters”params?
Section titled “params?”Optional filters: status (‘active’ | ‘archived’) and authorId
authorId?
Section titled “authorId?”string
Filter dynamic workflows by author identifier
status?
Section titled “status?”"archived" | "active"
Filter dynamic workflows by status (defaults to active when omitted by the handler)
Returns
Section titled “Returns”Promise<{ total: number; workflows: object[]; }>
Promise containing the matching definitions and a total count
Inherited from
Section titled “Inherited from”MastraClient.listDynamicWorkflows
listEmbedders()
Section titled “listEmbedders()”listEmbedders():
Promise<{embedders:object[]; }>
Lists all available embedding models
Returns
Section titled “Returns”Promise<{ embedders: object[]; }>
Promise containing list of available embedders
Inherited from
Section titled “Inherited from”MastraClient.listEmbedders
listExperiments()
Section titled “listExperiments()”listExperiments(
params?):Promise<{experiments:object[];pagination: {hasMore:boolean;page:number;perPage:number|false;total:number; }; }>
Lists all experiments across all datasets
Parameters
Section titled “Parameters”params?
Section titled “params?”comparisonId?
Section titled “comparisonId?”string
experimentSetId?
Section titled “experimentSetId?”string
orderBy?
Section titled “orderBy?”{ direction: "ASC" | "DESC"; field: "status" | "createdAt"; }
orderBy.direction
Section titled “orderBy.direction”"ASC" | "DESC"
orderBy.field
Section titled “orderBy.field”"status" | "createdAt"
number
perPage?
Section titled “perPage?”number
targetId?
Section titled “targetId?”string
Only return experiments run against this target ID
targetType?
Section titled “targetType?”"agent" | "workflow" | "scorer" | "processor"
Only return records attached to targets of this type
trialIndex?
Section titled “trialIndex?”number
variantId?
Section titled “variantId?”string
Returns
Section titled “Returns”Promise<{ experiments: object[]; pagination: { hasMore: boolean; page: number; perPage: number | false; total: number; }; }>
Inherited from
Section titled “Inherited from”MastraClient.listExperiments
listFeedback()
Section titled “listFeedback()”listFeedback(
params?):Promise<{delta?: {hasMore:boolean;limit:number; };deltaCursor?:string;feedback:object[];pagination?: {hasMore:boolean;page:number;perPage:number|false;total:number; }; }>
Retrieves a paginated list of feedback records.
Parameters
Section titled “Parameters”params?
Section titled “params?”after?
Section titled “after?”string
filters?
Section titled “filters?”Omit<GetObservabilityFeedback_QueryParams, "page" | "perPage" | "mode" | "limit" | "after" | "field" | "direction">
limit?
Section titled “limit?”number
Maximum number of updates to return in one delta poll
"page" | "delta"
orderBy?
Section titled “orderBy?”Pick<GetObservabilityFeedback_QueryParams, "field" | "direction">
pagination?
Section titled “pagination?”Pick<GetObservabilityFeedback_QueryParams, "page" | "perPage">
Returns
Section titled “Returns”Promise<{ delta?: { hasMore: boolean; limit: number; }; deltaCursor?: string; feedback: object[]; pagination?: { hasMore: boolean; page: number; perPage: number | false; total: number; }; }>
Inherited from
Section titled “Inherited from”MastraClient.listFeedback
listLogs()
Section titled “listLogs()”listLogs(
params):Promise<{hasMore:boolean;logs:object[];page:number;perPage:number|false;total:number; }>
Retrieves logs
Parameters
Section titled “Parameters”params
Section titled “params”Parameters for filtering logs
filters?
Section titled “filters?”string | string[]
fromDate?
Section titled “fromDate?”Date
logLevel?
Section titled “logLevel?”"error" | "debug" | "info" | "warn" | "silent"
number
perPage?
Section titled “perPage?”number
toDate?
Section titled “toDate?”Date
transportId
Section titled “transportId”string
Returns
Section titled “Returns”Promise<{ hasMore: boolean; logs: object[]; page: number; perPage: number | false; total: number; }>
Promise containing array of log messages
Inherited from
Section titled “Inherited from”MastraClient.listLogs
listLogsVNext()
Section titled “listLogsVNext()”listLogsVNext(
params?):Promise<{delta?: {hasMore:boolean;limit:number; };deltaCursor?:string;logs:object[];pagination?: {hasMore:boolean;page:number;perPage:number|false;total:number; }; }>
Retrieves a paginated list of observability logs.
Parameters
Section titled “Parameters”params?
Section titled “params?”after?
Section titled “after?”string
filters?
Section titled “filters?”Omit<GetObservabilityLogs_QueryParams, "page" | "perPage" | "mode" | "limit" | "after" | "field" | "direction">
limit?
Section titled “limit?”number
Maximum number of updates to return in one delta poll
"page" | "delta"
orderBy?
Section titled “orderBy?”Pick<GetObservabilityLogs_QueryParams, "field" | "direction">
pagination?
Section titled “pagination?”Pick<GetObservabilityLogs_QueryParams, "page" | "perPage">
Returns
Section titled “Returns”Promise<{ delta?: { hasMore: boolean; limit: number; }; deltaCursor?: string; logs: object[]; pagination?: { hasMore: boolean; page: number; perPage: number | false; total: number; }; }>
Inherited from
Section titled “Inherited from”MastraClient.listLogsVNext
listLogTransports()
Section titled “listLogTransports()”listLogTransports():
Promise<GetLogsTransports_Response>
List of all log transports
Returns
Section titled “Returns”Promise<GetLogsTransports_Response>
Promise containing list of log transports
Inherited from
Section titled “Inherited from”MastraClient.listLogTransports
listMemoryThreads()
Section titled “listMemoryThreads()”listMemoryThreads(
params?):Promise<{hasMore:boolean;page:number;perPage:number|false;threads:object[];total:number; }>
Lists memory threads with optional filtering by resourceId and/or metadata
Parameters
Section titled “Parameters”params?
Section titled “params?”ListMemoryThreadsParams
Parameters containing optional filters, pagination options, and request context
Returns
Section titled “Returns”Promise<{ hasMore: boolean; page: number; perPage: number | false; threads: object[]; total: number; }>
Promise containing paginated array of memory threads with metadata
Inherited from
Section titled “Inherited from”MastraClient.listMemoryThreads
listProcessors()
Section titled “listProcessors()”listProcessors(
requestContext?):Promise<Record<string, {agentIds:string[];configurations:object[];description?:string;id:string;isWorkflow:boolean;name?:string;phases: ("input"|"inputStep"|"outputStream"|"outputResult"|"outputStep"|"toolResult")[]; }>>
Retrieves all available processors
Parameters
Section titled “Parameters”requestContext?
Section titled “requestContext?”RequestContext<unknown> | Record<string, any>
Optional request context to pass as query parameter
Returns
Section titled “Returns”Promise<Record<string, { agentIds: string[]; configurations: object[]; description?: string; id: string; isWorkflow: boolean; name?: string; phases: ("input" | "inputStep" | "outputStream" | "outputResult" | "outputStep" | "toolResult")[]; }>>
Promise containing map of processor IDs to processor details
Inherited from
Section titled “Inherited from”MastraClient.listProcessors
listSchedules()
Section titled “listSchedules()”listSchedules(
params?):Promise<{schedules: ({agentId:string;attributes?: {[key:string]:string|number|boolean|null|undefined; };createdAt:number;cron:string;id:string;ifActive?: {attributes?: {[key:string]:string|number|boolean|null|undefined; };behavior?:"deliver"|"persist"|"discard"; };ifIdle?: {attributes?: {[key:string]:string|number|boolean|null|undefined; };behavior?:"persist"|"discard"|"wake";streamOptions?: {requestContext?: {[key: …]: …; }; }; };lastFireAt?:number;lastRun?:undefined;lastRunId?:string;metadata?: {[key:string]:unknown; };name?:string;nextFireAt:number;prompt:string;providerOptions?: {[key:string]:unknown; };resourceId?:string;signalType?:"state"|"user"|"reactive"|"notification"|"user-message"|"system-reminder";status:"active"|"paused";tagName?:string;threadId?:string;timezone?:string;updatedAt:number;workflowId?:undefined; } | {agentId?:undefined;createdAt:number;cron:string;id:string;initialState?:unknown;inputData?:unknown;lastFireAt?:number;lastRun?: {completedAt?:number;durationMs?:number;error?:string;startedAt?:number;status:"success"|"suspended"|"running"|"pending"|"failed"|"paused"|"tripwire"|"waiting"|"canceled"|"bailed"|"skipped"; };lastRunId?:string;metadata?: {[key:string]:unknown; };nextFireAt:number;requestContext?: {[key:string]:unknown; };resourceId?:string;status:"active"|"paused";timezone?:string;updatedAt:number;workflowId:string; })[]; }>
Lists schedules — agent schedules and workflow schedules — with optional filtering by agentId, workflowId, or status. Agent schedules can additionally be filtered by threadId, resourceId, or name.
Parameters
Section titled “Parameters”params?
Section titled “params?”agentId?
Section titled “agentId?”string
string
resourceId?
Section titled “resourceId?”string
status?
Section titled “status?”"active" | "paused"
threadId?
Section titled “threadId?”string
workflowId?
Section titled “workflowId?”string
Returns
Section titled “Returns”Promise<{ schedules: ({ agentId: string; attributes?: {[key: string]: string | number | boolean | null | undefined; }; createdAt: number; cron: string; id: string; ifActive?: { attributes?: {[key: string]: string | number | boolean | null | undefined; }; behavior?: "deliver" | "persist" | "discard"; }; ifIdle?: { attributes?: {[key: string]: string | number | boolean | null | undefined; }; behavior?: "persist" | "discard" | "wake"; streamOptions?: { requestContext?: {[key: …]: …; }; }; }; lastFireAt?: number; lastRun?: undefined; lastRunId?: string; metadata?: {[key: string]: unknown; }; name?: string; nextFireAt: number; prompt: string; providerOptions?: {[key: string]: unknown; }; resourceId?: string; signalType?: "state" | "user" | "reactive" | "notification" | "user-message" | "system-reminder"; status: "active" | "paused"; tagName?: string; threadId?: string; timezone?: string; updatedAt: number; workflowId?: undefined; } | { agentId?: undefined; createdAt: number; cron: string; id: string; initialState?: unknown; inputData?: unknown; lastFireAt?: number; lastRun?: { completedAt?: number; durationMs?: number; error?: string; startedAt?: number; status: "success" | "suspended" | "running" | "pending" | "failed" | "paused" | "tripwire" | "waiting" | "canceled" | "bailed" | "skipped"; }; lastRunId?: string; metadata?: {[key: string]: unknown; }; nextFireAt: number; requestContext?: {[key: string]: unknown; }; resourceId?: string; status: "active" | "paused"; timezone?: string; updatedAt: number; workflowId: string; })[]; }>
Inherited from
Section titled “Inherited from”MastraClient.listSchedules
listScheduleTriggers()
Section titled “listScheduleTriggers()”listScheduleTriggers(
scheduleId,params?):Promise<{triggers:object[]; }>
Lists trigger history for a schedule, ordered by actualFireAt descending.
Parameters
Section titled “Parameters”scheduleId
Section titled “scheduleId”string
params?
Section titled “params?”fromActualFireAt?
Section titled “fromActualFireAt?”number
limit?
Section titled “limit?”number
toActualFireAt?
Section titled “toActualFireAt?”number
Returns
Section titled “Returns”Promise<{ triggers: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.listScheduleTriggers
listScorers()
Section titled “listScorers()”listScorers(
requestContext?):Promise<{[key:string]:object; }>
Retrieves all available scorers
Parameters
Section titled “Parameters”requestContext?
Section titled “requestContext?”RequestContext<unknown> | Record<string, any>
Optional request context to pass as query parameter
Returns
Section titled “Returns”Promise<{[key: string]: object; }>
Promise containing list of available scorers
Inherited from
Section titled “Inherited from”MastraClient.listScorers
listScores()
Section titled “listScores()”listScores(
params?):Promise<{delta?: {hasMore:boolean;limit:number; };deltaCursor?:string;pagination?: {hasMore:boolean;page:number;perPage:number|false;total:number; };scores:object[]; }>
Retrieves a paginated list of observability scores.
Parameters
Section titled “Parameters”params?
Section titled “params?”after?
Section titled “after?”string
filters?
Section titled “filters?”Omit<GetObservabilityScores_QueryParams, "page" | "perPage" | "mode" | "limit" | "after" | "field" | "direction">
limit?
Section titled “limit?”number
Maximum number of updates to return in one delta poll
"page" | "delta"
orderBy?
Section titled “orderBy?”Pick<GetObservabilityScores_QueryParams, "field" | "direction">
pagination?
Section titled “pagination?”Pick<GetObservabilityScores_QueryParams, "page" | "perPage">
Returns
Section titled “Returns”Promise<{ delta?: { hasMore: boolean; limit: number; }; deltaCursor?: string; pagination?: { hasMore: boolean; page: number; perPage: number | false; total: number; }; scores: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.listScores
listScoresByEntityId()
Section titled “listScoresByEntityId()”listScoresByEntityId(
params):Promise<ListScoresResponse>
Retrieves scores by entity ID and type
Parameters
Section titled “Parameters”params
Section titled “params”Parameters containing entity ID, type, and pagination options
entityId
Section titled “entityId”string
Unique identifier for the entity
entityType
Section titled “entityType”string
Type of the entity (AGENT or WORKFLOW)
number
perPage?
Section titled “perPage?”number
Returns
Section titled “Returns”Promise<ListScoresResponse>
Promise containing scores and pagination info
Inherited from
Section titled “Inherited from”MastraClient.listScoresByEntityId
listScoresByRunId()
Section titled “listScoresByRunId()”listScoresByRunId(
params):Promise<ListScoresResponse>
Retrieves scores by run ID
Parameters
Section titled “Parameters”params
Section titled “params”Parameters containing run ID and pagination options
number
perPage?
Section titled “perPage?”number
string
Unique identifier for the run
Returns
Section titled “Returns”Promise<ListScoresResponse>
Promise containing scores and pagination info
Inherited from
Section titled “Inherited from”MastraClient.listScoresByRunId
listScoresByScorerId()
Section titled “listScoresByScorerId()”listScoresByScorerId(
params):Promise<ListScoresResponse>
Parameters
Section titled “Parameters”params
Section titled “params”entityId?
Section titled “entityId?”string
entityType?
Section titled “entityType?”string
number
perPage?
Section titled “perPage?”number
scorerId
Section titled “scorerId”string
Unique identifier for the scorer
Returns
Section titled “Returns”Promise<ListScoresResponse>
Inherited from
Section titled “Inherited from”MastraClient.listScoresByScorerId
listScoresBySpan()
Section titled “listScoresBySpan()”listScoresBySpan(
params):Promise<{pagination: {hasMore:boolean;page:number;perPage:number|false;total:number; };scores:object[]; }>
Parameters
Section titled “Parameters”params
Section titled “params”ListScoresBySpanParams
Returns
Section titled “Returns”Promise<{ pagination: { hasMore: boolean; page: number; perPage: number | false; total: number; }; scores: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.listScoresBySpan
listStoredAgents()
Section titled “listStoredAgents()”listStoredAgents(
params?):Promise<{agents:object[];hasMore:boolean;page:number;perPage:number|false;total:number; }>
Lists all stored agents with optional pagination
Parameters
Section titled “Parameters”params?
Section titled “params?”Optional pagination and ordering parameters
authorId?
Section titled “authorId?”string
Filter agents by author identifier
favoritedOnly?
Section titled “favoritedOnly?”string
When true, return only agents favorited by the caller (requires the favorites EE feature)
metadata?
Section titled “metadata?”{[key: string]: unknown; }
Filter agents by metadata key-value pairs
orderBy?
Section titled “orderBy?”{ direction?: "ASC" | "DESC"; field?: "createdAt" | "updatedAt"; }
orderBy.direction?
Section titled “orderBy.direction?”"ASC" | "DESC"
orderBy.field?
Section titled “orderBy.field?”"createdAt" | "updatedAt"
number
perPage?
Section titled “perPage?”number
pinFavoritedFor?
Section titled “pinFavoritedFor?”string
When set, treat the given subject (user/role) as the favoriting principal for favoritedOnly instead of the caller
status?
Section titled “status?”"draft" | "published" | "archived"
Filter agents by status (defaults to published)
visibility?
Section titled “visibility?”"public"
Filter to only public agents
Returns
Section titled “Returns”Promise<{ agents: object[]; hasMore: boolean; page: number; perPage: number | false; total: number; }>
Promise containing paginated list of stored agents
Inherited from
Section titled “Inherited from”MastraClient.listStoredAgents
listStoredMCPClients()
Section titled “listStoredMCPClients()”listStoredMCPClients(
params?):Promise<{hasMore:boolean;mcpClients:object[];page:number;perPage:number|false;total:number; }>
Lists all stored MCP clients with optional pagination
Parameters
Section titled “Parameters”params?
Section titled “params?”Optional pagination and ordering parameters
authorId?
Section titled “authorId?”string
Filter MCP clients by author identifier
metadata?
Section titled “metadata?”{[key: string]: unknown; }
Filter MCP clients by metadata key-value pairs
orderBy?
Section titled “orderBy?”{ direction?: "ASC" | "DESC"; field?: "createdAt" | "updatedAt"; }
orderBy.direction?
Section titled “orderBy.direction?”"ASC" | "DESC"
orderBy.field?
Section titled “orderBy.field?”"createdAt" | "updatedAt"
number
perPage?
Section titled “perPage?”number
status?
Section titled “status?”"draft" | "published" | "archived"
Filter MCP clients by status (defaults to published)
Returns
Section titled “Returns”Promise<{ hasMore: boolean; mcpClients: object[]; page: number; perPage: number | false; total: number; }>
Promise containing paginated list of stored MCP clients
Inherited from
Section titled “Inherited from”MastraClient.listStoredMCPClients
listStoredPromptBlocks()
Section titled “listStoredPromptBlocks()”listStoredPromptBlocks(
params?):Promise<{hasMore:boolean;page:number;perPage:number|false;promptBlocks:object[];total:number; }>
Lists all stored prompt blocks with optional pagination
Parameters
Section titled “Parameters”params?
Section titled “params?”Optional pagination and ordering parameters
authorId?
Section titled “authorId?”string
Filter prompt blocks by author identifier
metadata?
Section titled “metadata?”{[key: string]: unknown; }
Filter prompt blocks by metadata key-value pairs
orderBy?
Section titled “orderBy?”{ direction?: "ASC" | "DESC"; field?: "createdAt" | "updatedAt"; }
orderBy.direction?
Section titled “orderBy.direction?”"ASC" | "DESC"
orderBy.field?
Section titled “orderBy.field?”"createdAt" | "updatedAt"
number
perPage?
Section titled “perPage?”number
status?
Section titled “status?”"draft" | "published" | "archived"
Filter prompt blocks by status. When omitted, returns all prompt blocks regardless of status
Returns
Section titled “Returns”Promise<{ hasMore: boolean; page: number; perPage: number | false; promptBlocks: object[]; total: number; }>
Promise containing paginated list of stored prompt blocks
Inherited from
Section titled “Inherited from”MastraClient.listStoredPromptBlocks
listStoredScorers()
Section titled “listStoredScorers()”listStoredScorers(
params?):Promise<{hasMore:boolean;page:number;perPage:number|false;scorerDefinitions:object[];total:number; }>
Lists all stored scorer definitions with optional pagination
Parameters
Section titled “Parameters”params?
Section titled “params?”Optional pagination and ordering parameters
authorId?
Section titled “authorId?”string
Filter scorers by author identifier
metadata?
Section titled “metadata?”{[key: string]: unknown; }
Filter scorers by metadata key-value pairs
orderBy?
Section titled “orderBy?”{ direction?: "ASC" | "DESC"; field?: "createdAt" | "updatedAt"; }
orderBy.direction?
Section titled “orderBy.direction?”"ASC" | "DESC"
orderBy.field?
Section titled “orderBy.field?”"createdAt" | "updatedAt"
number
perPage?
Section titled “perPage?”number
status?
Section titled “status?”"draft" | "published" | "archived"
Filter scorers by status (defaults to published)
Returns
Section titled “Returns”Promise<{ hasMore: boolean; page: number; perPage: number | false; scorerDefinitions: object[]; total: number; }>
Promise containing paginated list of stored scorer definitions
Inherited from
Section titled “Inherited from”MastraClient.listStoredScorers
listStoredSkills()
Section titled “listStoredSkills()”listStoredSkills(
params?):Promise<{hasMore:boolean;page:number;perPage:number|false;skills:object[];total:number; }>
Lists all stored skills with optional pagination
Parameters
Section titled “Parameters”params?
Section titled “params?”Optional pagination and ordering parameters
authorId?
Section titled “authorId?”string
Filter skills by author identifier
favoritedOnly?
Section titled “favoritedOnly?”string
When true, return only skills favorited by the caller (requires the favorites EE feature)
metadata?
Section titled “metadata?”{[key: string]: unknown; }
Filter skills by metadata key-value pairs
orderBy?
Section titled “orderBy?”{ direction?: "ASC" | "DESC"; field?: "createdAt" | "updatedAt"; }
orderBy.direction?
Section titled “orderBy.direction?”"ASC" | "DESC"
orderBy.field?
Section titled “orderBy.field?”"createdAt" | "updatedAt"
number
perPage?
Section titled “perPage?”number
pinFavoritedFor?
Section titled “pinFavoritedFor?”string
When set, treat the given subject (user/role) as the favoriting principal for favoritedOnly instead of the caller
status?
Section titled “status?”"draft" | "published" | "archived"
Filter skills by status
visibility?
Section titled “visibility?”"public"
Filter to only public skills
Returns
Section titled “Returns”Promise<{ hasMore: boolean; page: number; perPage: number | false; skills: object[]; total: number; }>
Promise containing paginated list of stored skills
Inherited from
Section titled “Inherited from”MastraClient.listStoredSkills
listStoredWorkspaces()
Section titled “listStoredWorkspaces()”listStoredWorkspaces(
params?):Promise<{hasMore:boolean;page:number;perPage:number|false;total:number;workspaces:object[]; }>
Lists stored workspace configurations from the database
Parameters
Section titled “Parameters”params?
Section titled “params?”Optional filter and pagination parameters
authorId?
Section titled “authorId?”string
Filter workspaces by author identifier
metadata?
Section titled “metadata?”{[key: string]: unknown; }
Filter workspaces by metadata key-value pairs
orderBy?
Section titled “orderBy?”{ direction?: "ASC" | "DESC"; field?: "createdAt" | "updatedAt"; }
orderBy.direction?
Section titled “orderBy.direction?”"ASC" | "DESC"
orderBy.field?
Section titled “orderBy.field?”"createdAt" | "updatedAt"
number
perPage?
Section titled “perPage?”number
Returns
Section titled “Returns”Promise<{ hasMore: boolean; page: number; perPage: number | false; total: number; workspaces: object[]; }>
Promise containing paginated list of stored workspaces
Inherited from
Section titled “Inherited from”MastraClient.listStoredWorkspaces
listThreadMessages()
Section titled “listThreadMessages()”listThreadMessages(
threadId,opts?):Promise<ListMemoryThreadMessagesResponse>
Lists messages for a thread.
Parameters
Section titled “Parameters”threadId
Section titled “threadId”string
ID of the thread
ListMemoryThreadMessagesParams
Optional parameters including agentId, networkId, and requestContext
- When agentId is provided, uses the agent’s memory
- When networkId is provided, uses the network endpoint
- When neither is provided, uses storage directly
Returns
Section titled “Returns”Promise<ListMemoryThreadMessagesResponse>
Promise containing the thread messages
Inherited from
Section titled “Inherited from”MastraClient.listThreadMessages
listToolProviders()
Section titled “listToolProviders()”listToolProviders():
Promise<{providers:object[]; }>
Lists all registered tool providers
Returns
Section titled “Returns”Promise<{ providers: object[]; }>
Promise containing list of tool provider info
Inherited from
Section titled “Inherited from”MastraClient.listToolProviders
listTools()
Section titled “listTools()”listTools(
requestContext?):Promise<Record<string, {description?:string;id:string;inputSchema?:string;outputSchema?:string;requestContextSchema?:string;requireApproval?:boolean;title?:string; }>>
Retrieves all available tools
Parameters
Section titled “Parameters”requestContext?
Section titled “requestContext?”RequestContext<unknown> | Record<string, any>
Optional request context to pass as query parameter
Returns
Section titled “Returns”Promise<Record<string, { description?: string; id: string; inputSchema?: string; outputSchema?: string; requestContextSchema?: string; requireApproval?: boolean; title?: string; }>>
Promise containing map of tool IDs to tool details
Inherited from
Section titled “Inherited from”MastraClient.listTools
listTraces()
Section titled “listTraces()”listTraces(
params?):Promise<{delta?: {hasMore:boolean;limit:number; };deltaCursor?:string;pagination?: {hasMore:boolean;page:number;perPage:number|false;total:number; };spans:object[]; }>
Retrieves paginated list of traces with optional filtering and sorting. This is the new API with improved filtering options.
Parameters
Section titled “Parameters”params?
Section titled “params?”Parameters for pagination, filtering, and ordering
after?
Section titled “after?”string
filters?
Section titled “filters?”Omit<GetObservabilityTraces_QueryParams, "page" | "perPage" | "mode" | "limit" | "after" | "field" | "direction">
limit?
Section titled “limit?”number
Maximum number of updates to return in one delta poll
"page" | "delta"
orderBy?
Section titled “orderBy?”Pick<GetObservabilityTraces_QueryParams, "field" | "direction">
pagination?
Section titled “pagination?”Pick<GetObservabilityTraces_QueryParams, "page" | "perPage">
Returns
Section titled “Returns”Promise<{ delta?: { hasMore: boolean; limit: number; }; deltaCursor?: string; pagination?: { hasMore: boolean; page: number; perPage: number | false; total: number; }; spans: object[]; }>
Promise containing paginated traces and pagination info
Inherited from
Section titled “Inherited from”MastraClient.listTraces
listTracesLight()
Section titled “listTracesLight()”listTracesLight(
params?):Promise<{delta?: {hasMore:boolean;limit:number; };deltaCursor?:string;pagination?: {hasMore:boolean;page:number;perPage:number|false;total:number; };spans:object[]; }>
Retrieves paginated list of traces carrying only the fields a trace list renders.
Same contract as listTraces, but rows omit the attributes/input/output
blobs and carry a short inputPreview instead.
Parameters
Section titled “Parameters”params?
Section titled “params?”Parameters for pagination, filtering, and ordering
after?
Section titled “after?”string
filters?
Section titled “filters?”Omit<GetObservabilityTraces_QueryParams, "page" | "perPage" | "mode" | "limit" | "after" | "field" | "direction">
limit?
Section titled “limit?”number
Maximum number of updates to return in one delta poll
"page" | "delta"
orderBy?
Section titled “orderBy?”Pick<GetObservabilityTraces_QueryParams, "field" | "direction">
pagination?
Section titled “pagination?”Pick<GetObservabilityTraces_QueryParams, "page" | "perPage">
Returns
Section titled “Returns”Promise<{ delta?: { hasMore: boolean; limit: number; }; deltaCursor?: string; pagination?: { hasMore: boolean; page: number; perPage: number | false; total: number; }; spans: object[]; }>
Promise containing paginated lightweight traces and pagination info
Inherited from
Section titled “Inherited from”MastraClient.listTracesLight
listVectors()
Section titled “listVectors()”listVectors():
Promise<{vectors:object[]; }>
Lists all available vector stores
Returns
Section titled “Returns”Promise<{ vectors: object[]; }>
Promise containing list of available vector stores
Inherited from
Section titled “Inherited from”MastraClient.listVectors
listWorkflowRunCounts()
Section titled “listWorkflowRunCounts()”listWorkflowRunCounts(
requestContext?):Promise<{[key:string]:object; }>
Retrieves per-workflow counts of running and suspended (awaiting resume) runs
Parameters
Section titled “Parameters”requestContext?
Section titled “requestContext?”RequestContext<unknown> | Record<string, any>
Optional request context to pass as query parameter
Returns
Section titled “Returns”Promise<{[key: string]: object; }>
Promise containing map of workflow IDs to run counts
Inherited from
Section titled “Inherited from”MastraClient.listWorkflowRunCounts
listWorkflows()
Section titled “listWorkflows()”listWorkflows(
requestContext?,partial?):Promise<Record<string,GetWorkflowResponse>>
Retrieves all available workflows
Parameters
Section titled “Parameters”requestContext?
Section titled “requestContext?”RequestContext<unknown> | Record<string, any>
Optional request context to pass as query parameter
partial?
Section titled “partial?”boolean
Returns
Section titled “Returns”Promise<Record<string, GetWorkflowResponse>>
Promise containing map of workflow IDs to workflow details
Inherited from
Section titled “Inherited from”MastraClient.listWorkflows
listWorkspaces()
Section titled “listWorkspaces()”listWorkspaces():
Promise<{workspaces:object[]; }>
Lists all workspaces from both Mastra instance and agents
Returns
Section titled “Returns”Promise<{ workspaces: object[]; }>
Promise containing array of workspace items
Inherited from
Section titled “Inherited from”MastraClient.listWorkspaces
mlflowExperiment()
Section titled “mlflowExperiment()”mlflowExperiment(
signal?):Promise<{url:string|null; }>
Resolve the configured MLflow experiment for the active viewer.
The server returns a URL only when that viewer has effective
CAN_MANAGE; inability to determine access resolves to null.
Parameters
Section titled “Parameters”signal?
Section titled “signal?”AbortSignal
Returns
Section titled “Returns”Promise<{ url: string | null; }>
models()
Section titled “models()”models(
signal?):Promise<object[]>
Fetch the cached Model Serving endpoint catalogue from
GET ${basePath}/models. Returns every endpoint the plugin
publishes (server-cached for ~5 minutes); callers filter to
chat-capable models for a picker.
Parameters
Section titled “Parameters”signal?
Section titled “signal?”AbortSignal
Returns
Section titled “Returns”Promise<object[]>
observeAgentStream()
Section titled “observeAgentStream()”observeAgentStream(
params):Promise<MastraStreamResponse>
Reconnect to the cached event stream for one background agent run.
Parameters
Section titled “Parameters”params
Section titled “params”agentId
Section titled “agentId”string
model?
Section titled “model?”string
string
signal?
Section titled “signal?”AbortSignal
threadId?
Section titled “threadId?”string
Returns
Section titled “Returns”Promise<MastraStreamResponse>
pauseSchedule()
Section titled “pauseSchedule()”pauseSchedule(
scheduleId):Promise<ScheduleResponse>
Pauses a schedule. The scheduler tick loop will skip paused schedules. Idempotent — pausing an already-paused schedule returns the current state unchanged. Pause status survives redeploys.
Parameters
Section titled “Parameters”scheduleId
Section titled “scheduleId”string
Returns
Section titled “Returns”Promise<ScheduleResponse>
Inherited from
Section titled “Inherited from”MastraClient.pauseSchedule
purgeDatasetItem()
Section titled “purgeDatasetItem()”purgeDatasetItem(
datasetId,itemId,tenancy?):Promise<{success:boolean; }>
Permanently scrubs a dataset item’s data from all versions and linked experiment results
Parameters
Section titled “Parameters”datasetId
Section titled “datasetId”string
itemId
Section titled “itemId”string
tenancy?
Section titled “tenancy?”GetDatasetsDatasetId_QueryParams
Returns
Section titled “Returns”Promise<{ success: boolean; }>
Inherited from
Section titled “Inherited from”MastraClient.purgeDatasetItem
queryTraces()
Section titled “queryTraces()”Call Signature
Section titled “Call Signature”queryTraces(
params):Promise<{groups:object[];page: {next:string|null; }; }>
Queries completed logical traces using recursive trace and related-record predicates.
Grouped results remain supported but are deprecated. Use queryTraceThreads() to retrieve thread identities.
Parameters
Section titled “Parameters”params
Section titled “params”QueryTracesGroupedInput
Returns
Section titled “Returns”Promise<{ groups: object[]; page: { next: string | null; }; }>
Inherited from
Section titled “Inherited from”MastraClient.queryTraces
Call Signature
Section titled “Call Signature”queryTraces(
params):Promise<{delta: {hasMore:boolean;limit:number; };deltaCursor:string;traces:object[]; }>
Queries completed logical traces using recursive trace and related-record predicates.
Grouped results remain supported but are deprecated. Use queryTraceThreads() to retrieve thread identities.
Parameters
Section titled “Parameters”params
Section titled “params”QueryTracesDeltaInput
Returns
Section titled “Returns”Promise<{ delta: { hasMore: boolean; limit: number; }; deltaCursor: string; traces: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.queryTraces
Call Signature
Section titled “Call Signature”queryTraces(
params):Promise<{deltaCursor?:string;pagination: {hasMore:boolean;page:number;perPage:number|false;total:number; };traces:object[]; }>
Queries completed logical traces using recursive trace and related-record predicates.
Grouped results remain supported but are deprecated. Use queryTraceThreads() to retrieve thread identities.
Parameters
Section titled “Parameters”params
Section titled “params”QueryTracesPaginatedInput
Returns
Section titled “Returns”Promise<{ deltaCursor?: string; pagination: { hasMore: boolean; page: number; perPage: number | false; total: number; }; traces: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.queryTraces
Call Signature
Section titled “Call Signature”queryTraces(
params):Promise<{page: {next:string|null; };traces:object[]; }>
Queries completed logical traces using recursive trace and related-record predicates.
Grouped results remain supported but are deprecated. Use queryTraceThreads() to retrieve thread identities.
Parameters
Section titled “Parameters”params
Section titled “params”QueryTracesKeysetInput
Returns
Section titled “Returns”Promise<{ page: { next: string | null; }; traces: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.queryTraces
Call Signature
Section titled “Call Signature”queryTraces(
params):Promise<TraceQueryResponse>
Queries completed logical traces using recursive trace and related-record predicates.
Grouped results remain supported but are deprecated. Use queryTraceThreads() to retrieve thread identities.
Parameters
Section titled “Parameters”params
Section titled “params”QueryTracesInput
Returns
Section titled “Returns”Promise<TraceQueryResponse>
Inherited from
Section titled “Inherited from”MastraClient.queryTraces
queryTraceThreads()
Section titled “queryTraceThreads()”queryTraceThreads(
params):Promise<{page: {next:string|null; };threads:object[]; }>
Queries thread identities using eligible-trace and cross-trace predicates.
Parameters
Section titled “Parameters”params
Section titled “params”{ after?: string | null; limit?: number; }
page.after?
Section titled “page.after?”string | null
page.limit?
Section titled “page.limit?”number
traces
Section titled “traces”{ timeRange: { from: string; to: string; }; where?: unknown; }
traces.timeRange
Section titled “traces.timeRange”{ from: string; to: string; }
traces.timeRange.from
Section titled “traces.timeRange.from”string
traces.timeRange.to
Section titled “traces.timeRange.to”string
traces.where?
Section titled “traces.where?”unknown
where?
Section titled “where?”unknown
Returns
Section titled “Returns”Promise<{ page: { next: string | null; }; threads: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.queryTraceThreads
readMcpServerResource()
Section titled “readMcpServerResource()”readMcpServerResource(
serverId,uri):Promise<PostMcpServerIdResourcesRead_Response>
Reads the content of a resource from an MCP server. Used for fetching ui:// MCP App HTML content.
Parameters
Section titled “Parameters”serverId
Section titled “serverId”string
The ID of the MCP server.
string
The resource URI to read.
Returns
Section titled “Returns”Promise<PostMcpServerIdResourcesRead_Response>
Promise containing the resource content.
Inherited from
Section titled “Inherited from”MastraClient.readMcpServerResource
removeThread()
Section titled “removeThread()”removeThread(
threadId,options?):Promise<void>
Delete one native memory thread owned by the active resource.
Parameters
Section titled “Parameters”threadId
Section titled “threadId”string
options?
Section titled “options?”agentId?
Section titled “agentId?”string
signal?
Section titled “signal?”AbortSignal
Returns
Section titled “Returns”Promise<void>
renameThread()
Section titled “renameThread()”renameThread(
threadId,title,options?):Promise<void>
Rename one native memory thread owned by the active resource.
Parameters
Section titled “Parameters”threadId
Section titled “threadId”string
string
options?
Section titled “options?”agentId?
Section titled “agentId?”string
signal?
Section titled “signal?”AbortSignal
Returns
Section titled “Returns”Promise<void>
request()
Section titled “request()”request<
T>(path,options?):Promise<T>
Makes an HTTP request to the API with retries and exponential backoff
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”string
The API endpoint path (without prefix, e.g., ‘/agents’)
options?
Section titled “options?”RequestOptions
Optional request configuration
Returns
Section titled “Returns”Promise<T>
Promise containing the response data
Inherited from
Section titled “Inherited from”MastraClient.request
resumeSchedule()
Section titled “resumeSchedule()”resumeSchedule(
scheduleId):Promise<ScheduleResponse>
Resumes a paused schedule. Recomputes nextFireAt from ‘now’ so a long-paused schedule does not fire a backlog. Idempotent — resuming an already-active schedule returns the current state unchanged.
Parameters
Section titled “Parameters”scheduleId
Section titled “scheduleId”string
Returns
Section titled “Returns”Promise<ScheduleResponse>
Inherited from
Section titled “Inherited from”MastraClient.resumeSchedule
runExperimentItem()
Section titled “runExperimentItem()”runExperimentItem(
params):Promise<{result: {attempt?:number;comment?:string|null;completedAt:string;createdAt:string;error: {code?:string;message:string;stack?:string; } |null;expectedTrajectory?:unknown;experimentId:string;groundTruth:unknown;id:string;input:unknown;itemDatasetVersion:number|null;itemId:string;metadata?: {[key:string]:unknown; } |null;output:unknown;retryCount:number;startedAt:string;status?:"needs-review"|"reviewed"|"complete"|null;tags?:string[] |null;toolMockReport?: {failure?: {args:unknown;code:"TOOL_MOCK_MISMATCH"|"TOOL_MOCK_EXHAUSTED"|"TOOL_MOCK_NOT_DECLARED";toolName:string; };liveCalls:object[];served:object[];unconsumed:object[]; } |null;traceId:string|null; };scores:object[]; }>
Executes the experiment’s target against one dataset item server-side, runs the resolved scorers, and upserts the result row keyed by (experimentId, itemId, attempt) — safe to retry.
Parameters
Section titled “Parameters”params
Section titled “params”RunExperimentItemParams
Returns
Section titled “Returns”Promise<{ result: { attempt?: number; comment?: string | null; completedAt: string; createdAt: string; error: { code?: string; message: string; stack?: string; } | null; expectedTrajectory?: unknown; experimentId: string; groundTruth: unknown; id: string; input: unknown; itemDatasetVersion: number | null; itemId: string; metadata?: {[key: string]: unknown; } | null; output: unknown; retryCount: number; startedAt: string; status?: "needs-review" | "reviewed" | "complete" | null; tags?: string[] | null; toolMockReport?: { failure?: { args: unknown; code: "TOOL_MOCK_MISMATCH" | "TOOL_MOCK_EXHAUSTED" | "TOOL_MOCK_NOT_DECLARED"; toolName: string; }; liveCalls: object[]; served: object[]; unconsumed: object[]; } | null; traceId: string | null; }; scores: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.runExperimentItem
runSchedule()
Section titled “runSchedule()”runSchedule(
scheduleId):Promise<{claimId:string;scheduledFireAt:number;scheduleId:string; }>
Fires a schedule manually, out-of-band from the cron schedule. Behaves
like a scheduled fire but does not advance nextFireAt. The returned
claimId is the trigger row’s runId — look it up via
listScheduleTriggers(scheduleId).
Parameters
Section titled “Parameters”scheduleId
Section titled “scheduleId”string
Returns
Section titled “Returns”Promise<{ claimId: string; scheduledFireAt: number; scheduleId: string; }>
Inherited from
Section titled “Inherited from”MastraClient.runSchedule
saveMessageToMemory()
Section titled “saveMessageToMemory()”saveMessageToMemory(
params):Promise<SaveMessageToMemoryResponse>
Saves messages to memory
Parameters
Section titled “Parameters”params
Section titled “params”SaveMessageToMemoryParams
Parameters containing messages to save and optional request context
Returns
Section titled “Returns”Promise<SaveMessageToMemoryResponse>
Promise containing the saved messages
Inherited from
Section titled “Inherited from”MastraClient.saveMessageToMemory
saveScore()
Section titled “saveScore()”saveScore(
params):Promise<SaveScoreResponse>
Saves a score
Parameters
Section titled “Parameters”params
Section titled “params”SaveScoreParams
Parameters containing the score data to save
Returns
Section titled “Returns”Promise<SaveScoreResponse>
Promise containing the saved score
Inherited from
Section titled “Inherited from”MastraClient.saveScore
score()
Section titled “score()”score(
params):Promise<{message:string;status:string;traceCount:number; }>
Scores one or more traces using a specified scorer (fire-and-forget).
Parameters
Section titled “Parameters”params
Section titled “params”PostObservabilityTracesScore_Body
Returns
Section titled “Returns”Promise<{ message: string; status: string; traceCount: number; }>
Inherited from
Section titled “Inherited from”MastraClient.score
searchBuilderRegistry()
Section titled “searchBuilderRegistry()”searchBuilderRegistry(
registryId,params):Promise<{count:number;query:string;searchType:string;skills:object[]; }>
Search a builder skill registry. The registry must be enabled or the
server returns 404.
Requires stored-skills:read permission.
Parameters
Section titled “Parameters”registryId
Section titled “registryId”string
params
Section titled “params”limit?
Section titled “limit?”number
string
Returns
Section titled “Returns”Promise<{ count: number; query: string; searchType: string; skills: object[]; }>
Inherited from
Section titled “Inherited from”MastraClient.searchBuilderRegistry
searchMemory()
Section titled “searchMemory()”searchMemory(
__namedParameters):Promise<MemorySearchResponse>
Parameters
Section titled “Parameters”__namedParameters
Section titled “__namedParameters”agentId
Section titled “agentId”string
memoryConfig?
Section titled “memoryConfig?”any
requestContext?
Section titled “requestContext?”RequestContext<unknown> | Record<string, any>
resourceId
Section titled “resourceId”string
searchQuery
Section titled “searchQuery”string
threadId?
Section titled “threadId?”string
Returns
Section titled “Returns”Promise<MemorySearchResponse>
Inherited from
Section titled “Inherited from”MastraClient.searchMemory
statement()
Section titled “statement()”statement(
id,signal?):Promise<{columns:string[];rowCount:number;rows:Record<string,unknown>[];truncated:boolean; } |undefined>
Resolve a [data:<id>] marker from
GET ${basePath}/embed/data/:id. Returns the same coerced rows the
get_statement tool produced for the model. A 404 resolves to
undefined.
Parameters
Section titled “Parameters”string
signal?
Section titled “signal?”AbortSignal
Returns
Section titled “Returns”Promise<{ columns: string[]; rowCount: number; rows: Record<string, unknown>[]; truncated: boolean; } | undefined>
streamAgent()
Section titled “streamAgent()”streamAgent(
params):Promise<MastraStreamResponse>
Open a native AI SDK UI stream for one Mastra conversation turn. Routing headers and cancellation remain isolated to this call.
Parameters
Section titled “Parameters”params
Section titled “params”agentId
Section titled “agentId”string
messages
Section titled “messages”UIMessage<unknown, UIDataTypes, UITools>[]
model?
Section titled “model?”string
reasoningEffort?
Section titled “reasoningEffort?”"none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max"
requestContext?
Section titled “requestContext?”string
signal?
Section titled “signal?”AbortSignal
threadId?
Section titled “threadId?”string
Returns
Section titled “Returns”Promise<MastraStreamResponse>
streamBackgroundTasks()
Section titled “streamBackgroundTasks()”streamBackgroundTasks(
params?):Promise<ReadableStream<unknown>>
Opens an SSE stream of background task events (completed/failed). Returns a Response that can be consumed as a ReadableStream.
Parameters
Section titled “Parameters”params?
Section titled “params?”agentId?
Section titled “agentId?”string
resourceId?
Section titled “resourceId?”string
runId?
Section titled “runId?”string
taskId?
Section titled “taskId?”string
threadId?
Section titled “threadId?”string
Returns
Section titled “Returns”Promise<ReadableStream<unknown>>
Inherited from
Section titled “Inherited from”MastraClient.streamBackgroundTasks
submitExperimentResult()
Section titled “submitExperimentResult()”submitExperimentResult(
params):Promise<{attempt?:number;comment?:string|null;completedAt:string;createdAt:string;error: {code?:string;message:string;stack?:string; } |null;expectedTrajectory?:unknown;experimentId:string;groundTruth:unknown;id:string;input:unknown;itemDatasetVersion:number|null;itemId:string;metadata?: {[key:string]:unknown; } |null;output:unknown;retryCount:number;startedAt:string;status?:"needs-review"|"reviewed"|"complete"|null;tags?:string[] |null;toolMockReport?: {failure?: {args:unknown;code:"TOOL_MOCK_MISMATCH"|"TOOL_MOCK_EXHAUSTED"|"TOOL_MOCK_NOT_DECLARED";toolName:string; };liveCalls:object[];served:object[];unconsumed:object[]; } |null;traceId:string|null; }>
Submits (or re-submits) one item result for a target-less (ingestion) experiment. Upsert semantics on (experimentId, itemId, attempt) — safe to retry.
Parameters
Section titled “Parameters”params
Section titled “params”SubmitExperimentResultParams
Returns
Section titled “Returns”Promise<{ attempt?: number; comment?: string | null; completedAt: string; createdAt: string; error: { code?: string; message: string; stack?: string; } | null; expectedTrajectory?: unknown; experimentId: string; groundTruth: unknown; id: string; input: unknown; itemDatasetVersion: number | null; itemId: string; metadata?: {[key: string]: unknown; } | null; output: unknown; retryCount: number; startedAt: string; status?: "needs-review" | "reviewed" | "complete" | null; tags?: string[] | null; toolMockReport?: { failure?: { args: unknown; code: "TOOL_MOCK_MISMATCH" | "TOOL_MOCK_EXHAUSTED" | "TOOL_MOCK_NOT_DECLARED"; toolName: string; }; liveCalls: object[]; served: object[]; unconsumed: object[]; } | null; traceId: string | null; }>
Inherited from
Section titled “Inherited from”MastraClient.submitExperimentResult
suggestions()
Section titled “suggestions()”suggestions(
agentId?,signal?):Promise<string[]>
Fetch the curated starter questions for agentId’s Genie space
from GET ${basePath}/suggestions. Empty when the agent has no
Genie space (or it defines none).
Parameters
Section titled “Parameters”agentId?
Section titled “agentId?”string
signal?
Section titled “signal?”AbortSignal
Returns
Section titled “Returns”Promise<string[]>
suspendedRuns()
Section titled “suspendedRuns()”suspendedRuns(
agentId,threadId,signal?):Promise<{runs:object[];total:number; }>
Discover approval-gated runs persisted for a conversation.
Parameters
Section titled “Parameters”agentId
Section titled “agentId”string
threadId
Section titled “threadId”string
signal?
Section titled “signal?”AbortSignal
Returns
Section titled “Returns”Promise<{ runs: object[]; total: number; }>
threads()
Section titled “threads()”threads(
options?):Promise<{hasMore:boolean;page:number;perPage:number|false;threads:object[];total:number; }>
List the caller’s conversations through Mastra’s native memory API.
Parameters
Section titled “Parameters”options?
Section titled “options?”agentId?
Section titled “agentId?”string
number
perPage?
Section titled “perPage?”number
signal?
Section titled “signal?”AbortSignal
Returns
Section titled “Returns”Promise<{ hasMore: boolean; page: number; perPage: number | false; threads: object[]; total: number; }>
triggerDatasetExperiment()
Section titled “triggerDatasetExperiment()”triggerDatasetExperiment(
params):Promise<{completedAt:string|null;datasetVersion?:number;experimentId:string;failedCount:number;results:object[];startedAt:string|null;status:"running"|"pending"|"completed"|"failed";succeededCount:number;totalItems:number; }>
Triggers a new dataset experiment
Parameters
Section titled “Parameters”params
Section titled “params”TriggerDatasetExperimentParams
Returns
Section titled “Returns”Promise<{ completedAt: string | null; datasetVersion?: number; experimentId: string; failedCount: number; results: object[]; startedAt: string | null; status: "running" | "pending" | "completed" | "failed"; succeededCount: number; totalItems: number; }>
Inherited from
Section titled “Inherited from”MastraClient.triggerDatasetExperiment
updateDataset()
Section titled “updateDataset()”updateDataset(
params):Promise<{createdAt:string;description?:string|null;groundTruthSchema?: {[key:string]:unknown; };id:string;inputSchema?: {[key:string]:unknown; };metadata?: {[key:string]:unknown; } |null;name:string;requestContextSchema?: {[key:string]:unknown; };scorerIds?:string[] |null;tags?:string[] |null;targetIds?:string[] |null;targetType?:string|null;updatedAt:string;version:number; }>
Updates a dataset. Tenancy fields, when provided, scope the existence check on the server side so that a caller can only update datasets that belong to the given tenant.
Parameters
Section titled “Parameters”params
Section titled “params”UpdateDatasetParams
Returns
Section titled “Returns”Promise<{ createdAt: string; description?: string | null; groundTruthSchema?: {[key: string]: unknown; }; id: string; inputSchema?: {[key: string]: unknown; }; metadata?: {[key: string]: unknown; } | null; name: string; requestContextSchema?: {[key: string]: unknown; }; scorerIds?: string[] | null; tags?: string[] | null; targetIds?: string[] | null; targetType?: string | null; updatedAt: string; version: number; }>
Inherited from
Section titled “Inherited from”MastraClient.updateDataset
updateDatasetExperiment()
Section titled “updateDatasetExperiment()”updateDatasetExperiment(
params):Promise<{agentVersion?:string|null;comparisonId?:string|null;completedAt:string|null;createdAt:string;datasetId:string|null;datasetVersion:number|null;description?:string;experimentSetId?:string|null;failedCount:number;id:string;metadata?: {[key:string]:unknown; };name?:string;provenance?: {metadata?: {[key:string]:unknown; };source?:string;sourceId?:string;sourceVersion?:string; } |null;runnerAttestation?: {invocationId:string;runnerId:string;runnerVersion?:string; } |null;scorerIds?:string[] |null;skippedCount:number;startedAt:string|null;status:"running"|"pending"|"completed"|"failed";succeededCount:number;targetId:string|null;targetType:"agent"|"workflow"|"scorer"|"processor"|null;totalItems:number;trialIndex?:number|null;updatedAt:string;variantId?:string|null; }>
Updates a dataset experiment’s name, description or metadata
Parameters
Section titled “Parameters”params
Section titled “params”UpdateDatasetExperimentParams
Returns
Section titled “Returns”Promise<{ agentVersion?: string | null; comparisonId?: string | null; completedAt: string | null; createdAt: string; datasetId: string | null; datasetVersion: number | null; description?: string; experimentSetId?: string | null; failedCount: number; id: string; metadata?: {[key: string]: unknown; }; name?: string; provenance?: { metadata?: {[key: string]: unknown; }; source?: string; sourceId?: string; sourceVersion?: string; } | null; runnerAttestation?: { invocationId: string; runnerId: string; runnerVersion?: string; } | null; scorerIds?: string[] | null; skippedCount: number; startedAt: string | null; status: "running" | "pending" | "completed" | "failed"; succeededCount: number; targetId: string | null; targetType: "agent" | "workflow" | "scorer" | "processor" | null; totalItems: number; trialIndex?: number | null; updatedAt: string; variantId?: string | null; }>
Inherited from
Section titled “Inherited from”MastraClient.updateDatasetExperiment
updateDatasetExperimentResult()
Section titled “updateDatasetExperimentResult()”updateDatasetExperimentResult(
params):Promise<{attempt?:number;comment?:string|null;completedAt:string;createdAt:string;error: {code?:string;message:string;stack?:string; } |null;expectedTrajectory?:unknown;experimentId:string;groundTruth:unknown;id:string;input:unknown;itemDatasetVersion:number|null;itemId:string;metadata?: {[key:string]:unknown; } |null;output:unknown;retryCount:number;startedAt:string;status?:"needs-review"|"reviewed"|"complete"|null;tags?:string[] |null;toolMockReport?: {failure?: {args:unknown;code:"TOOL_MOCK_MISMATCH"|"TOOL_MOCK_EXHAUSTED"|"TOOL_MOCK_NOT_DECLARED";toolName:string; };liveCalls:object[];served:object[];unconsumed:object[]; } |null;traceId:string|null; }>
Updates an experiment result’s status, tags, and/or comment
Parameters
Section titled “Parameters”params
Section titled “params”UpdateExperimentResultParams
Returns
Section titled “Returns”Promise<{ attempt?: number; comment?: string | null; completedAt: string; createdAt: string; error: { code?: string; message: string; stack?: string; } | null; expectedTrajectory?: unknown; experimentId: string; groundTruth: unknown; id: string; input: unknown; itemDatasetVersion: number | null; itemId: string; metadata?: {[key: string]: unknown; } | null; output: unknown; retryCount: number; startedAt: string; status?: "needs-review" | "reviewed" | "complete" | null; tags?: string[] | null; toolMockReport?: { failure?: { args: unknown; code: "TOOL_MOCK_MISMATCH" | "TOOL_MOCK_EXHAUSTED" | "TOOL_MOCK_NOT_DECLARED"; toolName: string; }; liveCalls: object[]; served: object[]; unconsumed: object[]; } | null; traceId: string | null; }>
Inherited from
Section titled “Inherited from”MastraClient.updateDatasetExperimentResult
updateDatasetItem()
Section titled “updateDatasetItem()”updateDatasetItem(
params):Promise<{createdAt:string;datasetId:string;datasetVersion:number;expectedTrajectory?:unknown;externalId?:string|null;groundTruth?:unknown;id:string;input:unknown;metadata?: {[key:string]:unknown; } |null;requestContext?: {[key:string]:unknown; } |null;scorerIds?:string[] |null;source?: {referenceId?:string;type:"csv"|"json"|"trace"|"llm"|"experiment-result"|"candidate-screener"; } |null;toolMocks?:object[] |null;unmockedToolPolicy?:"allow"|"deny"|null;updatedAt:string; }>
Updates a dataset item
Parameters
Section titled “Parameters”params
Section titled “params”UpdateDatasetItemParams
Returns
Section titled “Returns”Promise<{ createdAt: string; datasetId: string; datasetVersion: number; expectedTrajectory?: unknown; externalId?: string | null; groundTruth?: unknown; id: string; input: unknown; metadata?: {[key: string]: unknown; } | null; requestContext?: {[key: string]: unknown; } | null; scorerIds?: string[] | null; source?: { referenceId?: string; type: "csv" | "json" | "trace" | "llm" | "experiment-result" | "candidate-screener"; } | null; toolMocks?: object[] | null; unmockedToolPolicy?: "allow" | "deny" | null; updatedAt: string; }>
Inherited from
Section titled “Inherited from”MastraClient.updateDatasetItem
updateExperimentResult()
Section titled “updateExperimentResult()”updateExperimentResult(
params):Promise<DatasetExperimentResult>
Updates the status, tags, and/or comment on an experiment result
Parameters
Section titled “Parameters”params
Section titled “params”UpdateExperimentResultParams
Returns
Section titled “Returns”Promise<DatasetExperimentResult>
Inherited from
Section titled “Inherited from”MastraClient.updateExperimentResult
updateFeedbackReviewStatus()
Section titled “updateFeedbackReviewStatus()”updateFeedbackReviewStatus(
params):Promise<{comment?:string|null;entityId?:string|null;entityName?:string|null;entityType?:Shared_Type_58|null;entityVersionId?:string|null;environment?:string|null;executionSource?:string|null;experimentId?:string|null;feedbackId?:string|null;feedbackSource?:string|null;feedbackType:string;feedbackUserId?:string|null;metadata?: {[key:string]:unknown; } |null;organizationId?:string|null;parentEntityId?:string|null;parentEntityName?:string|null;parentEntityType?:Shared_Type_58|null;parentEntityVersionId?:string|null;requestId?:string|null;resourceId?:string|null;reviewStatus:"needs-review"|"reviewed";rootEntityId?:string|null;rootEntityName?:string|null;rootEntityType?:Shared_Type_58|null;rootEntityVersionId?:string|null;runId?:string|null;scope?: {[key:string]:unknown; } |null;serviceName?:string|null;sessionId?:string|null;source?:string|null;sourceId?:string|null;spanId?:string|null;tags?:string[] |null;threadId?:string|null;timestamp:string;traceId?:string|null;userId?:string|null;value:string|number; }>
Updates a feedback record’s review workflow status.
Parameters
Section titled “Parameters”params
Section titled “params”UpdateFeedbackReviewStatusArgs
Returns
Section titled “Returns”Promise<{ comment?: string | null; entityId?: string | null; entityName?: string | null; entityType?: Shared_Type_58 | null; entityVersionId?: string | null; environment?: string | null; executionSource?: string | null; experimentId?: string | null; feedbackId?: string | null; feedbackSource?: string | null; feedbackType: string; feedbackUserId?: string | null; metadata?: {[key: string]: unknown; } | null; organizationId?: string | null; parentEntityId?: string | null; parentEntityName?: string | null; parentEntityType?: Shared_Type_58 | null; parentEntityVersionId?: string | null; requestId?: string | null; resourceId?: string | null; reviewStatus: "needs-review" | "reviewed"; rootEntityId?: string | null; rootEntityName?: string | null; rootEntityType?: Shared_Type_58 | null; rootEntityVersionId?: string | null; runId?: string | null; scope?: {[key: string]: unknown; } | null; serviceName?: string | null; sessionId?: string | null; source?: string | null; sourceId?: string | null; spanId?: string | null; tags?: string[] | null; threadId?: string | null; timestamp: string; traceId?: string | null; userId?: string | null; value: string | number; }>
Inherited from
Section titled “Inherited from”MastraClient.updateFeedbackReviewStatus
updateSchedule()
Section titled “updateSchedule()”updateSchedule(
scheduleId,patch):Promise<ScheduleResponse>
Patches an existing schedule. Fields apply to the matching target type;
agent-only fields on a workflow schedule are rejected. threadId /
resourceId are immutable — to retarget, delete and recreate.
Parameters
Section titled “Parameters”scheduleId
Section titled “scheduleId”string
UpdateScheduleInput
Returns
Section titled “Returns”Promise<ScheduleResponse>
Inherited from
Section titled “Inherited from”MastraClient.updateSchedule
updateWorkingMemory()
Section titled “updateWorkingMemory()”updateWorkingMemory(
agentId):Promise<unknown>
Updates the working memory for a specific thread (optionally resource-scoped).
Parameters
Section titled “Parameters”agentId
Section titled “agentId”ID of the agent.
agentId
Section titled “agentId”string
requestContext?
Section titled “requestContext?”RequestContext<unknown> | Record<string, any>
resourceId?
Section titled “resourceId?”string
threadId
Section titled “threadId”string
workingMemory
Section titled “workingMemory”string
Returns
Section titled “Returns”Promise<unknown>
Inherited from
Section titled “Inherited from”MastraClient.updateWorkingMemory
upsertDynamicWorkflow()
Section titled “upsertDynamicWorkflow()”upsertDynamicWorkflow(
params):Promise<{dependencyIds?:string[];id:string;ok:true; }>
Creates or replaces a dynamic workflow definition and live-registers it on the server.
Optional dependencies lets helper workflows referenced by the root definition be
saved in the same request; their ids are echoed back as dependencyIds.
Parameters
Section titled “Parameters”params
Section titled “params”The workflow definition (id, schemas, graph) plus optional helper dependencies
dependencies?
Section titled “dependencies?”object[]
Helper workflow definitions this workflow nests. Saved with it as one unit — the whole set is validated together, hydrated in derived dependency order, and rejected together, so a failed save never leaves orphaned helpers behind. Each helper becomes an ordinary dynamic workflow in its own right.
description?
Section titled “description?”string
({ agentId: string; description?: string; id: string; options?: { metadata?: {[key: string]: unknown; }; retries?: number; }; outputSchema?: {[key: string]: unknown; }; type: "agent"; } | { description?: string; id: string; options?: { metadata?: {[key: string]: unknown; }; retries?: number; }; toolId: string; type: "tool"; } | { description?: string; id: string; mapConfig: string; metadata?: {[key: string]: unknown; }; type: "mapping"; } | { description?: string; id: string; type: "workflow"; workflowId: string; } | { description?: string; id?: string; metadata?: {[key: string]: unknown; }; steps: ({ agentId: string; description?: string; id: string; options?: { metadata?: {[key: …]: …; }; retries?: number; }; outputSchema?: {[key: string]: unknown; }; type: "agent"; } | { description?: string; id: string; options?: { metadata?: {[key: …]: …; }; retries?: number; }; toolId: string; type: "tool"; } | { description?: string; id: string; mapConfig: string; metadata?: {[key: string]: unknown; }; type: "mapping"; } | { description?: string; id: string; type: "workflow"; workflowId: string; })[]; type: "parallel"; } | { description?: string; id?: string; metadata?: {[key: string]: unknown; }; opts?: { concurrency: number; }; step: { agentId: string; description?: string; id: string; options?: { metadata?: {[key: string]: unknown; }; retries?: number; }; outputSchema?: {[key: string]: unknown; }; type: "agent"; } | { description?: string; id: string; options?: { metadata?: {[key: string]: unknown; }; retries?: number; }; toolId: string; type: "tool"; } | { description?: string; id: string; type: "workflow"; workflowId: string; }; type: "foreach"; } | { description?: string; duration: number; id: string; metadata?: {[key: string]: unknown; }; type: "sleep"; } | { date: string; description?: string; id: string; metadata?: {[key: string]: unknown; }; type: "sleepUntil"; } | { description?: string; id?: string; metadata?: {[key: string]: unknown; }; predicates: ({ left: { path: string; } | { literal: string | number | boolean | null; }; op: "eq" | "ne" | "lt" | "lte" | "gt" | "gte"; right: { path: string; } | { literal: string | number | boolean | null; }; } | { op: "in" | "notIn"; set: (string | number | boolean | null)[]; value: { path: string; } | { literal: string | number | boolean | null; }; } | { op: "exists" | "notExists"; path: string; } | { op: "truthy" | "falsy"; value: { path: string; } | { literal: string | number | boolean | null; }; } | { args: ({ op: “eq” | “ne” | “lt” | “lte” | “gt” | “gte”; left: { path: string; } | { literal: string | number | boolean | null; }; right: { path: string; } | { literal: string | number | boolean | null; }; } | … 4 more … | { …; })[]; op: "and" | "or"; } | { arg: { op: “eq” | “ne” | “lt” | “lte” | “gt” | “gte”; left: { path: string; } | { literal: string | number | boolean | null; }; right: { path: string; } | { literal: string | number | boolean | null; }; } | … 4 more … | { …; }; op: "not"; })[]; steps: ({ agentId: string; description?: string; id: string; options?: { metadata?: {[key: …]: …; }; retries?: number; }; outputSchema?: {[key: string]: unknown; }; type: "agent"; } | { description?: string; id: string; options?: { metadata?: {[key: …]: …; }; retries?: number; }; toolId: string; type: "tool"; } | { description?: string; id: string; mapConfig: string; metadata?: {[key: string]: unknown; }; type: "mapping"; } | { description?: string; id: string; type: "workflow"; workflowId: string; })[]; type: "conditional"; } | { description?: string; id?: string; loopType: "dowhile" | "dountil"; metadata?: {[key: string]: unknown; }; predicate: { left: { path: string; } | { literal: string | number | boolean | null; }; op: "eq" | "ne" | "lt" | "lte" | "gt" | "gte"; right: { path: string; } | { literal: string | number | boolean | null; }; } | { op: "in" | "notIn"; set: (string | number | boolean | null)[]; value: { path: string; } | { literal: string | number | boolean | null; }; } | { op: "exists" | "notExists"; path: string; } | { op: "truthy" | "falsy"; value: { path: string; } | { literal: string | number | boolean | null; }; } | { args: { op: “eq” | “ne” | “lt” | “lte” | “gt” | “gte”; left: { path: string; } | { literal: string | number | boolean | null; }; right: { path: string; } | { literal: string | number | boolean | null; }; } | … 4 more … | { …; }[]; op: "and" | "or"; } | { arg: { op: “eq” | “ne” | “lt” | “lte” | “gt” | “gte”; left: { path: string; } | { literal: string | number | boolean | null; }; right: { path: string; } | { literal: string | number | boolean | null; }; } | … 4 more … | { …; }; op: "not"; }; step: { agentId: string; description?: string; id: string; options?: { metadata?: {[key: string]: unknown; }; retries?: number; }; outputSchema?: {[key: string]: unknown; }; type: "agent"; } | { description?: string; id: string; options?: { metadata?: {[key: string]: unknown; }; retries?: number; }; toolId: string; type: "tool"; } | { description?: string; id: string; mapConfig: string; metadata?: {[key: string]: unknown; }; type: "mapping"; } | { description?: string; id: string; type: "workflow"; workflowId: string; }; type: "loop"; })[]
Static workflow graph — ordered array of serialized step entries with all refs as ids.
string
Workflow id — kebab-case, descriptive
inputSchema
Section titled “inputSchema”{[key: string]: unknown; }
JSON Schema (Draft 2020-12) for the workflow input
metadata?
Section titled “metadata?”{[key: string]: unknown; }
outputSchema
Section titled “outputSchema”{[key: string]: unknown; }
JSON Schema (Draft 2020-12) for the workflow output
requestContextSchema?
Section titled “requestContextSchema?”{[key: string]: unknown; }
stateSchema?
Section titled “stateSchema?”{[key: string]: unknown; }
Returns
Section titled “Returns”Promise<{ dependencyIds?: string[]; id: string; ok: true; }>
Promise containing the persisted definition and any dependency ids
Inherited from
Section titled “Inherited from”MastraClient.upsertDynamicWorkflow