Skip to main content
Glama
laserfiche-mcp

laserfiche-mcp

by adventist-gc

laserfiche_document_find_duplicates

Find byte-identical documents in a Laserfiche folder tree, group duplicate copies, and report recoverable storage; read-only, no deletion or merging.

Instructions

Find byte-identical documents in a folder tree and group them.

Use this to answer "are there duplicate files in here?" or "how much space would deduping this folder recover?" — it downloads nothing for documents whose size doesn't collide with another's, and only hashes the ones that do, so it's usually far cheaper than it sounds. This is a read-only scan: it finds duplicates, it does not delete or merge them — follow up with delete_entry/delete_edoc yourself on whichever copies you decide to remove.

Two-pass approach: first probes every document's size (headers only, no bytes transferred); only documents that share a size with another are then downloaded and hashed (SHA-256). A repository of mostly-distinct documents therefore touches a small fraction of the tree on pass two.

This is a single blocking call with no interim progress — for a large max_entries this can take a while (network round-trips per document plus the downloads pass two triggers). Start with the default and raise max_entries only once you've seen how large the tree is, e.g. via list_folder.

Sibling tools: get_entry_by_path to resolve a path to the folder_id this tool needs; get_document_edoc to download or read a specific document once you've identified which copy to keep; compare_entries to check whether two SIMILAR-but-not-identical documents differ only in metadata.

Returns {"mode": "duplicate_report", "folder_id", "recursive", "walk_truncated": bool, "documents_examined", "documents_hashed", "bytes_downloaded", "total_wasted_bytes", "max_bytes", "groups": [{"sha256", "byte_size", "wasted_bytes", "entries": [{"entry_id", "name"}, ...]}, ...], "skipped": [{"entry_id", "name", "reason"}, ...], "folders_unreadable": [<folder_id>, ...]}. groups is sorted by wasted_bytes descending (biggest recoverable space first). skipped also lists entries with no electronic document (scanned page images): they have no bytes to compare, so they are never grouped, and must not be treated as unique or as duplicates of each other. folders_unreadable lists subfolders the walk couldn't list (usually permissions) — entries under them are NOT included, so a non-empty list means the scan was partial even if walk_truncated is false. On failure returns {"mode": "error", "error": <slug>, "entry_id": <folder_id>} — not_found/auth_failed (bad folder_id) or not_a_folder (folder_id points at a document).

Input Schema

NameRequiredDescriptionDefault
folder_idYesInteger entry ID of the folder to scan. Resolve a path first with get_entry_by_path if you only have a location.
max_bytesNoSkip (don't download or hash) any document larger than this many bytes; it's listed in `skipped` with a reason rather than silently treated as unique. Defaults to LF_EDOC_MAX_BYTES (25 MB).
recursiveNoScan subfolders too. False = only this folder's immediate children.
max_entriesNoStop walking the tree after this many entries (folders + documents). A stop, not a filter — hitting it sets walk_truncated=true rather than silently reporting a partial tree as complete. Defaults to 2000; raise for an exhaustive audit of a larger tree, but expect the call to take proportionally longer since it runs to completion in one request.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.3.0

TDQS

A4.8/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full burden and does so: it declares read-only semantics, explains the two-pass size-then-SHA-256 strategy and why it is cheap, warns it is a single blocking call with no interim progress that can run long, and documents truncation and partial-scan behavior. This is exactly the operational context an agent needs before invoking.

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?

Well front-loaded with the purpose and when-to-use before mechanics, and each section is headed logically. It is on the long side, and the large 'Returns' block partially duplicates the existing output schema, which slightly dilutes conciseness, though the semantic notes (skipped, folders_unreadable) are not pure repetition.

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?

For a multi-parameter scanning tool with an output schema and no annotations, the description covers safety profile, cost/performance expectations, error modes, and return semantics. Nothing an agent needs to call this correctly appears to be missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description goes beyond it by giving tuning strategy: start with the default max_entries and only raise it after gauging tree size via list_folder, and noting max_bytes skips are reported rather than silently treated as unique. Useful strategy beyond the schema, though not syntax-level detail.

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?

Opens with a specific verb and resource: 'Find byte-identical documents in a folder tree and group them.' It explicitly distinguishes itself from compare_entries ('SIMILAR-but-not-identical documents') and from delete_entry/delete_edoc, so an agent can route correctly without opening any 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?

Names the user questions it answers, states clearly it does not delete or merge and points to delete_entry/delete_edoc for follow-up, and lists the right siblings for each adjacent task (get_entry_by_path for path resolution, get_document_edoc for retrieval). Explicit when/when-not coverage.

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