@mastra/core and @doconda/sdk, wrap each tool from doconda.tools() with createTool (it takes the JSON
Schema as is, no Zod needed) and pass them to your Agent. When you ask for a document, the agent calls
create_document and its answer carries the links to the Word, PowerPoint, Excel or PDF file.
Steps
- Put your Doconda API key (dashboard → API keys) in
DOCONDA_API_KEYand your model provider’s key (here,ANTHROPIC_API_KEY). - Install the dependencies:
npm install @mastra/core @doconda/sdk. - Create the agent with the tools:
model uses Mastra’s provider/model format, which reads the provider’s key from your environment.
With MCP instead of the SDK, use MCPClient from @mastra/mcp against https://api.eu.doconda.com/mcp and pass
await mcp.listTools() as tools. The tools come prefixed with the server name (doconda_create_document, …).
What you get back
format:docx,pdf,pptx,xlsxorartifact. Word, PowerPoint and Excel files come with their PDF.status:ready,ready_with_warnings,needs_revieworfailed(not charged).- Links expire after 5 minutes; the agent gets fresh ones with
get_document.
FAQ
Can I use it inside a Mastra workflow?
Can I use it inside a Mastra workflow?
Yes: the agent is the same. If a step doesn’t need an agent, call
doconda.documents.create({ format: "docx", content: { markdown } }) directly with the previous step’s text.Where should I call Doconda from?
Where should I call Doconda from?
From your server, never the browser: your API key gives access to every document in the project.
How much does it cost?
How much does it cost?
You pay per delivered document; failed ones are not charged. See pricing.
Keep reading
- Mastra: the full guide, also with the MCP client.
- Quickstart.