Skip to main content
Glama

opencode_file_read

Read-onlyIdempotent

Retrieve file contents by path to inspect source code and project files during autonomous coding and debugging.

Instructions

Read the content of a file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path to read
directoryNoAbsolute path to the project directory. When provided, the request targets that project. If omitted, the OpenCode server uses its own working directory.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo
textYes
isErrorYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description merely restates the read-only behavior without adding extra behavioral context such as encoding, binary file handling, or output size limits. It does not contradict 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?

The description is a single succinct sentence with no filler or redundant content. It is front-loaded and immediately communicates the core operation. Every word earns its place.

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 simple read tool with a clear schema, full parameter coverage, an output schema, and comprehensive annotations, the description is sufficient for an agent to invoke it correctly. Additional context about file types or edge cases would be nice but is not necessary given the available structured metadata.

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 input schema covers 100% of the parameters with descriptions, so the schema does the heavy lifting. The tool description adds no additional parameter meaning beyond what the schema already provides. With full schema coverage, the baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: 'Read the content of a file.' This clearly distinguishes it from sibling tools like opencode_file_list or opencode_find_text. However, it does not explicitly differentiate itself from alternative file-related tools, though the name and wording make the intent obvious.

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

Usage Guidelines2/5

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

No guidance is provided about when to use this tool versus file_list, find_text, or other file-related tools. There are no exclusions, prerequisites, or alternative suggestions. The intended usage is only implied by the tool name and description.

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

Deploy Server

Other Tools