Skip to main content
Glama

PaperOffice AI

Search documents in DMS

po_documents_search
Read-onlyIdempotent

READ-ONLY. Returns data, changes nothing. Search documents by keyword, filename and metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number, 1-based; values below 1 are normalized to page 1, a page above total_pages returns no documents plus a pagination warning.
debugNoInclude debug info (ranking scores, search timing, embedding distances) in results. Default: false.
limitNoMax results (1-500)
queryYesSearch term (REQUIRED — min 2 characters for keyword search; use * or ** for browse/list mode with workspace_id)
date_toNoFilter: to upload date (YYYY-MM-DD). Filters by created_at (upload date), NOT document issue date.
sort_byNoResult order. relevance (default for keyword search): best match first (0–100 score). modified_desc / modified_asc: last content/metadata change (date_modified). uploaded_desc / uploaded_asc: upload date (date_uploaded). name_asc / name_desc: display/file name. Browse mode (* or empty query) defaults to uploaded_desc unless sort_by is set.
date_fromNoFilter: from upload date (YYYY-MM-DD). Filters by created_at (upload date), NOT document issue date.
search_modeNoSearch strategy. semantic = embeddings only; similarity_threshold filters the result set (no OCR/fulltext fallback). hybrid/intelligent = fused lexical + semantic; threshold applies only to the semantic channel. fulltext = lexical (filename/OCR/entity), threshold is ignored.intelligent
search_scopeNoSearch scope. "current" searches only workspace_id; "all" searches all accessible workspaces while using workspace_id as the security anchor.current
workspace_idYesWorkspace ID (>0). Required by the API. Use po_workspaces_list to choose a valid workspace; never use 0.
document_typeNoFilter: document type — accepts English (invoice, contract, letter, quote, receipt) or German (Rechnung, Vertrag, Brief, Angebot, Quittung). Both languages are matched automatically.
filename_onlyNoFast lane: only search in file_name (skips OCR, entity, meta_fields subqueries). Use when the user clearly asks for a file by name (e.g. "find Q3-report.pdf", "show me the contract called Acme.docx"). Drastically faster on large tenants.
issued_date_toNoFilter: to document issue date (YYYY-MM-DD). Filters by the date printed ON the document (e.g. invoice date).
include_summaryNoInclude AI summary in results (default: true). Set to false for faster, smaller responses.
issued_date_fromNoFilter: from document issue date (YYYY-MM-DD). Filters by the date printed ON the document (e.g. invoice date).
search_budget_msNoOptional per-search soft budget in milliseconds (1-30000, default 8000). When exceeded, expensive sub-sources (OCR/Entity/Semantic) are skipped and _search_quality.partial=true is reported. Use only when explicitly trading latency vs completeness, or in eval scenarios to force the partial path.
signature_statusNoFilter by PaperOffice Sign status from signature_requests (NOT document fulltext). Use with query="*" for workspace browse. Codes: not_signed, has_signature_process (any signature request), signed, pending, declined, expired. Comma-separated string or array for OR filter.
document_type_hintNoOptional canonical document type hint from the agent query analyzer, e.g. invoice, contract, letter, quote, receipt. Used as ranking/filter signal, not as hard-only filter.
include_historicalNoVersioning: include older document versions in the results. Default false = only the current version of each document line (older versions are hidden). Each result carries version, version_count, is_latest_version and latest_pofid.
similarity_thresholdNoOptional semantic similarity threshold (0.0-1.0) for semantic/hybrid search. Use with debug=true for reproducible ranking diagnostics.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
hintNo
pageNo
textNo
limitNo
detailsNo
foldersNo
messageNo
_warningsNo
documentsNoDocument references (pofid, documents_id, display_name, original_file_name, ...)
retryableNo
error_codeNo
http_statusNo
score_scaleNo
search_modeNo
total_pagesNo
total_matchingNoDocuments matching the query/filters
results_on_pageNo
sort_by_appliedNo
_billing_summaryNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already carry readOnlyHint=true, idempotentHint=true, and destructiveHint=false; the description restates this as 'READ-ONLY. Returns data, changes nothing.' It adds no behavioral context beyond the annotations, but it is consistent with them and clearly signals the safety profile.

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 two short sentences with no filler, front-loading the critical read-only signal. Every phrase earns its place and the search scope is stated immediately.

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?

The tool is complex with 20 parameters, but the schema is exceptionally detailed and an output schema exists, so the minimal description is sufficient for correct invocation. The only missing layer is prose-level guidance about when to prefer this over generic or sibling search tools.

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 the input schema already documents all 20 parameters including defaults, enums, constraints, and usage notes. The tool description itself adds no parameter-level meaning, so the baseline 3 applies.

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 precise action (search) on a clear resource (documents in DMS) and lists supported search dimensions (keyword, filename, metadata). It is distinct enough from siblings like po_documents_get or po_documents_text_get, though it does not explicitly contrast itself with them.

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 this is the search entry point ('Search documents by...'), but it gives no explicit when-to-use/when-not-to-use guidance or alternative routing. Correct usage relies mostly on schema hints such as po_workspaces_list for workspace selection and filename_only for name-based lookups.

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