Skip to main content
Glama

capture_code

Create syntax-highlighted code screenshots with line numbers and theme-aware colors for documentation, tutorials, and sharing code snippets.

Instructions

Generate a syntax-highlighted code screenshot using Shiki (50+ languages, 27 themes). Renders code with line numbers, theme-aware colors, and optional window chrome. Ideal for code documentation, tutorials, and sharing snippets with authentic IDE-like appearance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesSource code to render. Maximum 200KB.
titleNoWindow title shown in the title bar (e.g., 'src/main.ts', 'example.py')code
outputNoOutput filename (default: auto-generated as 'code-<timestamp>.png' or '.jpeg' based on SNAPMCP_FORMAT). Include extension to override format.
endLineNoLast line number to show in the gutter (1-indexed, inclusive). Must be >= startLine if both provided.
languageNoProgramming language for highlighting. Supports 50+ languages: typescript, javascript, python, rust, go, java, c, cpp, csharp, ruby, php, swift, kotlin, sql, json, yaml, markdown, html, css, bash, dockerfile, toml, xml, graphql, and many more. Use 'text' for plain text.text
startLineNoFirst line number to show in the gutter (1-indexed). Use with endLine to show a code range.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv2.3.4
    • changedInput schema / properties / code / description
      Previous value: -"Source code to render"New value: +"Source code to render. Maximum 200KB."
    • addedInput schema / properties / code / maxLength
      Added value: +200000
    • changedInput schema / properties / endLine / description
      Previous value: -"Last line number to show in the gutter"New value: +"Last line number to show in the gutter (1-indexed, inclusive). Must be >= startLine if both provided."
    • changedInput schema / properties / language / description
      Previous value: -"Programming language for highlighting"New value: +"Programming language for highlighting. Supports 50+ languages: typescript, javascript, python, rust, go, java, c, cpp, csharp, ruby, php, swift, kotlin, sql, json, yaml, markdown, html, css, bash, dockerfile, toml, xml, graphql, and many more. Use 'text' for plain text."
    • changedInput schema / properties / output / description
      Previous value: -"Output filename (default: auto-generated)"New value: +"Output filename (default: auto-generated as 'code-<timestamp>.png' or '.jpeg' based on SNAPMCP_FORMAT). Include extension to override format."
    • changedInput schema / properties / startLine / description
      Previous value: -"First line number to show in the gutter"New value: +"First line number to show in the gutter (1-indexed). Use with endLine to show a code range."
    • changedInput schema / properties / title / description
      Previous value: -"Window title"New value: +"Window title shown in the title bar (e.g., 'src/main.ts', 'example.py')"
    • addedInput schema / properties / title / maxLength
      Added value: +100
  2. First observedv2.3.2

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses rendering behavior such as line numbers, theme-aware colors, and optional window chrome, but it does not mention side effects like creating an output file, where it is written, or how themes and window chrome are controlled given the schema has no parameters for them. This leaves some ambiguity about the actual tool behavior.

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?

Three sentences with a clear hierarchy: action, features, use cases. It is appropriately sized, though the closing phrase 'authentic IDE-like appearance' is slightly promotional and the mention of 27 themes is not reflected in the input schema.

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?

The description is adequate for invoking the tool: it explains what is rendered and for what use cases, and the schema covers all parameters. However, with no output schema, the tool description does not state what the tool returns, such as a file path or confirmation, and it does not clarify output-side behavior. This is a gap for a tool with no annotations and no output schema.

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 schema already documents all parameters sufficiently. The tool description adds high-level context about languages and themes but does not explain individual parameters beyond what the schema provides, so it meets the baseline for high schema coverage.

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 clause, 'Generate a syntax-highlighted code screenshot using Shiki,' names a specific action and resource. It clearly distinguishes this tool from siblings like capture_terminal or capture_markdown by focusing on code rendering with line numbers and IDE-like styling.

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

Usage Guidelines4/5

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

The description provides clear context: 'Ideal for code documentation, tutorials, and sharing snippets.' It does not explicitly list exclusions or alternatives, but the use cases are concrete enough for an agent to select this tool for code-screenshot needs.

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