Skip to main content
Glama

craftos_read_file

Read-only

Read a workspace-relative file to inspect program or test contents before editing; paths outside the workspace are refused.

Instructions

Read a file from the workspace on disk and return its text. Use it to check what a program or test file holds before editing it; to see what a running computer shows, use craftos_ui or craftos_read_terminal instead. Paths that leave the workspace are refused.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>"
    },
    "name": "craftos_read_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesWorkspace-relative path with forward slashes, e.g. "startup.lua" or "lib/ui.lua".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.7.1
    • addedInput schema / properties / path / description
      Added value: +"Workspace-relative path with forward slashes, e.g. \"startup.lua\" or \"lib/ui.lua\"."
  2. First observedv0.7.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, so safety is covered; the description adds value by disclosing a behavioral constraint not in the annotations — sandbox enforcement via "Paths that leave the workspace are refused" — and by stating the return is text. It doesn't mention behavior for missing or binary files, so not a full 5.

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 sentences, front-loaded with the action and return value, then usage, then the constraint. Every clause adds information; nothing is redundant with the title or schema.

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 single-parameter read tool with no output schema, the description covers action, return type, usage boundary, and path restriction, which is nearly everything needed. Only edge-case behavior (missing file, oversized or non-text content) is left implicit.

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%, so the baseline is 3; the description earns above baseline by attaching a meaningful constraint to the path argument — that out-of-workspace paths are rejected — which the schema does not state and which directly shapes how an agent constructs the value.

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?

States a specific verb and resource ("Read a file from the workspace on disk") and names the exact return content ("return its text"), which lets an agent distinguish it from sibling readers without inspecting any schema.

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?

Gives a concrete when-to-use case ("check what a program or test file holds before editing it") and explicitly routes the agent elsewhere for live runtime state ("use craftos_ui or craftos_read_terminal instead"), so the boundary between static file contents and running-computer output is unambiguous.

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