Skip to main content
Glama

browse_documents

Browse library folders level by level to locate and retrieve documents, or use query-based relevance ranking to answer document questions.

Instructions

Primary document retrieval tool. After orienting with get_folder_structure() (when available) — and, for queries that may involve typed attributes, pairing it with get_metadata_schema() so you know which fields metadata mode could filter on — use this for all document-related questions. The bare call returns root-level sub-folders and documents; pass folder_id to drill into a sub-folder level by level. Use sort="relevance" + query for semantic ranking. Do NOT jump to search_documents() first — keyword search and metadata mode are escalation paths, only after browse_documents(sort="relevance") + the persistence retries have failed. browse_documents does not filter by attribute — for typed-attribute queries, escalate to search_documents(mode="metadata").

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "browse_documents"
  }
}

Input Schema

NameRequiredDescriptionDefault
sortNoSort order. "time" (default) sorts by upload date (newest first); "relevance" orders documents by semantic relevance to `query`. Relevance also works inside the read-only shared folders — pass their folder_id — but at the library root it ranks only your own documents.
limitNoNumber of documents to return per page (1-50, default 10)
queryNoSearch query for relevance ranking. Required when sort="relevance".
offsetNoZero-based pagination offset. Pass the value of `next_offset` from the previous response to fetch the next page.
folder_idNoFolder scope (default "root"). Pass a specific folder ID to scope into that folder, or "root" to reference the library root. The read-only "shared-with-me" and "following" folders live at the library root — pass one of those ids to browse them. Copy any folder_id verbatim from a browse/tree response, never construct one. Combine with `recursive` to control breadth.
recursiveNoWhether to include documents from descendant folders. When false (default), returns the direct contents of folder_id along with its sub-folders — prefer this for level-by-level exploration so you retain folder hierarchy context. When true, flattens all descendant documents into one list and omits sub-folders — use only when a non-recursive browse of the target folder returned no relevant results and you need to widen the scope, or the user explicitly requests a flat listing.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.9.0
    • changedInput schema / properties / query / description
      Previous value: -"Search query for relevance ranking. Required when sort=\"relevance\"; must be omitted when sort=\"time\"."New value: +"Search query for relevance ranking. Required when sort=\"relevance\"."
  2. First observedv1.8.2

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the load and does well: it discloses the default root-level result shape, that browsing is level-by-level and read-oriented, and the important limitation that it does not filter by attribute. It stops short of stating read-only guarantees, permission/auth needs, or result-set characteristics beyond pagination, which the schema already covers.

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?

Front-loaded with purpose before the conditional guidance, and each clause carries a distinct instruction. Dense but not padded; the repeated tool-name references (get_folder_structure, search_documents) are load-bearing for routing rather than filler.

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?

No output schema exists, yet the description explains the return shape (sub-folders plus documents) and defers pagination detail to next_offset in the schema. Combined with 100% schema coverage, an agent has enough to invoke and iterate correctly; only auth/permission expectations are absent.

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 adds real meaning by tying sort="relevance" to the requirement for query and by positioning recursive as a widening fallback after a non-recursive browse fails. It also reinforces copying folder_id verbatim rather than constructing one.

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+resource ('Primary document retrieval tool') and explicitly distinguishes itself from search_documents and get_folder_structure. The bare-call vs folder_id drilling behavior is stated concretely, so an agent can tell exactly what this tool returns.

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?

Gives explicit sequencing (orient with get_folder_structure, pair with get_metadata_schema for typed attributes), a clear prohibition ('Do NOT jump to search_documents() first'), and named escalation paths with the failure condition that triggers them. This is a model routing paragraph.

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