format you want (docx, pptx, xlsx or pdf). Or give your agent Doconda’s tools
with doconda.tools() and let it create the file itself.
The problem in practice
- The model answers with Markdown or a code block, not a
.docxyou can download. - If you ask it to write the code that builds the file, you have to run it and debug whatever fails.
- A file that is generated without errors can still open badly: overflowing tables, text that doesn’t fit the slide.
- Each format (Word, PowerPoint, Excel) needs its own library and its own code.
The solution with Doconda
With the text your LLM already returned:name, description,
input_schema (JSON Schema) and run(args):
What you get back
- The file you asked for; Word, PowerPoint and Excel also come with their PDF.
status:ready,ready_with_warnings,needs_revieworfailed(not charged).- A report (
documents.report(id)) with anything worth checking before you send it. - With tools, your agent gets a short summary (status and links) it can pass on to the user.
FAQ
Can ChatGPT or Claude generate a .docx file from the API?
Can ChatGPT or Claude generate a .docx file from the API?
The model’s answer is text. Ask it for the content in Markdown and turn it into a
.docx with
documents.create(format="docx", content={"markdown": ...}), or let the agent call the create_document tool.How do I generate a PowerPoint with an LLM?
How do I generate a PowerPoint with an LLM?
Use
format="pptx" with your LLM’s Markdown in content. With no content of your own, describe the presentation
in prompt and Doconda writes it. It comes out in 16:9 and with its PDF.Does it work with my agent framework?
Does it work with my agent framework?
Yes. There is an MCP server, SDK tools for Claude, OpenAI, Gemini, Bedrock, Vertex AI and the AI SDK, and the REST
API. The full list is in Doconda in your agent.
Keep reading
- Doconda in your agent: MCP, SDK tools and API.
- Create and Review.
- Python SDK and TypeScript SDK.
- Examples on GitHub.