Skip to main content
Glama
u9401066

asset-aware-mcp

by u9401066

fetch_document_asset

Extract specific document assets (tables, figures, sections) as markdown or base64 images, with optional resizing for vision AI analysis.

Instructions

Fetch specific content from a document with precision.

Asset Types:

  • "table": Returns table as markdown (with page number)

  • "figure": Returns image as base64 with page number for verification

  • "section": Returns section text content

  • "full_text": Returns entire document as markdown

Args: doc_id: Document identifier asset_type: One of "table", "figure", "section", "full_text" asset_id: Asset ID from manifest (e.g., "tab_1", "fig_1_1", "sec_methods") Use "full" for full_text type max_size: Maximum image dimension (longest edge) for figures. - None (default): Use default 1024px - 0: Return original size (no resize) - N: Resize to Npx longest edge (e.g., 512, 768, 2048)

Returns: For figures: ImageContent that vision AI can directly analyze For others: TextContent in markdown format

Example: # Get Table 1 from document fetch_document_asset("abc123", "table", "tab_1")

# Get figure with default resize (1024px)
fetch_document_asset("abc123", "figure", "fig_2_1")

# Get figure at specific size (512px for smaller context)
fetch_document_asset("abc123", "figure", "fig_2_1", max_size=512)

# Get original image (no resize)
fetch_document_asset("abc123", "figure", "fig_2_1", max_size=0)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
doc_idYes
asset_idNofull
max_sizeNo
max_charsNo
asset_typeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.4.0
    • changedOutput schema / (root)
      Previous value: -{
      -  "$defs": {
      -    "Annotations": {
      -      "description": "Optional annotations the client can use to inform how objects are used or displayed.",
      -      "properties": {
      -        "audience": {
      -          "anyOf": [
      -            {
      -              "items": {
      -                "enum": [
      -                  "user",
      -                  "assistant"
      -                ],
      -                "type": "string"
      -              },
      -              "type": "array"
      -            },
      -            {
      -              "type": "null"
      -            }
      -          ],
      -          "default": null,
      -          "title": "Audience"
      -        },
      -        "lastModified": {
      -          "anyOf": [
      -            {
      -              "type": "string"
      -            },
      -            {
      -              "type": "null"
      -            }
      -          ],
      -          "default": null,
      -          "title": "Lastmodified"
      -        },
      -        "priority": {
      -          "anyOf": [
      -            {
      -              "maximum": 1,
      -              "minimum": 0,
      -              "type": "number"
      -            },
      -            {
      -              "type": "null"
      -            }
      -          ],
      -          "default": null,
      -          "title": "Priority"
      -        }
      -      },
      -      "title": "Annotations",
      -      "type": "object"
      -    },
      -    "ImageContent": {
      -      "description": "An image provided to or from an LLM.",
      -      "properties": {
      -        "_meta": {
      -          "anyOf": [
      -            {
      -              "additionalProperties": true,
      -              "type": "object"
      -            },
      -            {
      -              "type": "null"
      -            }
      -          ],
      -          "default": null,
      -          "title": "Meta"
      -        },
      -        "annotations": {
      -          "anyOf": [
      -            {
      -              "$ref": "#/$defs/Annotations"
      -            },
      -            {
      -              "type": "null"
      -            }
      -          ],
      -          "default": null
      -        },
      -        "data": {
      -          "title": "Data",
      -          "type": "string"
      -        },
      -        "mimeType": {
      -          "title": "Mimetype",
      -          "type": "string"
      -        },
      -        "type": {
      -          "const": "image",
      -          "default": "image",
      -          "title": "Type",
      -          "type": "string"
      -        }
      -      },
      -      "required": [
      -        "data",
      -        "mimeType"
      -      ],
      -      "title": "ImageContent",
      -      "type": "object"
      -    },
      -    "TextContent": {
      -      "description": "Text provided to or from an LLM.",
      -      "properties": {
      -        "_meta": {
      -          "anyOf": [
      -            {
      -              "additionalProperties": true,
      -              "type": "object"
      -            },
      -            {
      -              "type": "null"
      -            }
      -          ],
      -          "default": null,
      -          "title": "Meta"
      -        },
      -        "annotations": {
      -          "anyOf": [
      -            {
      -              "$ref": "#/$defs/Annotations"
      -            },
      -            {
      -              "type": "null"
      -            }
      -          ],
      -          "default": null
      -        },
      -        "text": {
      -          "title": "Text",
      -          "type": "string"
      -        },
      -        "type": {
      -          "const": "text",
      -          "default": "text",
      -          "title": "Type",
      -          "type": "string"
      -        }
      -      },
      -      "required": [
      -        "text"
      -      ],
      -      "title": "TextContent",
      -      "type": "object"
      -    }
      -  },
      -  "properties": {
      -    "result": {
      -      "items": {
      -        "anyOf": [
      -          {
      -            "$ref": "#/$defs/TextContent"
      -          },
      -          {
      -            "$ref": "#/$defs/ImageContent"
      -          }
      -        ]
      -      },
      -      "title": "Result",
      -      "type": "array"
      -    }
      -  },
      -  "required": [
      -    "result"
      -  ],
      -  "title": "fetch_document_assetOutput",
      -  "type": "object"
      -}New value: +null
  2. Changed12 schema fields changedv1.0.1
    • removedInput schema / properties / ctx
      Removed value: -{
      -  "anyOf": [
      -    {},
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Ctx"
      -}
    • removedOutput schema / $defs / Annotations / additionalProperties
      Removed value: -true
    • addedOutput schema / $defs / Annotations / description
      Added value: +"Optional annotations the client can use to inform how objects are used or displayed."
    • addedOutput schema / $defs / Annotations / properties / lastModified
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Lastmodified"
      +}
    • removedOutput schema / $defs / ImageContent / additionalProperties
      Removed value: -true
    • changedOutput schema / $defs / ImageContent / description
      Previous value: -"Image content for a message."New value: +"An image provided to or from an LLM."
    • addedOutput schema / $defs / ImageContent / properties / type / default
      Added value: +"image"
    • changedOutput schema / $defs / ImageContent / required
      Previous value: -[
      -  "type",
      -  "data",
      -  "mimeType"
      -]New value: +[
      +  "data",
      +  "mimeType"
      +]
    • removedOutput schema / $defs / TextContent / additionalProperties
      Removed value: -true
    • changedOutput schema / $defs / TextContent / description
      Previous value: -"Text content for a message."New value: +"Text provided to or from an LLM."
    • addedOutput schema / $defs / TextContent / properties / type / default
      Added value: +"text"
    • changedOutput schema / $defs / TextContent / required
      Previous value: -[
      -  "type",
      -  "text"
      -]New value: +[
      +  "text"
      +]
  3. First observedv0.7.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden and does so well: it discloses table-to-markdown, base64 figures with page numbers, full_text behavior, resizing semantics for max_size, and vision-compatible return content. It omits max_chars behavior and error/not-found cases, but the disclosed behavior is substantial.

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?

The description is well-structured and front-loaded: purpose, asset types, args, returns, then examples. Every major section earns its place, and the examples clarify usage without excessive verbosity.

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 rich in output and resizing details, which is good given the lack of an output schema. However, it is incomplete: max_chars is never explained, asset_id requirements for non-full_text types are only implied, and there is no error, authentication, or not-found behavior mentioned.

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 0%, so the description must explain parameters. It does explain doc_id, asset_type, asset_id, and max_size thoroughly, with defaults and examples. However, max_chars is completely undocumented in both the schema and the description, leaving an entire parameter semantically opaque.

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 and resource ('Fetch specific content from a document') and defines four concrete asset types with their output forms. It is clear and precise, though it does not explicitly differentiate itself from the sibling 'document_asset' or 'section' tools.

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?

The description gives strong internal guidance on which asset_type to use and provides multiple call examples. However, it never states when to prefer this tool over the many sibling tools, nor does it include any exclusions or when-not-to-use guidance.

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