> ## Documentation Index
> Fetch the complete documentation index at: https://docs.doconda.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Mastra

> Generate Word, PowerPoint, Excel and PDF files from a Mastra agent.

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
npm install @mastra/core @doconda/sdk
```

## With the SDK tools

```ts theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
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: "documents",
  name: "Documents",
  instructions: "You create, review and edit documents with Doconda.",
  model: "anthropic/claude-sonnet-5-5", // or any other provider
  tools,
})

const { text } = await agent.generate("Create a 5-slide presentation on our quarterly results")
```

`createTool` takes each tool's JSON Schema as is, with no conversion to Zod. `model` uses Mastra's
`provider/model` format, which reads the provider key from your environment (`ANTHROPIC_API_KEY`).

## With the MCP client

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
npm install @mastra/mcp
```

```ts theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
import { MCPClient } from "@mastra/mcp"

const mcp = new MCPClient({
  servers: {
    doconda: {
      url: new URL("https://api.eu.doconda.com/mcp"),
      requestInit: { headers: { Authorization: `Bearer ${process.env.DOCONDA_API_KEY}` } },
    },
    // or locally: { command: "npx", args: ["-y", "@doconda/mcp"], env: { DOCONDA_API_KEY: "…" } }
  },
})

const agent = new Agent({ id: "documents", name: "Documents", instructions: "…", model, tools: await mcp.listTools() })
const { text } = await agent.generate("Write a welcome letter for Ana in Word")
await mcp.disconnect()
```

Tools arrive prefixed with the server name (`doconda_create_document`, …).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.