Skip to main content
Pass the tools from doconda.tools() as tools in messages.create and run each tool Claude asks for. Claude calls create_document with format: "docx" for a Word file (which comes with its PDF) or format: "pdf" for the PDF alone, and gets back the download links.

Steps

  1. Put your Anthropic key in ANTHROPIC_API_KEY and your Doconda key (dashboard → API keys) in DOCONDA_API_KEY.
  2. Install the dependencies.
  3. Run the tool-use loop: while stop_reason is tool_use, run each tool and hand back the tool_result.
In TypeScript, the Anthropic SDK’s tool runner does the loop for you: the tools from doconda.tools() already have the shape it expects. With the API’s MCP connector (in beta), Claude calls Doconda’s remote server and you run nothing; the code is in the Claude guide.

What you get back

  • With format: "docx", links holds the editable Word file and its PDF; with format: "pdf", only the PDF.
  • status: ready or failed. Failed documents are not charged.
  • Links expire after 5 minutes; Claude gets fresh ones with get_document.

FAQ

No: the model’s answer is text, not a file. With the tools, Claude decides the content and Doconda builds the file. If Claude already wrote the text in Markdown, doconda.convert(text_bytes, "docx", filename="memo.md") turns it into a .docx with no AI (the first 1,000 conversions each month are free, then €0.01 each).
Add the MCP server (npx -y @doconda/mcp) and ask in the chat. See Claude.
Yes, the tools are standard JSON Schema. See Amazon Bedrock and Google Vertex AI.
A document from a sentence costs €0.15 at fast, €0.50 at standard and €1.50 at best. Failed documents are not charged. See pricing.
  • Claude: the full guide, with Claude Desktop, Claude Code and the MCP connector.
  • Convert files: Markdown to Word or PDF with no AI.