Skip to main content
Glama

invoicelens_search_documents

Read-onlyIdempotent

Search ingested invoices semantically to find relevant passages by natural-language query, returning document IDs, filenames, pages, chunk types, and similarity scores for citation.

Instructions

Semantic search over ingested invoices. Returns the top-k passages with doc_id, filename, page, chunk type and similarity score — cite filename and page in answers. Use the doc_id with invoicelens_extract_invoice to read a document's fields precisely.

Input Schema

NameRequiredDescriptionDefault
kNoNumber of passages to return.
queryYesWhat to look for, in natural language, e.g. 'late payment penalty' or 'Acme invoice total'.
doc_idNoRestrict to one document.
collectionNoIndex to use, e.g. 'default' or a per-client name. Lowercase letters, digits, '-', '_'.
chunk_typesNoRestrict to chunk types, e.g. ['totals'] for amounts or ['text'] for terms.

Output Schema

NameRequiredDescriptionDefault
queryYes
resultsYes
collectionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so safety is covered. The description adds behavior the annotations lack: the ranked-passage result shape, the presence of a similarity score, and an explicit citation obligation ("cite filename and page in answers"). It says nothing about empty-result behavior or cost/latency limits, keeping it below 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the operation and result shape, then the workflow handoff and citation rule. No filler, and every clause carries actionable information.

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 and the input schema is fully described, so the description does not need to enumerate fields exhaustively. It still covers purpose, result content, and the follow-up tool, which is everything an agent needs to select and call this 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 100%, so k, query, doc_id, collection and chunk_types are all already documented with examples. The description's only parameter-adjacent signal is "top-k," which restates the k parameter without adding format or default guidance. Baseline 3 applies when the schema carries the semantics.

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 ("Semantic search over ingested invoices") plus the retrieval granularity (top-k passages). It also implicitly distinguishes itself from invoicelens_web_search by scoping to the ingested corpus and from invoicelens_extract_invoice by pointing at it for precise field extraction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a clear next-step rule: take the returned doc_id into invoicelens_extract_invoice when exact fields are needed, which effectively tells the agent when this tool is the wrong final step. It does not state exclusions relative to invoicelens_web_search or invoicelens_company_financials, so the routing is clear but incomplete.

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