---
title: "Anthropic - AI agent tools"
description: "Use tool definitions for Anthropic to let AI agents read and edit Tiptap documents."
canonical_url: "https://tiptap.dev/docs/content-ai/capabilities/ai-toolkit/agents/tools/anthropic"
---

# Anthropic - AI agent tools

Use tool definitions for Anthropic to let AI agents read and edit Tiptap documents.

The `@tiptap-pro/ai-toolkit-anthropic` package provides tool definitions you can add to your AI agent built with [Anthropic's JavaScript SDK](https://github.com/anthropics/anthropic-sdk-typescript).

The tool calls generated by the model can then be executed in the client-side using the [`executeTool` method](https://tiptap.dev/docs/content-ai/capabilities/ai-toolkit/api-reference/execute-tool.md).

## Example usage

Install the package.

```bash
npm install @tiptap-pro/ai-toolkit-anthropic
```

Supply the tool definitions to your Anthropic model.

```ts
import Anthropic from '@anthropic-ai/sdk'
import { toolDefinitions } from '@tiptap-pro/ai-toolkit-anthropic'

const anthropic = new Anthropic()

const response = await anthropic.messages.create({
  model: 'claude-sonnet-4-5',
  max_tokens: 2048,
  system: 'You are a helpful assistant that can edit rich text documents.',
  messages: [{ role: 'user', content: 'Help me edit this document' }],
  tools: toolDefinitions(),
})
```

Combine the tool definitions with your custom tools.

```ts
import Anthropic from '@anthropic-ai/sdk'
import { toolDefinitions } from '@tiptap-pro/ai-toolkit-anthropic'

const anthropic = new Anthropic()

const customTools = [
  {
    name: 'get_weather',
    description: 'Get the weather in a location',
    input_schema: {
      type: 'object',
      properties: {
        location: {
          type: 'string',
          description: 'The city and state, e.g. San Francisco, CA',
        },
      },
      required: ['location'],
    },
  },
]

const response = await anthropic.messages.create({
  model: 'claude-sonnet-4-5',
  max_tokens: 1024,
  messages: [{ role: 'user', content: 'What is the weather like and help me edit this document' }],
  tools: [...toolDefinitions(), ...customTools],
})
```

## API reference

### `toolDefinitions`

Creates tool definitions for the Tiptap AI Toolkit compatible with [Anthropic's Messages API](https://docs.claude.com/en/docs/get-started#typescript).

#### 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 that can be used with [Anthropic's Messages API](https://docs.claude.com/en/docs/get-started#typescript). To see the full list of tools, see the [Available tools](https://tiptap.dev/docs/content-ai/capabilities/ai-toolkit/agents/tools.md) page.
