Skip to main content
Glama

Session Read File

session_read_file
Read-onlyIdempotent

Read a session workspace file as text or inline image to inspect executed code outputs or discover session artifacts.

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
pathYesRelative path inside the workspace to read
as_imageNoReturn the file as an inline image the model can see, instead of text
max_bytesNoMax bytes to read from the file; default 65536 (64 KiB)
session_idYesId of the session whose workspace file to read

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.12.0
    • addedInput schema / properties / as_image / description
      Added value: +"Return the file as an inline image the model can see, instead of text"
    • addedInput schema / properties / max_bytes / description
      Added value: +"Max bytes to read from the file; default 65536 (64 KiB)"
    • addedInput schema / properties / path / description
      Added value: +"Relative path inside the workspace to read"
    • addedInput schema / properties / session_id / description
      Added value: +"Id of the session whose workspace file to read"
  2. 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"
  3. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint, so the safety profile is covered. The description adds behavioral detail beyond annotations by explaining that text files return content and that image files or as_image=True produce an inline image the model can see. This is useful context not present in the annotations.

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 short, dense sentences. The purpose is front-loaded, then the image behavior, then sibling references. No redundant phrasing or fluff—every sentence earns its place.

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?

Given the annotations and full schema coverage, the description is complete for an agent to call the tool correctly. It covers what returns (text or image), how to find paths (session_files), and what artifacts are (session_artifacts). No critical information is missing for a read-only tool.

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% and all four parameters have descriptions. The description adds context by explaining the as_image parameter ('returned as an inline image the model can see') and implicitly ties the path parameter to session_files discovery. It doesn't over-explain, but the schema already does the heavy lifting, so a baseline of 3 plus this added clarity justifies a 4.

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 action ('Read a file from a session workspace') and distinguishes itself from sibling tools by explicitly referencing session_files for path discovery and session_artifacts for executed-code output. It also clarifies the two return modes (text vs inline image), making the purpose unambiguous.

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 provides explicit routing guidance: 'Use session_files to discover paths; session_artifacts lists what executed code produced.' It also specifies when as_image=True is appropriate (for image files or when the model needs to see the content as an image). This directly tells the agent when to use this tool vs its siblings.

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