Skip to main content
Glama

List documents in a connection

list_documents
Read-onlyIdempotent

Search documents in a connection by name, extension, or folder to locate a file without opening it. Returns metadata and source references for opening or editing.

Instructions

List the documents in a connection without opening them, to find a file the user named. folder is a folder in the connection, "" for its root; nameContains keeps names containing it, ignoring case; extensions is a comma list such as '.docx,.dotx', "" for every extension the connection allows; recursive includes subfolders; templates=true lists the connection's templates folder instead. Returns {connectionId, items: [{source, name, folder, contentType, length, lastModified, isTemplate}], continuation}. Pass an item's source to open_document or edit_document, or as create_document's template source. When continuation is not empty, call again with it and the same arguments for the next page.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "connectionId": "<connectionId>",
      "folder": "<folder>",
      "nameContains": "<nameContains>",
      "extensions": "<extensions>",
      "recursive": "<recursive>",
      "templates": "<templates>",
      "maximumResults": "<maximumResults>",
      "continuation": "<continuation>"
    },
    "name": "list_documents"
  }
}

Input Schema

NameRequiredDescriptionDefault
folderYes
recursiveYes
templatesYes
extensionsYes
connectionIdYes
continuationYes
nameContainsYes
maximumResultsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly, idempotent, non-destructive, and closed-world, and the description adds behavior they cannot express: the exact return object, the pagination contract ('when continuation is not empty, call again with it and the same arguments'), and that this lists metadata without opening documents. That is meaningful context beyond the structured fields.

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 and result shape, and essentially every clause carries information. It is, however, one dense semicolon-chained block that is harder to scan than the same content split into short sentences or lines.

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 an 8-parameter listing tool with no output schema, the description supplies the return shape, the item fields available for downstream use, and the pagination loop. An agent has enough to call it correctly, page it, and hand the result to the next tool without inspecting siblings.

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 description coverage is 0%, so the description must carry the load, and it defines meaning for six of eight parameters: folder ('' = root), nameContains (case-insensitive substring), extensions (comma list format with example, '' = all allowed), recursive, templates, and continuation. connectionId and maximumResults are left undefined, which is the only gap.

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 ('List the documents in a connection') plus the intent ('to find a file the user named') and a scoping constraint ('without opening them'). This distinguishes it from open_document/edit_document, which it names as consumers of its results.

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 use case (finding a file the user named) and explicit downstream routing: pass an item's source to open_document, edit_document, or as create_document's template source. It never states an exclusion condition or when a sibling like find_in_document or list_connections would be the better first call, so it stops short of full when/when-not guidance.

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