Tool definitions
The Server AI Toolkit provides a comprehensive set of tools for interacting with Tiptap documents on the server.
When you provide these tools to your AI agent, it will generate tool calls that are executed using the /v3/ai/toolkit/execute-tool endpoint. This allows the AI to read and edit documents.
See the API reference for more information on the endpoints to retrieve and execute tools.
Note
Upcoming releases will include provider-specific tool definitions (for Vercel AI SDK, LangChain.js, OpenAI, Anthropic, etc.). Currently, you need to get the tool definitions from the Server AI Toolkit API in a generic format, and convert them to your provider's format.
tiptapRead
Read part of the document using an efficient format optimized for reading operations.
The tool uses an efficient format for reading large documents.
tiptapEdit
Edit the document using an efficient format optimized for editing operations.
The tool uses an efficient format that allows making precise edits to the document without replacing the entire content, reducing token usage and improving performance.
getThreads
Retrieve all threads and comments in the document. This tool provides comprehensive information about existing discussions and feedback in the document.
Parameters
from(number): The starting index of the thread to read from.
Result
The data of all the threads and comments in the document, including their content and location.
editThreads
Perform operations on threads and comments in the document. This tool enables comprehensive thread and comment management including creating, updating, and deleting threads and comments.
Parameters
operations(array): Array of operations to perform.
Result
A success message if the operations were successful, or an error message if they were not.