Other providers

The Tiptap AI Toolkit provides tool definitions for the most popular AI provider libraries, like the AI SDK by Vercel. If your AI provider is not supported, reach out to the Tiptap team with your request.

Another option is to get all tool definitions as a JSON object and convert them to your AI provider's format. This can be useful if you've built your AI agent in another language (for example, Python) and you want to use the tool definitions from the Tiptap AI Toolkit.

Get tool definitions

First, configure authentication for Tiptap's private npm registry. Follow the private registry guide to set up your .npmrc file with your access token.

Once authenticated, run this shell script in the directory where .npmrc is located:

ORIG_DIR=$(pwd) && cd $(mktemp -d) && cp $ORIG_DIR/.npmrc . && \
  npm init -y && \
  npm install @tiptap-pro/ai-toolkit-tool-definitions && \
  node --input-type=module -e \
    "import {toolDefinitions} from '@tiptap-pro/ai-toolkit-tool-definitions'; \
    console.log(JSON.stringify(toolDefinitions(), null, 2))" \
  > "$ORIG_DIR/tool-definitions.json" && \
  cd $ORIG_DIR

The script creates a tool-definitions.json file with the tool definitions. Each tool definition is an object with the following properties:

  • name: The name of the tool. This is its unique identifier.
  • description: The description of the tool, to be read by the AI model.
  • inputSchema: A JSON schema describing the input parameters of the tool.

Use this data to build the tool definitions in your AI provider's format.

API reference

toolDefinitions

Creates tool definitions for the Tiptap AI Toolkit in a generic format that can be converted to any AI provider's format.

Parameters (ToolDefinitionsOptions)

  • tools?: EnabledTools - Enable/disable specific tools by setting the value to true (enabled) or false (disabled).
    • tiptapRead?: boolean - Enable/disable the tiptapRead tool (default: true)
    • tiptapEdit?: boolean - Enable/disable the tiptapEdit tool (default: true)
    • tiptapReadSelection?: boolean - Enable/disable the tiptapReadSelection tool (default: true)
    • getThreads?: boolean - Enable/disable the getThreads tool (default: false)
    • editThreads?: boolean - Enable/disable the editThreads tool (default: false)

Returns

An array containing the enabled tool definitions in a generic format. Each tool definition is an object with name, description, and inputSchema properties. To see the full list of tools, see the Available tools page.