Non-TypeScript backends

Use the AI Toolkit with any backend language. The @tiptap-pro/ai-toolkit-tool-definitions package includes a CLI that outputs tool definitions and workflow configurations as JSON, so you can use them in Python, Go, Ruby, or any other language.

Setup

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

Node.js required

The CLI requires Node.js 18 or later. You only need Node.js to run the CLI and generate the JSON files — your backend can use any language.

Generate tool definitions

Run the CLI to generate a tool-definitions.json file with all default tools:

npx @tiptap-pro/ai-toolkit-tool-definitions@latest tool-definitions > tool-definitions.json

The output is a JSON array. Each entry contains:

  • name: unique identifier of the tool
  • description: instructions for the AI model
  • inputSchema: JSON Schema describing the tool's input parameters

Use in your backend

Load the JSON file in your backend and convert the tool definitions to your AI provider's format. For example, in Python with the OpenAI SDK:

import json

with open("tool-definitions.json") as f:
    tool_definitions = json.load(f)

# Convert to OpenAI tool format
tools = [
    {
        "type": "function",
        "function": {
            "name": tool["name"],
            "description": tool["description"],
            "parameters": tool["inputSchema"],
        },
    }
    for tool in tool_definitions
]

Generate workflow configurations

Each workflow command outputs a JSON object with a systemPrompt (and optionally a jsonOutputSchema) that you pass to your AI provider.

Insert content workflow

npx @tiptap-pro/ai-toolkit-tool-definitions@latest insert-content-workflow > insert-content-workflow.json

Output:

  • systemPrompt: instructions for the AI model

Proofreader workflow

npx @tiptap-pro/ai-toolkit-tool-definitions@latest proofreader-workflow > proofreader-workflow.json

Output:

  • systemPrompt: instructions for the AI model
  • jsonOutputSchema: JSON Schema for validating the AI output

Tiptap Edit workflow

npx @tiptap-pro/ai-toolkit-tool-definitions@latest tiptap-edit-workflow > tiptap-edit-workflow.json

Output:

  • systemPrompt: instructions for the AI model
  • jsonOutputSchema: JSON Schema for validating the AI output

Comments workflow

npx @tiptap-pro/ai-toolkit-tool-definitions@latest edit-threads-workflow > edit-threads-workflow.json

Output:

  • systemPrompt: instructions for the AI model
  • jsonOutputSchema: JSON Schema for validating the AI output

Template workflow

The template workflow requires an HTML template as input:

npx @tiptap-pro/ai-toolkit-tool-definitions@latest template-workflow --html-template '<p _templateslot="title">Title</p><p _templateslot="body">Body</p>' > template-workflow.json

Output:

  • systemPrompt: instructions for the AI model (includes the template)
  • jsonOutputSchema: JSON Schema for validating the AI output

Use workflows in your backend

Load the JSON file and pass the system prompt and schema to your AI provider. For example, in Python with the OpenAI SDK:

import json

with open("proofreader-workflow.json") as f:
    workflow = json.load(f)

response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[
        {"role": "system", "content": workflow["systemPrompt"]},
        {"role": "user", "content": json.dumps({
            "content": "<p _hash='abc123'>Document content here</p>",
            "task": "Correct all grammar and spelling mistakes",
        })},
    ],
    response_format={
        "type": "json_schema",
        "json_schema": {
            "name": "proofreader_output",
            "schema": workflow["jsonOutputSchema"],
        },
    },
)

CLI reference

tool-definitions

Generate tool definitions as JSON.

npx @tiptap-pro/ai-toolkit-tool-definitions@latest tool-definitions [options]
OptionDescription
--tools <names...>Space-separated list of tool names to enable. When omitted, the default set is used. Valid names: tiptapRead, tiptapEdit, tiptapReadSelection, getThreads, editThreads.
--operation-meta <description>Description for the meta field in edit operations.

tiptap-edit-workflow

Generate the Tiptap Edit workflow configuration as JSON.

npx @tiptap-pro/ai-toolkit-tool-definitions@latest tiptap-edit-workflow [options]
OptionDescription
--operation-meta <description>Description for the meta field in edit operations.

proofreader-workflow

Generate the Proofreader workflow configuration as JSON.

npx @tiptap-pro/ai-toolkit-tool-definitions@latest proofreader-workflow [options]
OptionDescription
--operation-meta <description>Description for the meta field in operations.

template-workflow

Generate the Template workflow configuration as JSON.

npx @tiptap-pro/ai-toolkit-tool-definitions@latest template-workflow --html-template <html>
OptionDescription
--html-template <html>(Required) The HTML template string.

edit-threads-workflow

Generate the Comments workflow configuration as JSON.

npx @tiptap-pro/ai-toolkit-tool-definitions@latest edit-threads-workflow

No options.

insert-content-workflow

Generate the Insert content workflow configuration as JSON.

npx @tiptap-pro/ai-toolkit-tool-definitions@latest insert-content-workflow

No options.