Skip to main content
Glama

Read workspace file

read_file
Read-only

Read a file from the server's workspace. With project_id, path is resolved inside that project's folder; without it, path is relative to the server workspace root. Use encoding:"base64" for binary files (e.g. .xlsx, images); plain text mode will corrupt non-text bytes.

Input Schema

NameRequiredDescriptionDefault
pathYesFile path, e.g. "public/index.html". Relative to the project folder when project_id is given, otherwise to the server workspace root.
encodingNoOptional, default "utf8". Use "base64" to read a binary file without corrupting it: the returned content is base64-encoded.
server_idYesThe server's id, as returned by create_server or list_servers.
project_idNoOptional. Resolve path inside this project's workspace folder instead of the server workspace root.

Output Schema

NameRequiredDescriptionDefault
pathYesThe path that was read.
contentYesThe file's contents. Base64 encoded when encoding is base64.
encodingYesHow content is encoded.
project_idNoThe project the path was resolved in. null for the server workspace root.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and closed-world scope, so the safety profile is covered. The description adds real behavioral value beyond that by warning that plain-text mode will corrupt non-text bytes — a failure mode no annotation encodes. It stops short of covering error behavior for missing files.

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?

Three tight sentences, each carrying distinct information (scope, path resolution, binary handling), with the primary purpose front-loaded. No filler.

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?

Output schema exists, so return values needn't be described. With four params, full schema coverage, and an output schema, the remaining burden on the description is path resolution and binary safety — both are present. Nothing an agent needs to call it correctly 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; the description earns an extra point by explaining the interaction between project_id and path resolution, which is the one semantic subtlety not obvious from the fields alone. The encoding advice also reinforces the enum's purpose.

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 a file from the server's workspace') and immediately scopes it to the workspace, which cleanly separates it from siblings like list_files and write_file. An agent knows exactly what it retrieves without opening the schema.

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?

Gives concrete conditional guidance: supply project_id to resolve inside a project folder, omit it for the workspace root, and use base64 for binary files. It doesn't mention using list_files first to discover paths, but the core when/how conditions are explicit.

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.