Skip to main content
Glama
elmapicms

elmapicms-mcp-server

Official
by elmapicms

List Collections

list_collections

Retrieve a list of all collections defined in your ElmapiCMS project.

Instructions

List all collections in the project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Tool registration for list_collections. No inputSchema means no parameters. Calls GET /collections via the API client and returns the result as JSON text.
    server.registerTool("list_collections", {
      title: "List Collections",
      description: "List all collections in the project",
    }, async () => {
      const result = await client.get("/collections");
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };
    });
  • The handler function for list_collections. It fetches all collections from the ElmapiCMS API via GET /collections and returns them as formatted JSON text.
    }, async () => {
      const result = await client.get("/collections");
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };
    });
  • The ElmapiClient.get() helper method called by the list_collections handler. Builds a GET request with optional query params, sends it with auth headers, and handles the response.
    async get(
      path: string,
      params?: Record<string, unknown>
    ): Promise<unknown> {
      const url = new URL(`${this.baseUrl}${path}`);
      if (params) {
        const flatPairs = this.flattenParams(params);
        for (const [key, value] of flatPairs) {
          url.searchParams.append(key, value);
        }
      }
    
      const response = await fetch(url.toString(), {
        method: "GET",
        headers: this.headers(),
      });
    
      return this.handleResponse(response);
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4/5.0
Behavior3/5

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

No annotations provided, so description must convey behavioral traits. It states 'list all collections', implying a read-only operation, but does not disclose any side effects, performance notes, or output details.

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

Conciseness5/5

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

Single sentence with no wasted words. Efficient and to the point.

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?

For a simple list tool with no parameters, description covers the essential purpose. However, mentioning the return format or that it returns an array would enhance completeness.

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?

No parameters exist, and schema coverage is 100%. Description doesn't need to add param info; baseline score of 4 applies.

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?

Description clearly states it lists all collections in the project, matching the name and title. It distinguishes from siblings like 'get_collection' which fetches a single collection.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool over alternatives. While the name suggests it lists all collections, there is no mention of when not to use it or comparison with sibling 'get_collection'.

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