Function: createTool()
createTool<
TId,TInputSchema,TOutputSchema,TSuspendSchema,TResumeSchema,TRequestContext,TContext>(opts):Tool<InferSchema<TInputSchema>,InferSchema<TOutputSchema>,InferSchema<TSuspendSchema>,InferSchema<TResumeSchema>,TContext,TId,TRequestContext>
Re-export of Mastra’s native createTool for full-feature access.
Type Parameters
Section titled “Type Parameters”TId extends string = string
TInputSchema
Section titled “TInputSchema”TInputSchema extends SchemaLike = undefined
TOutputSchema
Section titled “TOutputSchema”TOutputSchema extends SchemaLike = undefined
TSuspendSchema
Section titled “TSuspendSchema”TSuspendSchema extends SchemaLike = undefined
TResumeSchema
Section titled “TResumeSchema”TResumeSchema extends SchemaLike = undefined
TRequestContext
Section titled “TRequestContext”TRequestContext extends unknown = unknown
TContext
Section titled “TContext”TContext extends ToolExecutionContext<InferSchema<TSuspendSchema>, InferSchema<TResumeSchema>, TRequestContext> = ToolExecutionContext<InferSchema<TSuspendSchema>, InferSchema<TResumeSchema>, TRequestContext>
Parameters
Section titled “Parameters”CreateToolOpts<TId, TInputSchema, TOutputSchema, TSuspendSchema, TResumeSchema, TRequestContext, TContext>
Returns
Section titled “Returns”Tool<InferSchema<TInputSchema>, InferSchema<TOutputSchema>, InferSchema<TSuspendSchema>, InferSchema<TResumeSchema>, TContext, TId, TRequestContext>