Skip to main content
Glama

list_documents

Browse indexed documents one page at a time, optionally filtered by category, to inspect filepaths, categories, and metadata without side effects.

Instructions

List indexed documents one page at a time, optionally filtered by category.

Read-only. No side effects.

Args: category: Optional category filter, matched exactly against each document's category; an empty string, like omitting it, lists every document, and a category without documents returns an empty page (total 0). Call list_categories() to see the categories that hold documents. limit: Maximum number of documents to return (default: 100, max: 200). offset: Number of matching documents to skip (default: 0). For the next page, call again with offset + count until offset reaches total.

Returns: JSON string with total (documents matching the filter), offset, limit, count (documents in this page) and the filepaths, categories, and metadata of this page, ordered by filepath.

Usage: Use to browse what's in the index, one page at a time; to see every document, call again with offset + count until offset reaches total. Use list_categories() first to see which categories hold documents. Use search_knowledge() when you want to find documents by topic rather than browsing the full list. Use get_document() to read a specific file once you have its filepath.

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": "list_documents"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
offsetNo
categoryNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv5.0.1
    • addedInput schema / properties / limit
      Added value: +{
      +  "default": 100,
      +  "title": "Limit",
      +  "type": "integer"
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "default": 0,
      +  "title": "Offset",
      +  "type": "integer"
      +}
  2. Changed2 schema fields changedv4.11.1
    • addedInput schema / properties / category / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / category / type
      Removed value: -"string"
  3. First observedv3.0.0

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so: it declares 'Read-only. No side effects.', documents the empty-string/no-category equivalence, states that a category with no documents returns an empty page with total 0, and specifies ordering by filepath plus the page envelope (total, offset, limit, count).

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 structured with Args/Returns/Usage blocks and front-loaded purpose, but the pagination instruction ('call again with offset + count until offset reaches total') is stated twice, and the Returns block restates much of what the output schema already declares.

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 3-parameter paginated list tool with no annotations, the description covers filter semantics, pagination mechanics, result ordering, empty-result behavior, and sibling routing. Nothing an agent needs in order to call it correctly on the first attempt is missing.

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

Parameters5/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 compensate entirely, and it does: category is defined as an exact match with null/empty-string equivalence and a pointer to list_categories(); limit carries default 100 and max 200; offset carries default 0 and the next-page arithmetic. This is meaning well beyond the bare integer/string types in the schema.

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?

The first sentence gives a specific verb (List), resource (indexed documents), scope (one page at a time), and optional filter (category). It is immediately distinguishable from search_knowledge (topic search) and get_document (single file read), both named later.

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?

The Usage section explicitly routes between four siblings: browse with this tool, list_categories() first to see which categories hold documents, search_knowledge() for topic lookup, get_document() once a filepath is known. It also states the exact pagination loop (offset + count until offset reaches total), leaving nothing to inference.

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