Skip to main content
Glama

Read Excel, Word or PDF file

office_read
Read-onlyIdempotent

Use this when the user wants the contents of an Excel workbook (.xlsx, .xlsm) , a Word document (.docx, .docm) or a PDF in an approved project, without Office or another program. A workbook gives the cell values of one sheet as rows (dates as ISO text, formulas listed beside their values) and its sheet names. A document gives its paragraphs (style, heading level, list level) and table rows as numbered blocks, with header and footer texts. A PDF gives the text of each page (a scanned page has none; undecodedEncodings names Chinese, Japanese or Korean font encodings whose text cannot be read) with its page count, title and author. Long content comes in pages: pass nextOffset as offset. Read-only. Needs the sessionId from execution_session_open and a new operationId; each call is metered as one execution. A short result is returned inline within about two seconds; otherwise keep the returned IDs for operation_status and operation_output and do not resend the call.

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": {
      "sessionId": "<sessionId>",
      "operationId": "<operationId>",
      "path": "<path>"
    },
    "name": "office_read"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesWorkbook (.xlsx, .xlsm), document (.docx, .docm) or PDF (.pdf) path relative to the selected project root (or the workspace root)
rangeNoWorkbooks only: cells to read, for example A1:D100 or Sheet1!A1:D100 (default: the sheet's used cells)
sheetNoWorkbooks only: sheet name or 0-based index (default: the first sheet)
lengthNoMaximum rows, blocks or PDF pages returned, 1-10000 (default 1000)
offsetNoRows (workbook), blocks (document) or PDF pages to skip, for the next page (default 0)
sessionIdYesexecutionSessionId returned by execution_session_open
deadlineAtNoOptional UTC admission deadline at most 60 seconds ahead (queue start timeout, NOT process execution lifetime)
operationIdYesA new random UUID v4 for this call; reuse it only to retry this same call
idempotencyKeyNoOptional retry key, 8-128 chars of [A-Za-z0-9._:-]; defaults to operationId
efficiencyProfileNoOptional, unverified label of the client's model, recorded as display metadata in the device owner's local activity statistics. Omit when unknown. Never send credentials or conversation content.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, closed-world and non-destructive, so the safety profile is covered. The description still adds material context: the call is metered as one execution, requires a sessionId from execution_session_open plus a fresh operationId, returns inline within about two seconds or else defers to operation_status/operation_output, and warns that a resend is unnecessary. Only the 'nextOffset' wording, a field not present in the input schema, is slightly loose.

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

Conciseness5/5

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

Front-loaded with the use case, then organized format by format, then pagination, then operational requirements. The sentences are dense but every one carries information an agent needs to call this tool correctly; nothing is redundant with the schema or annotations.

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?

For a 10-parameter tool with no output schema, the description carries the return-value burden and does so for all three file types, including edge cases (scanned pages have no text, undecodedEncodings flags CJK font issues) and the async completion path. Nothing essential for a correct first call is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description goes beyond it by explaining that long content is paged and that the pagination cursor from a previous result should be passed as `offset`, and by tying `range`/`sheet` semantics to workbook reads via the per-format output narrative.

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?

States a specific verb (read) and three named resource formats (.xlsx/.xlsm, .docx/.docm, .pdf), then describes exactly what each format yields (cell values as rows, paragraphs as numbered blocks, page text with page count). An agent can distinguish this from office_edit, office_write and fs_read from the description alone.

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?

"Use this when the user wants the contents of ... in an approved project, without Office or another program" gives a clear triggering condition and implicitly contrasts with launching Office or generic file reads. It does not explicitly name a sibling to use for plain-text or non-Office files, so it stops short of full alternative routing.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.