Skip to main content
Glama
xlsx-for-ai

xlsx-for-ai

by senoff

xlsx_read

Read-onlyIdempotent

Read uploaded .xlsx/.xls/.csv/.json files or live Google Sheets as markdown, JSON, or SQL text so AI agents can inspect and process spreadsheet data.

Instructions

Use this when you need to read a spreadsheet as text (markdown, JSON, or SQL) — from an uploaded .xlsx/.xls/.csv/.json file, or from a live Google Sheet by ID using source:"gsheets", spreadsheet_id, and access_token: a Google OAuth bearer already scoped for Sheets read access that the caller must supply. This connector's own Google sign-in is account login only and does not grant one — for a user who only has a shared link, pass it as file_url instead. format:"json" emits one object per sheet row, with a "row" field (the real 1-based sheet row number) and one key per column letter (A, B, ...); it carries values only, so a formula cell contributes its computed value rather than the formula text, styles and number formats do not survive (except as display text under value_format typed_with_text, below), and dates arrive as ISO-8601 strings because JSON has no date kind. A .csv is read the way Excel opens one (en-US): numbers (including 1,234.50, $5, 50% and (5)), TRUE/FALSE and dates (M/D/YYYY, YYYY-MM-DD, 15-Jan-2024, with an optional time) are typed values, read as an .xlsx cell of that type would be (display formats are not carried); ids with a leading zero (00123), digit strings longer than 15 digits and text that only looks numeric in another locale (1.234,56) stay text, and an empty field is a blank cell. Pass options.header_row:true with format:"json" to get rows keyed by the header row's values (e.g. {row:2, email:..., name:...}) instead of column letters; the header row itself is left out, so offset and maxRows count data rows, and duplicate or blank headers get unique names (a repeat becomes Name_2, a blank header becomes its column letter). For a messy export with a title, blank rows or notes above the header, pass options.header_row_auto:true (the header row xlsx_data_clean would find, row 1 when none) or options.header_row_number such as 3 (row 3 is the header, data starts at row 4), not both; _meta.header_row_used names the row used. An error cell (#N/A, #DIV/0!, #REF!, #NAME?, #VALUE!, #NUM!, #NULL!, #SPILL!, #CALC! and the other Excel error values) keeps its error code as the cell value and is also named in that row's "errors" object (same keys as the row: column letter, or the header name with header_row), so it reads differently from a text cell holding the same characters; rows with no error cells have no "errors" key. Set options.formulas:true to get formulas in any format, for the formula cells of the returned page, shared formulas expanded, paging with options.offset and options.maxRows: markdown adds a " formula" line under each row that holds formulas, with each formula (= first) in its column; sql adds a "-- formula D2: =A2+1" comment after that row's statement; json adds formulas_by_cell next to rows, each formula cell by A1 ref (for example "D2") to its formula text without the leading =; in markdown and sql a backslash, line break or (markdown) pipe inside a formula is written \, \n, \r or |. Set options.value_format:"typed" with format:"json" to get typed values instead of display text: numbers as JSON numbers, TRUE/FALSE as true/false, a blank cell as null (every row then has a key for every used column of the sheet), dates as ISO-8601 strings and text as strings (an id with a leading zero stays text); the default, "text", is unchanged. Set options.value_format:"typed_with_text" with format:"json" to get each cell as {v, t, text}: v the typed value, t its type (number, string, boolean, date, error or blank) and text what Excel shows under the cell's number format (for example {"v": 1234.5, "t": "number", "text": "1,234.50"}, and "00123" keeps its zeros); a CSV field's text is the field as written, and where the text cannot be shown exactly it is left out and text_unavailable is true. In markdown, md cells are escaped: a backslash, pipe or line break in a cell or header is written \, |, \n or \r, so a value never shifts a column or starts a new row, and a line break in a sheet-name heading is written \n or \r.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "file_path": "<file_path>"
    },
    "name": "xlsx_read"
  }
}

Input Schema

NameRequiredDescriptionDefault
sheetNoSheet name or index (default: all sheets).
formatNoOutput format. Use "md" (markdown table, default), "json" (structured rows), or "sql" (CREATE TABLE + INSERTs). Synonyms: "markdown"→"md", "text"→"md".md
evaluateNoEvaluate formulas server-side (default: false).
file_pathYesAbsolute path to the .xlsx file. Pass the path string AS-IS — do NOT read, open, or base64-encode the file; the client handles all file I/O. The base64 surface in this connector is OUTPUT-only (_meta.file_b64).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv4.3.1
    • addedInput schema / properties / evaluate
      Added value: +{
      +  "description": "Evaluate formulas server-side (default: false).",
      +  "type": "boolean"
      +}
    • removedInput schema / properties / file_b64
      Removed value: -{
      -  "type": "string"
      -}
    • addedInput schema / properties / file_path
      Added value: +{
      +  "description": "Absolute path to the .xlsx file. Pass the path string AS-IS — do NOT read, open, or base64-encode the file; the client handles all file I/O. The base64 surface in this connector is OUTPUT-only (_meta.file_b64).",
      +  "type": "string"
      +}
    • addedInput schema / properties / format
      Added value: +{
      +  "default": "md",
      +  "description": "Output format. Use \"md\" (markdown table, default), \"json\" (structured rows), or \"sql\" (CREATE TABLE + INSERTs). Synonyms: \"markdown\"→\"md\", \"text\"→\"md\".",
      +  "enum": [
      +    "md",
      +    "json",
      +    "sql"
      +  ],
      +  "type": "string"
      +}
    • removedInput schema / properties / options
      Removed value: -{
      -  "properties": {
      -    "format": {
      -      "type": "string"
      -    },
      -    "maxRows": {
      -      "maximum": 100000,
      -      "minimum": 1,
      -      "type": "integer"
      -    },
      -    "sheet": {
      -      "type": "string"
      -    }
      -  },
      -  "type": "object"
      -}
    • addedInput schema / properties / sheet
      Added value: +{
      +  "description": "Sheet name or index (default: all sheets).",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "file_b64"
      -]New value: +[
      +  "file_path"
      +]
  2. First observedv3.2.1

TDQS

A4.4/5.0
Behavior5/5

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

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

Conciseness2/5

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

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

Completeness4/5

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

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?

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?

Its outputs are markdown, JSON or SQL, so it complements xlsx_read.

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

Usage Guidelines4/5

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

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