Skip to main content
Wrap each tool from doconda.tools() in a FunctionTool, or connect Doconda’s remote MCP server with MCPServerStreamableHttp. The agent calls create_document, and its final answer carries the links to the Word, PowerPoint, Excel or PDF file it made.

Give the agent document tools

  1. Put your OpenAI key in OPENAI_API_KEY and your Doconda key (dashboard → API keys) in DOCONDA_API_KEY.
  2. Install the dependencies: pip install openai-agents doconda.
  3. Convert the tools and run the agent:
The output is the agent’s reply with the .docx and PDF links. Set strict_json_schema=False because strict mode marks every field as required, and almost all of Doconda’s are optional (prompt or markdown, style, name…). asyncio.to_thread keeps the event loop free while the document is made.

Choose function tools or MCP

With MCP, pass the server in mcp_servers and your key in Authorization: Bearer. The code is in the Agents SDK guide.

What you get back

Each create_document call returns a short summary to the agent:
  • format: docx, pdf, pptx, xlsx or artifact. Word, PowerPoint and Excel files always come with their PDF.
  • status: ready or failed. A failed document isn’t charged.
  • Links expire after 5 minutes; the agent gets fresh ones with get_document.

FAQ

Yes. It has upload_file, convert_file (to Markdown to read it, or to another format) and edit_document, which changes only what is asked. get_report then lists each change with the text before and after.
create_document waits up to about 4 minutes for the document: about a minute at fast, a few minutes at standard. If it takes longer, the tool returns the id and status and the agent checks later with get_document. See quality levels.
Each document is billed like an API call in the key’s project: €0.50 from a prompt at standard, €0.15 at fast. Failed documents aren’t charged. See pricing.
For the full setup, also with the local MCP server, see OpenAI Agents SDK.