Skip to main content
Glama

View-source screenshot

view_source_screenshot

Fetch a page's raw HTML as a browser does, render it view-source style with line numbers, highlight matching text or lines, and save a PNG while returning the file path and matched lines.

Instructions

Fetch a page's raw HTML the way a browser does, render it like Chrome's view-source (line numbers, monospace), highlight matches and save a PNG. Returns the file path and the matched lines.

Input Schema

NameRequiredDescriptionDefault
outNoOutput PNG path. Defaults to ~/Desktop/vsource-<host-path>-<time>.png.
urlYesPage URL to read the raw HTML source of.
modeNo"matches" (default) shows only the highlighted lines plus context, with long gaps collapsed; "first" is one viewport of the full source scrolled to the first match.
labelNoSuffix for the default filename, e.g. "before" or "after".
linesNoLine numbers to highlight in full.
matchNoText to highlight. Plain text also matches its JSON-escaped form (/ as \/). Prefix with "re:" for a regex.
widthNoViewport width in px (default 1366).
hide_paramsNoQuery parameter names to keep out of the view-source header (they are still sent with the request), e.g. preview or auth tokens.
context_linesNoLines of context above and below the matches (default 4).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description is the only source of behavior, and it does disclose that a PNG file is written to disk and that the file path plus matched lines are returned. It leaves gaps around fetching behavior — 'the way a browser does' is ambiguous about whether JavaScript executes — and says nothing about authentication, redirects, or failure modes.

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?

Two sentences, front-loaded with the core action and ending with the return values. There is no filler and every clause adds information.

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 nine-parameter tool with fully documented schema and no output schema, the description covers the action, the side effect of writing a file, and the return shape. The main remaining gap is the absence of any guidance relative to view_source_find, which matters given they overlap.

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 every one of the nine parameters, including mode's enum and the match regex prefix, is already documented in structured fields. The description's mention of 'highlight matches' and the returned path adds nothing beyond that, so the baseline 3 applies.

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 gives a specific verb chain and resource: fetch a page's raw HTML, render it view-source style, highlight matches, and save a PNG. That is clearly distinguishable from a generic page screenshot. It does not, however, distinguish itself from the sibling view_source_find.

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

Usage Guidelines3/5

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

Usage is only implied: an agent can infer this is for capturing a visual of source with highlights, but there is no explicit when-to-use or when-not guidance. The sibling view_source_find is never mentioned, so the agent has no stated rule for choosing between searching source and screenshotting it.

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