openai-agents and doconda, and wrap each tool from doconda.tools() in a FunctionTool (or connect the
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 created.
Steps
- Put your OpenAI key in
OPENAI_API_KEYand your Doconda key (dashboard → API keys) inDOCONDA_API_KEY. - Install the dependencies:
pip install openai-agents doconda. - Convert the tools and run the agent:
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…).
With MCP instead of FunctionTool, pass the remote server in mcp_servers and raise the per-call wait with
client_session_timeout_seconds=300 (5 s by default): a document takes longer to be ready. The code is in the
Agents SDK guide.
What you get back
Eachcreate_document call returns a short summary to the agent:
format:docx,pdf,pptx,xlsxorartifact. Word, PowerPoint and Excel files always come with their PDF.status:ready,ready_with_warnings,needs_revieworfailed(not charged).- Links expire after 5 minutes; the agent gets fresh ones with
get_document.
FAQ
Can the agent review or edit a user's file?
Can the agent review or edit a user's file?
Yes. It has
upload_file, review_document (fixes problems without touching the content) and edit_document
(changes only what is asked).Why does the tool take a while?
Why does the tool take a while?
create_document waits until the document is ready. A simple document takes seconds; one at standard quality, a
few minutes. See quality levels.How much does it cost?
How much does it cost?
Whatever the agent does counts as if you did it with the API: same project, same price. See
pricing.
Keep reading
- OpenAI Agents SDK: the full guide, also with local MCP.
- Quickstart.