Quick start
Install the SDK, create a client, open a document, and wire up an agentic loop.- Node.js
- Python
Tool selection
chooseTools() returns provider-formatted tool definitions ready to pass to your LLM.
- Node.js
- Python
Tool catalog
The generated catalog currently contains 9 grouped intent tools. Most tools use anaction argument to select the underlying operation. Single-action tools like superdoc_search do not require action.
| Tool | Actions | What it does |
|---|---|---|
superdoc_get_content | text, markdown, html, info | Read document content in different formats |
superdoc_search | match | Find text or nodes and return handles or addresses for later edits |
superdoc_edit | insert, replace, delete, undo, redo | Perform text edits and history actions |
superdoc_format | inline, set_style, set_alignment, set_indentation, set_spacing | Apply inline or paragraph formatting |
superdoc_create | paragraph, heading | Create structural block elements |
superdoc_list | insert, create, detach, indent, outdent, set_level, set_type | Create and manipulate lists |
superdoc_comment | create, update, delete, get, list | Manage comment threads |
superdoc_track_changes | list, decide | Review and resolve tracked changes |
superdoc_mutations | preview, apply | Execute multi-step atomic edits as a batch |
More tools are being added as we expand coverage — tables, images, hyperlinks, and more. You can also create custom tools for any
doc.* operation today.Dispatching tool calls
dispatchSuperDocTool() resolves a tool name to the correct SDK method, validates arguments, and executes the call against a bound document handle.
- Node.js
- Python (sync)
- Python (async)
System prompt
getSystemPrompt() returns a default prompt that teaches the model the tool workflow: targeting, search-before-edit, and common patterns. It’s optional. You can use it as-is, extend it with your own instructions, or write a completely custom prompt.
Provider formats
Each provider gets tool definitions in its native format.- OpenAI
- Anthropic
- Vercel AI
- Generic
Creating custom tools
The built-in tools cover core editing operations. For advanced features like tables, images, hyperlinks, footnotes, and citations, create custom tools that calldoc.* methods directly.
| Step | What you do |
|---|---|
| 1. Pick operations | Browse doc.* to find the methods you need |
| 2. Define the schema | Write a function tool definition for your provider |
| 3. Write a dispatcher | Map tool actions to doc.* calls |
| 4. Merge and use | Combine with SDK tools in your agentic loop |
Step 1: Pick your operations
Everydoc.* namespace maps to a group of Document API operations:
Step 2: Define the tool schema
Group related operations under a single tool using anaction enum. This matches the pattern the built-in tools use.
- Keep descriptions short. The model reads every tool definition on each turn.
- Use
additionalProperties: falseto prevent hallucinated parameters. - Reference
superdoc_searchin descriptions so the model knows how to get targets.
Step 3: Write a dispatcher
Map each action to the correspondingdoc.* call:
Step 4: Merge and use
Combine your custom tool with the SDK tools and use your dispatcher in the agentic loop:Extending the system prompt
For custom tools, append usage instructions to the SDK system prompt so the model knows how to use them:SDK functions
| Function | Description |
|---|---|
chooseTools(input) | Load grouped tool definitions for a provider |
dispatchSuperDocTool(doc, name, args) | Execute a tool call against a bound document handle |
listTools(provider) | List all tool definitions for a provider |
getToolCatalog() | Load the full tool catalog with metadata |
getSystemPrompt() | Read the bundled system prompt for intent tools |
Related
- How to use — step-by-step integration guide with copy-pasteable code
- Best practices — prompting, workflow tips, and tested prompt examples
- Debugging — troubleshoot tool call failures
- SDKs — typed Node.js and Python wrappers
- Document API — the operation set behind the tools

