Skip to main content

useNotebookTools

Agent Runtimes


Agent Runtimes / tools/adapters/agent-runtimes/notebookHooks / useNotebookTools

Function: useNotebookTools()

useNotebookTools(documentId, contextOverrides?): FrontendToolDefinition<Record<string, unknown>, unknown>[]

Defined in: tools/adapters/agent-runtimes/notebookHooks.ts:47

Hook that creates agent-runtimes tools for notebook operations. Returns stable tools array that won't cause re-renders.

Parameters

documentId

string

Document ID (notebook identifier)

contextOverrides?

Partial<Omit<ToolExecutionContext, "documentId" | "executor">>

Optional context overrides (format, extras, etc.)

Returns

FrontendToolDefinition<Record<string, unknown>, unknown>[]

Frontend tools array for ChatFloating / Chat

Example

// Default context (toon format for AI)
const frontendTools = useNotebookTools("my-notebook-id");

// Use with ChatFloating
<ChatFloating
endpoint="http://localhost:8765/api/v1/ag-ui/agent/"
frontendTools={frontendTools}
/>