Code
Python or TypeScript
Mastra orchestrates. Doconda delivers the file.
Connect Doconda from a Mastra agent and get finished, editable, reviewed Word, Excel, PowerPoint and PDF files.
- 01Install the SDKpip install doconda or npm install @doconda/sdk, and your API key.
- 02Give your agent the toolsDoconda's tools, in Mastra's format.
- 03Your agent delivers the fileYour agent gets the link to the reviewed file.

import { Agent } from "@mastra/core/agent"
import { createTool } from "@mastra/core/tools"
import { Doconda } from "@doconda/sdk"
const doconda = new Doconda()
const tools = Object.fromEntries(
doconda.tools().map((t) => [
t.name,
createTool({ id: t.name, description: t.description, inputSchema: t.inputSchema, execute: (input) => t.run(input as Record<string, unknown>) }),
]),
)
const agent = new Agent({
id: "documentos",
name: "Documentos",
instructions: "Creas, revisas y editas documentos con Doconda.",
model: "anthropic/claude-sonnet-5-5", // o cualquier otro proveedor
tools,
})
const { text } = await agent.generate("Crea una presentación de 5 diapositivas sobre nuestros resultados del trimestre")
console.log(text)
