Skip to main content
Glama

Parse Invoice

parse_invoice
Read-onlyIdempotent

Parse a receipt or invoice document into structured fields. Uses a quality AI model for accuracy. Use when you need to extract line items, totals, and merchant info from financial documents. For general document text, use extract_text instead. Returns: { invoice: { merchant, date (YYYY-MM-DD), line_items[], subtotal, tax, total }, cited: { : { value, confidence: "high"|"medium"|"low", citations: [{ quote, paragraphs[] }] } } } Example prompts:

  • "Parse this invoice and give me the line items and total."

  • "Extract the merchant, date, and amounts from this receipt."

  • "Read this scanned invoice and return structured data."

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mime_typeYesMIME type of the document. Example: "application/pdf" for scanned invoice PDF, "image/jpeg" for a receipt photo.
document_base64YesBase64-encoded PDF or image of the receipt/invoice (max ~15 MB). Example: "JVBERi0xLjcNJeLjz9MNCj..." (base64-encoded invoice PDF)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
citedYes
invoiceYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "cited": {
      +      "additionalProperties": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "citations": {
      +            "items": {
      +              "additionalProperties": false,
      +              "properties": {
      +                "artifact": {
      +                  "type": "string"
      +                },
      +                "char_end": {
      +                  "type": "number"
      +                },
      +                "char_start": {
      +                  "type": "number"
      +                },
      +                "chunk_id": {
      +                  "type": "string"
      +                },
      +                "confidence": {
      +                  "enum": [
      +                    "high",
      +                    "medium",
      +                    "low"
      +                  ],
      +                  "type": "string"
      +                },
      +                "page": {
      +                  "type": "number"
      +                },
      +                "paragraphs": {
      +                  "items": {
      +                    "type": "number"
      +                  },
      +                  "type": "array"
      +                },
      +                "quote": {
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "quote",
      +                "paragraphs",
      +                "confidence"
      +              ],
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "confidence": {
      +            "enum": [
      +              "high",
      +              "medium",
      +              "low"
      +            ],
      +            "type": "string"
      +          },
      +          "value": {}
      +        },
      +        "required": [
      +          "value",
      +          "confidence",
      +          "citations"
      +        ],
      +        "type": "object"
      +      },
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "invoice": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "date": {
      +          "anyOf": [
      +            {
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        },
      +        "line_items": {
      +          "items": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "description": {
      +                "type": "string"
      +              },
      +              "quantity": {
      +                "anyOf": [
      +                  {
      +                    "type": "number"
      +                  },
      +                  {
      +                    "type": "null"
      +                  }
      +                ]
      +              },
      +              "total": {
      +                "type": "number"
      +              },
      +              "unit_price": {
      +                "anyOf": [
      +                  {
      +                    "type": "number"
      +                  },
      +                  {
      +                    "type": "null"
      +                  }
      +                ]
      +              }
      +            },
      +            "required": [
      +              "description",
      +              "quantity",
      +              "unit_price",
      +              "total"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "merchant": {
      +          "anyOf": [
      +            {
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        },
      +        "subtotal": {
      +          "anyOf": [
      +            {
      +              "type": "number"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        },
      +        "tax": {
      +          "anyOf": [
      +            {
      +              "type": "number"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        },
      +        "total": {
      +          "anyOf": [
      +            {
      +              "type": "number"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        }
      +      },
      +      "required": [
      +        "merchant",
      +        "date",
      +        "line_items",
      +        "subtotal",
      +        "tax",
      +        "total"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "invoice",
      +    "cited"
      +  ],
      +  "type": "object"
      +}
  4. Changed2 schema fields changed
    • changedInput schema / properties / document_base64 / description
      Previous value: -"Base64-encoded PDF or image of the receipt/invoice (max ~15 MB)"New value: +"Base64-encoded PDF or image of the receipt/invoice (max ~15 MB). Example: \"JVBERi0xLjcNJeLjz9MNCj...\" (base64-encoded invoice PDF)"
    • changedInput schema / properties / mime_type / description
      Previous value: -"MIME type: application/pdf | image/jpeg | image/png | image/webp"New value: +"MIME type of the document. Example: \"application/pdf\" for scanned invoice PDF, \"image/jpeg\" for a receipt photo."
  5. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and idempotentHint, so the safety profile is known. The description adds useful context beyond that: it uses a quality AI model for accuracy, and it discloses confidence levels and citations in the output. It omits auth/cost/rate-limit details, so not a 5.

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-loaded with purpose and routing, followed by a structured Returns block. The example prompts are somewhat redundant given the clear purpose but serve as invocation illustrations; overall slightly verbose but efficient.

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?

An output schema exists so return values need no explanation, yet the description still sketches the return shape. Combined with the routing guidance and 100% parameter coverage, an agent has everything needed to call this correctly.

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 both parameters (document_base64, mime_type) are already fully documented with examples and the enum. The description adds no additional parameter syntax or constraints, so the baseline 3 applies.

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 (parse) and resource (receipt or invoice document) with the output (structured fields). It also explicitly distinguishes itself from the sibling extract_text, so an agent can route without opening either 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 an explicit when-to-use ('extract line items, totals, and merchant info from financial documents') and names the alternative for a different need ('For general document text, use extract_text instead'). When and when-not are both covered.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources