Skip to main content
Glama

Analyze invoice text

analyze_invoice_text
Read-onlyIdempotent

Processes the filenames and invoice text you supply to extract common fields, check dates and subtotal-plus-tax arithmetic, flag likely duplicates, and return the derived records and review summary. Invoice Table does not store the tool input or output after the response. Human source review is required.

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": {
      "documents": "<documents>"
    },
    "name": "analyze_invoice_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
documentsYes

Output Schema

NameRequiredDescriptionDefault
recordsYes
summaryYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "records": {
      +      "items": {
      +        "additionalProperties": true,
      +        "properties": {
      +          "category": {
      +            "type": "string"
      +          },
      +          "confidence": {
      +            "type": "number"
      +          },
      +          "currency": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "dueDate": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "duplicate": {
      +            "type": "boolean"
      +          },
      +          "duplicateOf": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "filename": {
      +            "type": "string"
      +          },
      +          "invoiceDate": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "invoiceNumber": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "issues": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          },
      +          "poNumber": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "reviewReasons": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          },
      +          "reviewStatus": {
      +            "enum": [
      +              "ready",
      +              "review",
      +              "blocked",
      +              "duplicate"
      +            ],
      +            "type": "string"
      +          },
      +          "subtotal": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "tax": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "total": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "valid": {
      +            "type": "boolean"
      +          },
      +          "vendor": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "warnings": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          }
      +        },
      +        "required": [
      +          "filename",
      +          "category",
      +          "duplicate",
      +          "issues",
      +          "warnings",
      +          "confidence",
      +          "valid",
      +          "reviewStatus",
      +          "reviewReasons"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "summary": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "accountingEligibleCount": {
      +          "type": "integer"
      +        },
      +        "arithmeticCheckedCount": {
      +          "type": "integer"
      +        },
      +        "arithmeticMismatchCount": {
      +          "type": "integer"
      +        },
      +        "blockedCount": {
      +          "type": "integer"
      +        },
      +        "duplicateCount": {
      +          "type": "integer"
      +        },
      +        "invoiceCount": {
      +          "type": "integer"
      +        },
      +        "readyCount": {
      +          "type": "integer"
      +        },
      +        "reviewCount": {
      +          "type": "integer"
      +        },
      +        "totalsByCurrency": {
      +          "additionalProperties": {
      +            "type": "number"
      +          },
      +          "type": "object"
      +        }
      +      },
      +      "required": [
      +        "invoiceCount",
      +        "readyCount",
      +        "reviewCount",
      +        "blockedCount",
      +        "duplicateCount",
      +        "arithmeticCheckedCount",
      +        "arithmeticMismatchCount",
      +        "accountingEligibleCount",
      +        "totalsByCurrency"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "records",
      +    "summary"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already establish that the operation is read-only, idempotent, non-destructive, and closed-world. The description adds meaningful behavioral context beyond that: it enumerates the analysis steps, states that Invoice Table does not retain input or output after the response, and warns that human source review is required.

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 three sentences, front-loaded with the main action and followed by two important operational notes. Every sentence adds useful information, with no redundant restatement of the title or annotations.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that an output schema exists, the description need not explain return values. It covers the core processing behavior, data retention, and review requirement well. The main missing context is explicit sibling routing and parameter constraints, but overall it is sufficient to call the tool 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 0%, so the description must carry parameter meaning. It partially does by saying it processes supplied filenames and invoice text, which maps to the documents array. However, it does not mention the 1–25 item limit or that each document must contain both filename and text, so the schema still carries most of the structural burden without descriptive support.

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 states a specific verb and resource: processing supplied filenames and invoice text to extract fields, check dates and arithmetic, flag duplicates, and return derived records plus a review summary. It is clear what the tool does, but it does not explicitly differentiate itself from siblings like validate_invoice_records or export_invoice_records.

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?

Usage is implied by the input description ('filenames and invoice text you supply') and the stated analysis outputs, but there is no explicit guidance on when to use this tool instead of validate_invoice_records or export_invoice_records. No exclusions or preconditions are given.

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