Skip to main content
Connect your Vercel AI SDK agent to Doconda so it can convert, create and edit Word, PowerPoint, Excel and PDF files, with any model provider. Use the SDK tools, or the AI SDK’s MCP client against the remote MCP server.

Capabilities

  • Create a Word, PowerPoint, Excel or PDF file, or an artifact, from a request or from Markdown the agent wrote.
  • Edit a file: only what is asked changes, and get_report lists every change.
  • Convert a file to another format with no AI, for example any file to Markdown so the agent can read it.
  • Read what people saved in an artifact, such as poll votes.

Setup

This integration uses a Doconda API key in DOCONDA_API_KEY (from API keys). The model provider reads its own key, for example ANTHROPIC_API_KEY for @ai-sdk/anthropic.

With the SDK tools

text is the model’s final answer, with the presentation’s download links. isStepCount(5) caps the loop at 5 steps, enough to create a document and answer. The same tools work with streamText and in a Next.js route: the agent calls Doconda on your server, and the API key never reaches the browser.

With the MCP client

Tools

The agent gets the eight Doconda tools; see the tools for what each one does. doconda.tools() returns them with name, description, inputSchema (JSON Schema, wrapped with jsonSchema) and run. A failed call returns { "error": "<code>", "message": "…" } instead of throwing, so the model can correct itself.

Troubleshooting

  • Doconda: pass { apiKey } or set DOCONDA_API_KEY. — The SDK found no key: set DOCONDA_API_KEY, or pass { apiKey } to Doconda.
  • text is empty — The loop hit the step limit before the model’s last answer. Raise the count in isStepCount.
  • A tool result has "error": "insufficient_balance" — The project’s balance can’t cover the document: top up in the dashboard, or ask for quality: "fast".
  • The download link stopped working — File links expire after 5 minutes; the agent calls get_document for fresh ones.