Skip to main content
Glama

invoicelens_ingest_document

Idempotent

Ingest invoice PDFs and prepare them for semantic search. This tool parses documents, using hybrid chunking to separate tables, headers, and totals into discrete data units for FAISS indexing.

Instructions

Parse a PDF, split it with hybrid chunking (tables, header fields, totals and text kept as separate chunks), embed the chunks and store them in the FAISS index.

Ingesting the same file again replaces its previous version (doc_id is a content hash). Returns the doc_id plus chunk counts by type.

Input Schema

NameRequiredDescriptionDefault
pathNoPath to a PDF on the server's filesystem (local/stdio use only).
filenameNoDisplay name, e.g. 'acme_march.pdf'. Defaults to the file name or PDF title.
collectionNoIndex to use, e.g. 'default' or a per-client name. Lowercase letters, digits, '-', '_'.
pdf_base64NoThe PDF file content, base64-encoded. Use this when the server is remote.

Output Schema

NameRequiredDescriptionDefault
pagesYes
chunksYes
doc_idYesStable id (content hash) — pass to search or extract
embedderYes
filenameYes
collectionYes
chunks_by_typeYes
replaced_existingYesTrue if this exact file was already ingested and was re-indexed

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare non-read-only, idempotent, non-destructive, closed-world. The description adds genuinely new behavioral facts: re-ingestion overwrites the prior version, doc_id is a content hash (which explains the idempotency), and what the response contains. It omits cost/time characteristics of embedding, which is the main operational unknown.

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?

Two short paragraphs, front-loaded with the pipeline and followed by the replace semantics. The trailing 'Returns the doc_id plus chunk counts by type' is slightly redundant given an output schema exists, but it is one short clause.

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?

With annotations covering safety/idempotency, a full output schema, and 100% parameter documentation, the description only needed to supply the write semantics and overwrite behavior, which it does. Missing only environmental notes such as index persistence or expected latency.

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 path, filename, collection and pdf_base64 are already fully documented with defaults and constraints. The description adds no parameter-level guidance, so the baseline of 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 chain (parse, split, embed, store) on a specific resource (PDF into a FAISS index) with the chunking strategy named. It is immediately distinguishable from retrieval siblings such as search_documents and from extract_invoice, which does not write to the index.

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 implies the ingestion use case and covers the re-ingest case ('Ingesting the same file again replaces its previous version'), but never says when to prefer this over extract_invoice or which of path/pdf_base64 to choose in a given deployment. Usage is inferable rather than stated.

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