Skip to main content
Glama

get-file-data

Read-onlyIdempotent

Fetches wiki files server-side and returns images or text-based original content inline, so sandboxed or network-restricted clients can access files without reaching the wiki host.

Instructions

Fetches a wiki file server-side and returns its content inline, for clients that cannot reach the wiki host (sandboxed or network-restricted). By default returns a scaled rendition sized by width, as an image the model can view: files MediaWiki can rasterize (images, SVG, PDF, DjVu) come back as an image. With format original, returns the contents of a text-based original file, such as SVG, JSON or XML, truncated at 75000 bytes by default. Other types (audio, video, arbitrary binaries) error; for those, and for metadata or a download URL, use get-file.

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": {
      "title": "<title>"
    },
    "name": "get-file-data"
  }
}

Input Schema

NameRequiredDescriptionDefault
wikiNoWiki to target, as a key from the mcp://wikis/ resources (e.g. en.wikipedia.org), or the full mcp://wikis/ URI. Omit to use the default wiki.
titleYesFile title (with or without the "File:" prefix)
widthNoPixel width of the scaled rendition, for the image and text formats. A quality/detail knob: in image mode the model caps image tokens regardless of size, so larger mainly means more detail. Defaults to 1024 (512 when format is "text"); values above 1568 are clamped.
formatNo'image' returns the wiki's rendering of the file as a native image content block the model can view; 'text' returns that rendering's base64 as a text block, for hosts that do not forward image content to the model (base64 text costs far more tokens); 'original' returns the original file's contents as text, for text-based files such as SVG, plain text, JSON or XML. The original file is the upload itself, not its file description page; for that page's wikitext, use get-page.image

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.22.0
    • changedInput schema / properties / format / description
      Previous value: -"'image' returns a native image content block the model can view; 'text' returns the base64 as a text block, for hosts that do not forward image content to the model (base64 text costs far more tokens)."New value: +"'image' returns the wiki's rendering of the file as a native image content block the model can view; 'text' returns that rendering's base64 as a text block, for hosts that do not forward image content to the model (base64 text costs far more tokens); 'original' returns the original file's contents as text, for text-based files such as SVG, plain text, JSON or XML. The original file is the upload itself, not its file description page; for that page's wikitext, use get-page."
    • changedInput schema / properties / format / enum
      Previous value: -[
      -  "image",
      -  "text"
      -]New value: +[
      +  "image",
      +  "text",
      +  "original"
      +]
    • changedInput schema / properties / width / description
      Previous value: -"Pixel width of the scaled rendition. A quality/detail knob: in image mode the model caps image tokens regardless of size, so larger mainly means more detail. Defaults to 1024 (512 when format is \"text\"); values above 1568 are clamped."New value: +"Pixel width of the scaled rendition, for the image and text formats. A quality/detail knob: in image mode the model caps image tokens regardless of size, so larger mainly means more detail. Defaults to 1024 (512 when format is \"text\"); values above 1568 are clamped."
  2. Changed1 schema field changedv0.15.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  3. Addedv0.12.0

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations: it discloses error behavior for unsupported types, the 75000-byte truncation on original text files, the 1568-pixel width clamp, and the token-cost tradeoff of base64 text. These are exactly the operational traits an agent needs before calling.

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?

Front-loads the purpose in the first clause, then layers format behavior and alternatives in a logical order. Three dense sentences with little waste, though a few details (default widths, clamping) restate schema content.

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?

With no output schema, the description carries the return-value burden and does so: image content block, base64 text block, or truncated text, depending on format. Combined with the explicit sibling routing and error semantics, nothing needed to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, but the description adds real meaning: 'width' is framed as a quality/detail knob whose effect is capped by the model's image token limit, and 'format original' is distinguished from the description page. Minor duplication of defaults and clamping that the schema already states keeps it from a 5.

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?

States a specific verb and resource ('Fetches a wiki file server-side and returns its content inline') plus the motivating condition (clients that cannot reach the wiki host). It immediately differentiates from the sibling get-file and enumerates supported types, so an agent can distinguish it without opening any schema.

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?

Gives explicit routing: use get-file for audio, video, arbitrary binaries, metadata, or a download URL, and use get-page for the file description page's wikitext. It also states when-to and when-not-to use format=original versus the default image rendition.

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