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
- 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:
.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
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:readyorfailed. A failed document isn’t charged.- Links expire after 5 minutes; the agent gets fresh ones with
get_document.
FAQ
Can the agent read or edit a user's file?
Can the agent read or edit a user's file?
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.Why does the tool take a while?
Why does the tool take a while?
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.How much does it cost?
How much does it cost?
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.