Skip to main content
Glama

capture_file

Convert any code file into a syntax-highlighted screenshot with automatic language detection. Specify file path and optional line range to capture a specific section.

Instructions

Read a file and generate a syntax-highlighted screenshot with automatic language detection from file extension. Supports 50+ languages via Shiki. Requires SNAPMCP_ALLOWED_PATHS to be set for security (deny-all by default). Maximum file size 5MB.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
outputNoOutput filename (default: auto-generated as 'file-<timestamp>.png' or '.jpeg' based on SNAPMCP_FORMAT). Include extension to override format.
endLineNoLast line number to capture (1-indexed, inclusive). Must be >= startLine if both provided. Defaults to end of file.
filePathYesAbsolute path to the file to capture. Must be within SNAPMCP_ALLOWED_PATHS allowlist. Symlinks are resolved to prevent traversal.
startLineNoFirst line number to capture (1-indexed, inclusive). Use with endLine to capture a specific range.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv2.3.4
    • changedInput schema / properties / endLine / description
      Previous value: -"Last line number to capture (1-indexed, inclusive)"New value: +"Last line number to capture (1-indexed, inclusive). Must be >= startLine if both provided. Defaults to end of file."
    • changedInput schema / properties / filePath / description
      Previous value: -"Absolute path to the file to capture"New value: +"Absolute path to the file to capture. Must be within SNAPMCP_ALLOWED_PATHS allowlist. Symlinks are resolved to prevent traversal."
    • changedInput schema / properties / output / description
      Previous value: -"Output filename (default: auto-generated)"New value: +"Output filename (default: auto-generated as 'file-<timestamp>.png' or '.jpeg' based on SNAPMCP_FORMAT). Include extension to override format."
    • changedInput schema / properties / startLine / description
      Previous value: -"First line number to capture (1-indexed, inclusive)"New value: +"First line number to capture (1-indexed, inclusive). Use with endLine to capture a specific range."
  2. First observedv2.3.2

TDQS

A3.5/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It reveals that the tool reads a file, is security-config dependent with deny-all default, has a maximum file size, and supports automatic language detection. It does not explicitly mention all failure modes or whether it writes output to disk, but the read-only implication is clear.

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 concise sentences with no filler: the first states the core action, the second highlights language support, and the third covers security and size limits. Information is appropriately front-loaded and every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no output schema and no annotations, the description covers key operational details but omits the return value/format and any error behavior. It also does not situate the tool among its many siblings, leaving some ambiguity for an agent deciding whether capture_file is the right choice.

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 description coverage is 100%, so the baseline is 3. The description adds useful behavioral constraints such as file extension-based language detection and the 5MB maximum, but these are not essential to understanding individual parameters beyond what the schema already documents.

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 clearly states the tool's specific function: reading a file and generating a syntax-highlighted screenshot with automatic language detection. This distinguishes it from siblings like capture_terminal or capture_browser, though it doesn't explicitly differentiate it from the similarly-named capture_code.

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?

The description provides no guidance on when to use capture_file versus its alternatives. It only notes prerequisites and constraints (SNAPMCP_ALLOWED_PATHS, 5MB limit), but does not explain selection criteria or exclusions relative to the many sibling tools.

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