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 generic JSON object and convert them to your AI provider's format.

Get tool definitions

Use the toolDefinitions() function from the @tiptap-pro/ai-toolkit-tool-definitions package to get the tool definitions in a generic format:

import { toolDefinitions } from '@tiptap-pro/ai-toolkit-tool-definitions'

const tools = toolDefinitions()

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.

Non-TypeScript backends

If your backend is in another programming language than TypeScript, you can use the CLI to generate a JSON file with the tool definitions. See this guide.

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.