Skip to main content
Glama

session_read_file

Read a file from a session workspace, returning text content or an inline image to view visual outputs directly.

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

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed6 schema fields changedv0.2.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / as_image / title
      Added value: +"As Image"
    • addedInput schema / properties / max_bytes / title
      Added value: +"Max Bytes"
    • addedInput schema / properties / path / title
      Added value: +"Path"
    • addedInput schema / properties / session_id / title
      Added value: +"Session Id"
    • addedInput schema / title
      Added value: +"session_read_fileArguments"
  2. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the burden of behavioral disclosure. It explains that text files return content, image files return inline images, and how as_image forces image mode. It does not mention error scenarios or max_bytes behavior, but covers the primary behavior adequately.

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 two concise paragraphs, front-loaded with the core purpose, followed by behavioral details and cross-references. Every sentence adds value with no 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?

For a file-read tool with 4 parameters and no output schema, the description covers the main return types (text vs image) and directs users to discovery tools. It lacks details on max_bytes limits and error handling, but for a simple read operation, it is reasonably complete.

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

Parameters3/5

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

Schema coverage is 0%, so the description must compensate. It adds meaning for as_image (forces image output) and hints at path via session_files. However, max_bytes and session_id are not explained; session_id is self-evident but max_bytes behavior (truncation, error?) is missing. The description provides some semantic value but not comprehensive.

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 the tool reads a file from a session workspace, with specific details about text vs. image handling. It distinguishes itself from siblings like session_write_file and session_files by explicitly mentioning them as alternatives.

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?

It provides explicit guidance on when to use this tool (to read files), and directs the user to session_files for discovering paths and session_artifacts for executed code output. It also explains when to set as_image=True, giving clear usage context.

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

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