Skip to main content
Glama

excel_export_csv

Export Excel sheets to CSV files. Convert .xlsx to .csv with UTF-8 encoding and Excel-friendly dialect.

Instructions

Export a sheet to CSV via :mod:openpyxl and the stdlib :mod:csv.

Delegates to :func:office_mcp.exporters.export_to_csv. The output is written as UTF-8 (without a BOM) and uses the standard Excel-friendly CSV dialect.

Args: path: Path to an existing .xlsx file. output: Target path for the produced .csv. The parent directory is created if it does not exist. If a relative path is given, it is resolved against folder (or the default folder). sheet: Optional sheet name. When None (the default), the workbook's first sheet is exported. folder: Optional base folder for relative paths.

Returns: {"output_path": "<absolute path of the produced CSV>"}.

Raises: OfficeMCPError: ERR_FILE_NOT_FOUND if the source is missing, ERR_UNSUPPORTED_FMT for non-.xlsx sources, ERR_SHEET_NOT_FOUND for an unknown sheet.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
outputYes
sheetNo
folderNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It reveals that output is UTF-8 without BOM, uses standard CSV dialect, and describes error conditions (file not found, unsupported format, sheet not found). It does not explicitly state whether existing output files are overwritten, but the description is sufficiently transparent for common usage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (description, Args, Returns, Raises). It is longer than necessary, including implementation details like openpyxl and office_mcp.exporters, which may not be essential for an AI agent. However, it is organized and front-loaded with the key action, meriting a 4.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 4 parameters, 0% schema coverage, and an output schema, the description covers all critical aspects: input requirements, optional parameters, output format (absolute path of CSV), and error handling. It is complete enough for an AI agent to use correctly without additional context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% (per context signals), so the description must compensate. The Args section fully explains each parameter: path (required .xlsx file), output (target path with parent directory creation and relative path resolution), sheet (optional, defaults to first sheet), and folder (optional base for relative paths). This adds significant meaning beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Export a sheet to CSV'. It uses a specific verb ('Export') and resource ('sheet to CSV'), and distinguishes from sibling tools like excel_export_html and excel_export_pdf which have different output formats. The reference to openpyxl and stdlib csv provides implementation context but the core purpose is clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to use the tool (to export an .xlsx sheet to CSV) and provides details about optional sheet selection and folder resolution. However, it does not explicitly state when not to use this tool or mention alternatives (e.g., other export formats). The usage context is implied but not exhaustive, so a score of 3 is appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gawirable/office-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server