Skip to main content
Glama

start_preview

Serve a local folder over HTTP to open exported images in a browser for quick preview. Returns a tokenized 127.0.0.1 URL that lists and serves files.

Instructions

Serve a folder over HTTP on 127.0.0.1 so exported images can be opened in a browser.

Export into the folder, then open the returned URL exactly as given: its first path segment is a secret token, and file URLs are the URL plus the file's path inside the folder (e.g. url + "walk.gif"). The URL itself lists the folder. Only this machine can connect, and only with 127.0.0.1 or localhost as the host name. Only .png, .gif, .webp, .bmp, .tga, .qoi and .json files are served; dotfiles, other files and anything outside the folder are not, and nothing can be uploaded. One preview runs at a time: starting it again for the same folder returns the running URL; for another folder call stop_preview first. The server stops when this program exits.

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": {
      "directory": "<directory>"
    },
    "name": "start_preview"
  }
}

Input Schema

NameRequiredDescriptionDefault
portNo0 picks a free port
directoryYesFolder to serve, e.g. where exports go

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so thoroughly: loopback-only binding, a secret token as the first path segment, an extension whitelist, exclusion of dotfiles and paths outside the folder, no upload capability, one preview at a time, and lifecycle tied to program exit. These are exactly the behavioral facts an agent cannot infer from the schema.

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 core action is front-loaded in the first sentence, with constraints following in a logical order: URL construction, access restriction, served file types, concurrency, lifecycle. Despite its length, nearly every clause carries a distinct operational fact.

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 server-starting tool the description covers security model, URL derivation, file-type filtering, concurrency limits, and shutdown semantics. Even though an output schema exists, the explanation of how to compose file URLs from the returned token URL is valuable and complete.

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?

Schema coverage is 100%, and the schema already explains that port 0 picks a free port and that directory is the folder to serve. The description reinforces the directory's purpose ("where exports go") but adds no syntax or constraint details beyond the schema, so the baseline 3 applies.

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 opening sentence gives a specific verb and resource ("Serve a folder over HTTP on 127.0.0.1") plus the motivating use case (exported images opened in a browser). It is immediately distinguishable from stop_preview, which it names later as the paired teardown tool.

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?

It states the usage sequence explicitly ("Export into the folder, then open the returned URL exactly as given") and gives a clear when-not rule: for a different folder, call stop_preview first. It also notes the idempotent behavior when the same folder is already being served.

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