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);
    }
Behavior3/5

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

No annotations exist, so the description is the sole source. It only states the action but does not disclose potential behaviors like authentication requirements, rate limits, or the nature of the return data. However, for a simple list operation, this is marginally acceptable.

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?

The description is extremely concise: one sentence with no fluff. It is front-loaded with the key verb and resource.

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

Completeness2/5

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

Given no output schema, the description should at least hint at what is returned (e.g., 'returns collection names and IDs'). It only says 'list all collections', leaving the return format ambiguous. For a list tool, this is incomplete.

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?

There are no parameters, so baseline score is 4. The description does not need to add parameter details since none exist.

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 lists all collections, with a specific verb and resource. It distinguishes from 'get_collection' (single) and 'create_collection'. However, it does not specify any filtering capabilities, which are absent anyway.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives like 'get_collection' or 'list_entries'. It does not mention that it returns all collections without any filters.

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

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/elmapicms/elmapicms-mcp-server'

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