Skip to main content
Glama

capture_to_document

Create step-by-step documents in Markdown, HTML, or PDF from terminal, code, browser, or diff captures, each with optional captions.

Instructions

Create a document (Markdown/HTML/PDF) with embedded step-by-step captures. Each capture is rendered as an image and embedded in the document with optional captions. Output formats: markdown (with image references), HTML (self-contained with base64 images), or PDF (print-quality). Maximum 30 captures per document.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesDocument title
formatNoOutput document format: markdown (image refs), html (self-contained), pdf (print-quality)markdown
outputNoOutput filename (default: auto-generated as 'document-<timestamp>.md/.html/.pdf'). Extension should match format.
capturesYesArray of captures to embed. Each specifies capture type, type-specific parameters, and optional caption.
includeTimestampsNoInclude capture timestamps in the document

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv2.3.4
    • addedInput schema / properties / captures / description
      Added value: +"Array of captures to embed. Each specifies capture type, type-specific parameters, and optional caption."
    • addedInput schema / properties / captures / items / oneOf
      Added value: +[
      +  {
      +    "properties": {
      +      "caption": {
      +        "description": "Caption for this capture in the document",
      +        "maxLength": 200,
      +        "type": "string"
      +      },
      +      "lines": {
      +        "description": "Lines to render. Prefix with '$ ' for prompts.",
      +        "items": {
      +          "type": "string"
      +        },
      +        "maxItems": 1000,
      +        "minItems": 1,
      +        "type": "array"
      +      },
      +      "title": {
      +        "description": "Window title (default: 'step')",
      +        "maxLength": 100,
      +        "type": "string"
      +      },
      +      "type": {
      +        "const": "terminal",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "type",
      +      "lines"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "caption": {
      +        "description": "Caption for this capture in the document",
      +        "maxLength": 200,
      +        "type": "string"
      +      },
      +      "code": {
      +        "description": "Source code to render",
      +        "maxLength": 200000,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "endLine": {
      +        "description": "Last line number (1-indexed, inclusive)",
      +        "maximum": 9007199254740991,
      +        "minimum": 1,
      +        "type": "integer"
      +      },
      +      "language": {
      +        "default": "text",
      +        "description": "Programming language (typescript, python, rust, go, etc.)",
      +        "type": "string"
      +      },
      +      "startLine": {
      +        "description": "First line number (1-indexed)",
      +        "maximum": 9007199254740991,
      +        "minimum": 1,
      +        "type": "integer"
      +      },
      +      "title": {
      +        "description": "Window title (default: 'step')",
      +        "maxLength": 100,
      +        "type": "string"
      +      },
      +      "type": {
      +        "const": "code",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "type",
      +      "code"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "caption": {
      +        "description": "Caption for this capture in the document",
      +        "maxLength": 200,
      +        "type": "string"
      +      },
      +      "endLine": {
      +        "description": "Last line number (1-indexed, inclusive)",
      +        "maximum": 9007199254740991,
      +        "minimum": 1,
      +        "type": "integer"
      +      },
      +      "filePath": {
      +        "description": "Absolute path to file (must be in SNAPMCP_ALLOWED_PATHS)",
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "startLine": {
      +        "description": "First line number (1-indexed)",
      +        "maximum": 9007199254740991,
      +        "minimum": 1,
      +        "type": "integer"
      +      },
      +      "type": {
      +        "const": "file",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "type",
      +      "filePath"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "caption": {
      +        "description": "Caption for this capture in the document",
      +        "maxLength": 200,
      +        "type": "string"
      +      },
      +      "fullPage": {
      +        "default": false,
      +        "description": "Capture full scrollable page",
      +        "type": "boolean"
      +      },
      +      "height": {
      +        "default": 800,
      +        "description": "Viewport height (px)",
      +        "maximum": 4096,
      +        "minimum": 240,
      +        "type": "integer"
      +      },
      +      "type": {
      +        "const": "browser",
      +        "type": "string"
      +      },
      +      "url": {
      +        "description": "URL to capture (http/https, SSRF protected)",
      +        "format": "uri",
      +        "type": "string"
      +      },
      +      "width": {
      +        "default": 1280,
      +        "description": "Viewport width (px)",
      +        "maximum": 3840,
      +        "minimum": 320,
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "type",
      +      "url"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "caption": {
      +        "description": "Caption for this capture in the document",
      +        "maxLength": 200,
      +        "type": "string"
      +      },
      +      "markdown": {
      +        "description": "Markdown content (GFM supported)",
      +        "maxLength": 200000,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "title": {
      +        "description": "Document title (default: 'step')",
      +        "maxLength": 100,
      +        "type": "string"
      +      },
      +      "type": {
      +        "const": "markdown",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "type",
      +      "markdown"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "caption": {
      +        "description": "Caption for this capture in the document",
      +        "maxLength": 200,
      +        "type": "string"
      +      },
      +      "html": {
      +        "description": "HTML content (external resources blocked)",
      +        "maxLength": 200000,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "title": {
      +        "description": "Description for logging (default: 'step')",
      +        "maxLength": 100,
      +        "type": "string"
      +      },
      +      "type": {
      +        "const": "html",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "type",
      +      "html"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "caption": {
      +        "description": "Caption for this capture in the document",
      +        "maxLength": 200,
      +        "type": "string"
      +      },
      +      "diff": {
      +        "description": "Unified diff content (git diff format)",
      +        "maxLength": 500000,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "type": {
      +        "const": "diff",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "type",
      +      "diff"
      +    ],
      +    "type": "object"
      +  }
      +]
    • removedInput schema / properties / captures / items / properties
      Removed value: -{
      -  "caption": {
      -    "description": "Caption for this capture",
      -    "type": "string"
      -  },
      -  "params": {
      -    "additionalProperties": {},
      -    "description": "Parameters for the capture type",
      -    "propertyNames": {
      -      "type": "string"
      -    },
      -    "type": "object"
      -  },
      -  "type": {
      -    "enum": [
      -      "terminal",
      -      "code",
      -      "file",
      -      "browser",
      -      "markdown",
      -      "html",
      -      "diff"
      -    ],
      -    "type": "string"
      -  }
      -}
    • removedInput schema / properties / captures / items / required
      Removed value: -[
      -  "type",
      -  "params"
      -]
    • removedInput schema / properties / captures / items / type
      Removed value: -"object"
    • changedInput schema / properties / format / description
      Previous value: -"Output document format"New value: +"Output document format: markdown (image refs), html (self-contained), pdf (print-quality)"
    • changedInput schema / properties / includeTimestamps / description
      Previous value: -"Include timestamps in document"New value: +"Include capture timestamps in the document"
    • changedInput schema / properties / output / description
      Previous value: -"Output filename (default: auto-generated)"New value: +"Output filename (default: auto-generated as 'document-<timestamp>.md/.html/.pdf'). Extension should match format."
    • addedInput schema / properties / title / maxLength
      Added value: +200
  2. First observedv2.3.2

TDQS

B3.1/5.0
Behavior3/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, and it does add value: it distinguishes output-format semantics (markdown uses image references, HTML is self-contained base64, PDF is print-quality) and states the 30-capture limit. However, it omits that the tool writes a file to disk and gives no hint of path/permission constraints (SNAPMCP_ALLOWED_PATHS appears only inside the captures schema) or SSRF protections for browser captures.

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

Conciseness3/5

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

The description is appropriately sized and front-loaded with the primary purpose in the first sentence. However, the third and fourth sentences ('Output formats: ...' and 'Maximum 30 captures per document.') duplicate information already present in the input schema's format enum descriptions and captures maxItems, so they do not fully earn their 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?

This is a complex tool with 5 top-level parameters and 7 capture variants inside the captures array. Although the schema is rich and carries most of the load, the description provides no usage guidance versus siblings, no indication of whether the result is returned or written to disk, and no mention of file-output constraints. It is minimally viable but has clear gaps.

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 marginal value beyond the schema: 'rendered as an image' clarifies the rendering behavior for captures, but the format descriptions and 30-capture maximum simply restate what the format enum and captures maxItems already declare. No parameter meaning is lost, but nothing substantial is gained.

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 names a specific verb ('Create') and resource ('a document') and clarifies that each capture is rendered as an image and embedded, with optional captions. This differentiates it from the sibling capture_* tools, which produce single captures rather than composite documents, though it never names a sibling explicitly.

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 does not state when to choose this tool over capture_markdown, capture_browser, capture_pdf, or the other siblings. The 'step-by-step captures' wording implies an assembly/batching scenario and the 30-capture ceiling hints at scale, but there is no explicit when-to-use, when-not-to-use, or named alternative, leaving the agent to infer the use case.

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