Nested Tool Calls
Use flo.callTool(...) to call another runtime tool from your script.
Generic Form
const result = await flo.callTool({
tool_id: "some_tool",
input: { value: 1 },
});
The returned shape is:
statusoutputerror
Possible statuses are:
successfailedtimeoutvalidation_errorsuspended
Typed Built-In Calls
For built-in tools declared in flo.d.ts, TypeScript can infer the input and output shape:
const file = await flo.callTool({
tool_id: "read_text_file",
input: {
path: "task://notes/summary.txt",
max_bytes: 4096,
},
});
Error Handling Pattern
Always branch on status instead of assuming output exists:
const result = await flo.callTool({
tool_id: "read_text_file",
input: { path: "task://notes/summary.txt" },
});
if (result.status !== "success") {
return {
ok: false,
status: result.status,
error: result.error,
};
}
return {
ok: true,
content: result.output?.content,
};
Execution Context
Nested tool calls run in the same runtime tool execution context as the calling script. In practice, this means task- and session-scoped helpers continue to operate on the current task and current virtual workspace.
Good uses:
- reading or writing VFS files through built-in tools
- composing smaller tools into a larger workflow
- delegating format-specific work to a built-in tool
Avoid using nested calls as a substitute for simple local code when a direct script implementation is clearer.
Next: Debug Events