> ## 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.

# Mistral

> Doconda with Mistral function calling and in Le Chat.

## API

```bash theme={null}
npm install @mistralai/mistralai @doconda/sdk
```

```ts theme={null}
import { Mistral } from "@mistralai/mistralai"
import { Doconda } from "@doconda/sdk"

const mistral = new Mistral({ apiKey: process.env.MISTRAL_API_KEY })
const docondaTools = new Doconda().tools()
const tools = docondaTools.map((t) => ({ type: "function" as const, function: { name: t.name, description: t.description, parameters: t.inputSchema } }))
const messages: any[] = [{ role: "user", content: "Write a memo for the team: the office is closed on Friday" }]

while (true) {
  const res = await mistral.chat.complete({ model: "mistral-large-latest", messages, tools })
  const message = res.choices[0]?.message
  if (!message) break
  messages.push(message)
  if (!message.toolCalls?.length) break
  for (const call of message.toolCalls) {
    const args = typeof call.function.arguments === "string" ? JSON.parse(call.function.arguments) : call.function.arguments
    const result = await docondaTools.find((t) => t.name === call.function.name)!.run(args)
    messages.push({ role: "tool", name: call.function.name, toolCallId: call.id, content: JSON.stringify(result) })
  }
}
```

## Le Chat

Add Doconda as a custom MCP connector (an administrator does this; on individual plans, you do):

1. **Connectors → Add connector → Custom MCP connector**.
2. URL: `https://api.eu.doconda.com/mcp`.
3. Authentication: **HTTP Bearer Token**, with your API key.


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