Available tools
The Tiptap AI Toolkit provides a comprehensive set of tools for interacting with Tiptap documents. These tools enable reading content, making edits, and navigating through large documents efficiently.
The tool definitions are available in the format of popular AI provider libraries:
When you add the tool definitions to your AI provider library, your AI agent will generate tool calls. You can then execute the tool calls using the executeTool method.
// Read the document from the beginning
await agent.executeTool({
toolName: 'tiptapRead',
input: {
from: 0,
},
})tiptapRead
Read the document from a given position.
Parameters
from(number): The position to read from.
Result
The content of the document from the given position. We provide customers with more comprehensive information about the format of this tool.
tiptapEdit
Edit the document at a given position.
Parameters
A list of operations to perform on the document. We provide customers with more comprehensive information about the format of this tool.
Result
A success or error message with the result of the edit operations.
tiptapReadSelection
Read the selection of the document.
Parameters
No parameters required.
Result
The content and location of the selection. We provide customers with more comprehensive information about the format of this tool.
getThreads
Retrieve all threads and comments in the document. This tool provides comprehensive information about existing discussions and feedback in the document.
Parameters
No parameters required.
Result
The data of all the threads and comments in the document, including their content and location.
Requirements
This tool requires the Comments extension to be configured in the editor with a CommentsProvider. This tool is deactivated by default and needs to be explicitly enabled.
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.
Requirements
This tool requires the Comments extension to be configured in the editor with a CommentsProvider. This tool is deactivated by default and needs to be explicitly enabled.