Skip to main content
Glama

Read Media File

read_media_file
Read-only

Reads a file from allowed directories and returns it as base64 content with MIME type, supporting images and audio as inline content and other files as embedded resources.

Instructions

Read a file and return it as a base64-encoded content block with its MIME type. Image and audio files are returned as image/audio content; any other file type is returned as an embedded resource. Only works within allowed directories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.2

TDQS

A4/5.0
Behavior4/5

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

The description adds the constraint about allowed directories, which is not present in the annotations. It is consistent with the readOnlyHint and does not introduce any side effects, but does not describe error behavior or failure modes.

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 sentences, concise and directly to the point. No extraneous information is included.

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?

The description provides enough information about the output format and behavior for different file types for an agent to use the tool effectively. It does not detail the output schema or error handling, but these are not critical for a simple read operation.

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?

The path parameter is not described in the schema or the tool description beyond the context of reading a file. This is adequate for a simple string path, but lacks any detail about expected format or validation.

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 and returns a base64-encoded content block with its MIME type. It also distinguishes behavior for image/audio versus other file types, making its purpose distinct from sibling tools like read_file and read_text_file.

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

Usage Guidelines3/5

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

The description mentions the restriction that it only works within allowed directories, but does not explicitly state when to prefer this tool over alternatives such as read_file or read_text_file. This leaves some room for inference.

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