Skip to content

Type Alias: ToolResult<T>

Makaio Framework


Makaio Framework / tools-core / ToolResult

ToolResult<T> = ToolSuccess<T> | ToolFailure

Defined in: ../../../tools/core/src/types.ts:134

Discriminated union result type for tool executions. Always returns either success with data or failure with error.

T

Type of the success data

const result: ToolResult<string> = await tool.execute(input, context);
if (result.success) {
console.debug(result.data); // string
} else {
console.error(result.error.message);
}
type ToolResult = {
success: boolean;
};