Skip to main content
Glama

Read a file from the workspace

workspace_files_read
Read-only

Read an uploaded file (PDF, Word, PowerPoint, spreadsheet, text) as markdown. Find file ids with workspace_folders_browse (a folder's items of kind workspace_file) or search_workspace. For anything long, call with outline: true first: it returns the headings with their character offsets and the total length. Then read only the sections you need with offset and maxChars. Spreadsheets come back as tables. A file that can't be read as text says so; don't guess at its contents.

Input Schema

NameRequiredDescriptionDefault
fileIdYes
offsetNoCharacter offset to start from. Default 0.
outlineNoReturn the headings and their offsets instead of text.
usedForNoThe thing you're reading this file to work on (the page, change, flow…), when there is one. The file then shows it was used there, and the thing shows the file it drew on. Leave it out for a general question.
maxCharsNoHow much to return. Default 12000.
workspaceNoWorkspace slug. Ignored when the workspace is already set.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / usedFor
      Added value: +{
      +  "description": "The thing you're reading this file to work on (the page, change, flow…), when there is one. The file then shows it was used there, and the thing shows the file it drew on. Leave it out for a general question.",
      +  "properties": {
      +    "id": {
      +      "maxLength": 100,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "kind": {
      +      "maxLength": 60,
      +      "minLength": 1,
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "kind",
      +    "id"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint=true, destructiveHint=false), so the bar is lower. The description adds real behavioral context: spreadsheets render as tables, unreadable files self-report rather than returning fabricated text, and outline mode returns headings with character offsets plus total length. It does not discuss size limits or auth, but this is solid beyond what annotations provide.

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?

Four sentences, no filler, and the highest-value guidance (what it does, then how to find ids, then the long-file workflow) is front-loaded. Each sentence contributes a distinct usable fact.

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?

With no output schema, the description compensates by describing return format (markdown, tables, outline headings with offsets) and failure behavior for unreadable files. Nothing an agent needs to call this correctly appears to be 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 83% and the description reinforces the meaning of outline, offset, and maxChars by explaining the read strategy they enable ('headings with their character offsets and the total length', 'read only the sections you need'). It says nothing about usedFor or workspace, but those carry their own schema descriptions.

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 and resource ('Read an uploaded file ... as markdown') and enumerates the supported input types. It is immediately distinguishable from sibling retrieval tools like workspace_folders_browse and search_workspace, which it positions as id-lookup mechanisms rather than readers.

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

Usage Guidelines5/5

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

Explicitly names the siblings to use for finding file ids and prescribes the workflow for long files ('call with outline: true first ... then read only the sections you need with offset and maxChars'). The agent knows both how to locate a file and how to sequence reads.

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.

Resources