Skip to main content
Glama

open_file

Opens a local file on an existing sandbox instance's display using a specified app or the default handler; resolves relative paths in the staging folder for viewing or testing files.

Instructions

Open a local file in an app ON an existing instance's display (NOT a new instance).

If app is given, runs <app> <filepath> there (e.g. app='gimp'); otherwise xdg-open picks the default handler. Relative paths resolve against the instance's staging folder files// (see list_files). Returns {"ok", "action", "instance", "opened", "app"}; fails (isError) if the file or the app doesn't exist, or if the handler exits immediately (e.g. xdg-open finds no application for that file type — then pass app=). The app is started asynchronously — wait_for_stable()/screenshot after a moment to confirm it drew. For BROWSER uploads use upload_file() instead. Both paths get the same X11 + D-Bus handling as launch_app (so the app renders on this display, not in an already-running window on the host).

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": {
      "filepath": "<filepath>"
    },
    "name": "open_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
appNo
filepathYes
instanceNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=false/openWorldHint=true/destructiveHint=false; the description adds substantial context beyond that: the process is launched asynchronously, isError occurs when the file or app is missing or the handler exits immediately, and X11 + D-Bus handling matches launch_app so the window renders on this display. These are non-obvious behavioral traits an agent needs to call it correctly.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the most decision-relevant distinction (existing vs new instance) and then the failure/alternative paths. It is dense but nearly every clause carries information; the enumerated return keys are the one piece that duplicates the output schema.

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?

For a three-parameter tool with an output schema present, the description covers scope, fallback behavior, failure conditions, async timing, and the correct sibling for the adjacent upload case. Only minor ambiguity about the instance identifier remains, which is not enough to leave an agent unable to call it.

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?

With 0% schema coverage the description must carry the load, and it mostly does: `app` is explained as running `<app> <filepath>` with an example (gimp), and `filepath` relative-path resolution against the instance staging folder files/<N>/ is spelled out. The `instance` parameter is only implicitly covered ('an existing instance's display'), with no note on how to discover valid instance IDs (e.g. list_instances), leaving one gap.

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 first sentence gives a specific verb and resource ('Open a local file') plus the crucial scope qualifier 'ON an existing instance's display (NOT a new instance)', which separates it from launch_app/start_app. It also names the fallback behavior (xdg-open default handler) and the app-override form, so an agent can distinguish it from siblings without opening the 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?

Explicit routing: use upload_file() instead for BROWSER <input type=file> uploads, pass app= when xdg-open finds no handler, and consult list_files for staging paths. It also gives a post-call procedure (wait_for_stable()/screenshot after a moment), which is real when-to-use guidance rather than a restatement.

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