Create spreadsheets & documents with CrewAI
Give a CrewAI agent the ability to output real spreadsheets and documents instead of plain text. Define a @tool that wraps the OpenOfficeAI API and assign it to an agent; the crew can then generate a budget, report, or plan and return a shareable link as the task result.
import requests
from crewai.tools import tool
@tool("Create Spreadsheet")
def create_spreadsheet(title: str, rows: list) -> str:
"""Create a shareable spreadsheet from rows (first row = header).
Returns a public URL."""
r = requests.post(
"https://openofficeai.com/api/v1/sheets",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"title": title, "sheets": [{"rows": rows}]},
)
return r.json()["url"]
# Assign it to an agent:
# analyst = Agent(role="Analyst", tools=[create_spreadsheet], ...)How to create a spreadsheet with CrewAI
- 1Define a @tool wrapping a POST to /api/v1/sheets that returns the url.
- 2Write a precise docstring — CrewAI surfaces it to the LLM as the tool spec.
- 3Add the tool to the relevant Agent via tools=[create_spreadsheet].
- 4The agent now delivers shareable links as task output, not raw tables.
Why use OpenOfficeAI with CrewAI
- Crew outputs become artifacts a human can open and edit.
- Simple title + rows signature = reliable tool calls.
- Pair with a create_document tool for written deliverables.
Frequently asked questions
How do I add this tool to a specific agent?
Pass it in the agent definition: Agent(role="...", goal="...", tools=[create_spreadsheet]). Only agents with the tool can call it, so you can scope document creation to, say, a reporting agent.
Can the crew create multi-sheet workbooks?
Yes. Extend the tool to accept multiple sheets — the API body takes a sheets array, each with its own name and rows — so an agent can produce a workbook with separate tabs in one call.
Does this work with CrewAI Flows?
Yes. The tool is a plain function, so you can call it directly inside a Flow step or expose it to an agent within the flow. Either way it returns the shareable URL.
Start creating documents with CrewAI
Free tier includes 500 API calls per month — no card required.
Related integrations