Skip to main content
Glama

session_read_file

Read a file from an execution session workspace, returning text or an inline image when as_image is enabled.

Instructions

Read a file from a session workspace.

Text files return content. With as_image=True (or for image files), the file is returned as an inline image the model can see. Use session_files to discover paths; session_artifacts lists what executed code produced.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
as_imageNo
max_bytesNo
session_idYes
Behavior3/5

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

With no annotations, the description carries the transparency burden. It discloses text vs. image return behavior and the inline image capability, but omits details about max_bytes truncation, error handling, or behavior for binary/non-text files. This is partial but not fully transparent.

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?

The description is concise and front-loaded, with three sentences that each add value: the purpose, the output behavior, and the related tools. No redundant or filler content.

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

Completeness3/5

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

Given 4 parameters, no annotations, and no output schema, the description covers the core reading behavior and image option but lacks details on size limits, error cases, or file type fallbacks. It is adequate for basic use but not fully complete for an agent navigating edge cases.

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

Parameters2/5

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

Schema coverage is 0%, so the description must clarify parameters. It explains as_image and implies path/session_id via the opening sentence, but max_bytes is not described. This leaves a key parameter undocumented, so the description only partially compensates for the missing schema details.

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?

The description clearly states 'Read a file from a session workspace,' using a specific verb and resource. It distinguishes itself from siblings by explaining image handling ('as_image=True or for image files') and referencing companion tools like session_files and session_artifacts.

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?

The description explicitly points to session_files for discovering paths and session_artifacts for listing executed code output, giving clear guidance on tool selection and preparation. It also explains when to use as_image, covering both alternatives and context.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/The-40-Thieves/codecalc'

If you have feedback or need assistance with the MCP directory API, please join our Discord server