Skip to main content
Glama

list_tags

Retrieve and manage all tags in your Paperless-NGX instance efficiently. Use filters like name, ordering, and pagination to fetch and cache tags, reducing redundant API calls during sessions.

Instructions

List all tags. IMPORTANT: When a user query may refer to a tag or document type, you should fetch all tags and all document types up front (with a large enough page_size), cache them for the session, and search locally for matches by name or slug before making further API calls. This reduces redundant requests and handles ambiguity between tags and document types efficiently.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
name__icontainsNo
name__iendswithNo
name__iexactNo
name__istartswithNo
orderingNo
pageNo
page_sizeNo

Implementation Reference

  • Executes the list_tags tool: builds query string from input args, fetches tags via PaperlessAPI from /tags/ endpoint, enhances results with matching algorithm details, and returns structured JSON response as text content.
      withErrorHandling(async (args = {}) => {
        if (!api) throw new Error("Please configure API connection first");
        const queryString = buildQueryString(args);
        const tagsResponse = await api.request(
          `/tags/${queryString ? `?${queryString}` : ""}`
        );
        const enhancedResults = enhanceMatchingAlgorithmArray(
          tagsResponse.results || []
        );
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                ...tagsResponse,
                results: enhancedResults,
              }),
            },
          ],
        };
      })
    );
  • Zod schema defining optional input parameters for list_tags: pagination (page, page_size), name-based filters (icontains, iendswith, iexact, istartswith), and ordering.
    {
      page: z.number().optional(),
      page_size: z.number().optional(),
      name__icontains: z.string().optional(),
      name__iendswith: z.string().optional(),
      name__iexact: z.string().optional(),
      name__istartswith: z.string().optional(),
      ordering: z.string().optional(),
    },
  • Registers the list_tags tool on the MCP server, providing name, detailed description advising on caching strategy, input schema, and handler function.
    server.tool(
      "list_tags",
      "List all tags. IMPORTANT: When a user query may refer to a tag or document type, you should fetch all tags and all document types up front (with a large enough page_size), cache them for the session, and search locally for matches by name or slug before making further API calls. This reduces redundant requests and handles ambiguity between tags and document types efficiently.",
      {
        page: z.number().optional(),
        page_size: z.number().optional(),
        name__icontains: z.string().optional(),
        name__iendswith: z.string().optional(),
        name__iexact: z.string().optional(),
        name__istartswith: z.string().optional(),
        ordering: z.string().optional(),
      },
      withErrorHandling(async (args = {}) => {
        if (!api) throw new Error("Please configure API connection first");
        const queryString = buildQueryString(args);
        const tagsResponse = await api.request(
          `/tags/${queryString ? `?${queryString}` : ""}`
        );
        const enhancedResults = enhanceMatchingAlgorithmArray(
          tagsResponse.results || []
        );
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                ...tagsResponse,
                results: enhancedResults,
              }),
            },
          ],
        };
      })
    );
  • src/index.ts:70-70 (registration)
    Top-level invocation of registerTagTools function within the main MCP server setup, which registers the list_tags tool among others.
    registerTagTools(server, api);
Behavior4/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. It discloses key behavioral traits: it's a read operation (implied by 'List'), supports pagination (via 'page_size'), and includes caching strategies to reduce API calls. It doesn't cover error handling or rate limits, but adds substantial context beyond basic listing.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences: one states the purpose, and the other provides detailed usage guidelines. It's front-loaded with the core function but includes verbose caching instructions that might be better suited for general agent guidance rather than tool-specific description. Some redundancy exists in emphasizing efficiency.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, 7 parameters with 0% schema coverage, and no output schema, the description is incomplete. It covers usage context and caching well but lacks parameter explanations and return value details. For a list tool with many filter parameters, this leaves significant gaps in understanding how to invoke it effectively.

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

Parameters2/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 for 7 undocumented parameters. It only mentions 'page_size' indirectly in the caching advice but doesn't explain any parameters like 'name__icontains' or 'ordering'. This leaves most parameter meanings unclear, failing to adequately address the coverage gap.

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 clearly states the tool's purpose: 'List all tags.' This is a specific verb ('List') and resource ('tags'), making the function unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'list_correspondents' or 'list_document_types' beyond the resource name, which is why it's not a 5.

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 description provides explicit guidance on when to use this tool: 'When a user query may refer to a tag or document type, you should fetch all tags and all document types up front...' It mentions caching for efficiency and handling ambiguity with document types, though it doesn't name specific alternative tools. This is comprehensive usage advice.

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

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/baruchiro/paperless-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server