Error codes

Generated from the error-code union types of @sezzlee/excel-mcp 0.7.1.

A tool that fails answers with isError: true and one text item holding a JSON object with three fields: error, a stable machine code from this page; message, what went wrong; and recovery, what the next call should do differently. Branch on error, never on message.

This is the answer to describe_workbook {"filePath":"q3.xlsx"} in a folder that has no such file:

json
{
  "content": [
    {
      "type": "text",
      "text": "{\"error\":\"file_not_found\",\"message\":\"No source exists under the workbook root.\",\"recovery\":\"Call list_workbooks to see readable files.\"}"
    }
  ],
  "isError": true
}

The text item, parsed:

json
{
  "error": "file_not_found",
  "message": "No source exists under the workbook root.",
  "recovery": "Call list_workbooks to see readable files."
}

The server has 30 codes.

Arguments and paging

CodeMeaning
invalid_argumentAn argument the tool does not declare, a value of the wrong type, a missing required argument, or a combination the tool refuses, such as headerScan together with headerRow, or a cursor together with sheetName or range. The message names the conflict. For an undeclared or mistyped argument the recovery lists the arguments the tool accepts.
invalid_rangerange is not a valid A1 range. Use a form such as B2:D40, B:D or 2:40.
range_outside_used_rangerange lies outside the sheet's used range. The recovery names the used range.
invalid_cursorcursor is not a token that a previous read_sheet answer returned, for example because it was cut short or edited. Read again without a cursor.
stale_cursorThe file changed between two pages of the same read. Start again without a cursor.
invalid_patternfind_in_sheet refused a regex query: it is longer than 256 characters, uses a Unicode property escape (\p{…}), or is not a valid JavaScript regular expression.
resource_limitThe request would exceed a fixed budget: too many groups or cells for aggregate_sheet, or a regex search that timed out or found the queue full. See Limits.

Files and paths

CodeMeaning
path_outside_rootfilePath resolves outside the folder the server was started with. Paths are relative to that folder, and .. cannot leave it.
file_not_foundNo file exists at filePath. Call list_workbooks for the paths that do.
not_a_filefilePath names a directory or another entry that is not a regular file.
unsupported_extensionThe file is not .xlsx, .xlsm or .csv.
file_too_largeThe file is over the size limit: 50 MB for a workbook, 16 MB for a CSV.
file_changedThe file was modified while it was being read. Retry the call.
unsupported_platformThe native package that gives the server safe file access is missing for this operating system and CPU. Reinstall on a supported platform.

File content

CodeMeaning
not_a_workbookThe bytes are not a workbook: no zip header, or a zip with no workbook part inside, such as a .docx renamed to .xlsx.
encrypted_workbookThe file is password-protected or saved in the legacy binary .xls format. Save an unprotected .xlsx copy.
corrupt_workbookThe file is a zip with a workbook part, but the part cannot be parsed. The message carries the parser's own explanation.
undecodable_textA CSV cannot be decoded as text: it contains NUL bytes near its start, which means a binary file or UTF-16 without a byte-order mark, or it starts with a UTF-32 byte-order mark. Pass encoding: "utf-16le" or "utf-16be" for UTF-16 text.
ambiguous_delimiterTwo delimiters fit the first 20 lines of a CSV equally well. Pass delimiter.
numeric_overflowA cell or a comparison value holds a number outside the finite range, such as Infinity.
unsupported_for_formatThe file's format cannot carry what was asked for, such as get_tables or headerScan on a CSV. describe_workbook lists what each file supports in its capabilities block.
unsupported_object_kindget_images was asked for charts, pivot tables or sparklines. The server cannot read these in any format, so it refuses rather than answer with an empty list.

Sheets, columns and headers

CodeMeaning
unknown_sheetNo sheet has that name. Names are case-sensitive; the recovery lists the sheets that exist.
ambiguous_sheetTwo sheets have names that are the same after Unicode normalization, so neither can be addressed. Rename one in the workbook.
empty_sheetThe sheet has no cells with values.
unknown_columnA column named in groupBy, metrics or where is neither a header in the range nor an A1 letter. The recovery lists the named columns.
ambiguous_columnA column reference matches more than one column: two columns share the header text, or the text is both a header and another column's letter. Address the column by letter.
unknown_header_rowheaderScan found no row that qualifies as a header. Pass headerRow, or headerRow: 0 to read without headers.
ambiguous_header_rowheaderScan found more than one row that qualifies as a header, or more than one Excel Table declares one. The recovery quotes the candidate rows; pass headerRow.

Server

CodeMeaning
internal_errorA defect in the server, not in your file or your call. This is the one code with no recovery, because there is no next call that fixes it. The detail is written to the server's stderr.