Skip to main content
Glama
elmapicms

elmapicms-mcp-server

Official
by elmapicms

Get Collection

get_collection

Retrieve a single collection and its complete field schema using its unique slug.

Instructions

Get a single collection with its full field schema by slug

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slugYesThe collection slug (e.g. 'blog-posts')

Implementation Reference

  • The handler function for the 'get_collection' tool. It takes a slug parameter via destructuring, makes a GET request to `/collections/${slug}` using the ElmapiClient, and returns the result as JSON text content.
    // ── get_collection ────────────────────────────────────────────────
    server.registerTool("get_collection", {
      title: "Get Collection",
      description:
        "Get a single collection with its full field schema by slug",
      inputSchema: {
        slug: z.string().describe("The collection slug (e.g. 'blog-posts')"),
      },
    }, async ({ slug }) => {
      const result = await client.get(`/collections/${slug}`);
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };
    });
  • Input schema for 'get_collection' defined within the registration call. Requires a single 'slug' parameter of type string, documented with 'The collection slug (e.g. 'blog-posts')'.
    inputSchema: {
      slug: z.string().describe("The collection slug (e.g. 'blog-posts')"),
    },
  • Registration of the 'get_collection' tool via server.registerTool(), with title 'Get Collection' and description 'Get a single collection with its full field schema by slug'.
    server.registerTool("get_collection", {
      title: "Get Collection",
      description:
        "Get a single collection with its full field schema by slug",
      inputSchema: {
        slug: z.string().describe("The collection slug (e.g. 'blog-posts')"),
      },
    }, async ({ slug }) => {
      const result = await client.get(`/collections/${slug}`);
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };
    });
  • src/index.ts:36-39 (registration)
    Top-level registration call that invokes registerCollectionTools(server, client), which registers all collection tools including 'get_collection'.
    registerCollectionTools(server, client);
    registerFieldTools(server, client);
    registerContentTools(server, client);
    registerAssetTools(server, client);

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4/5.0
Behavior4/5

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

The description discloses that the tool performs a read operation and returns the full field schema, which provides behavioral context beyond the schema's parameter description. However, it does not mention error handling, authentication, or rate limits, which would be expected for a complete behavioral profile.

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 a single, efficient sentence that conveys the essential information without any redundant or extraneous content.

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 get-by-slug tool, the description adequately covers the return content (full field schema) and the required parameter. It does not mention potential errors or prerequisites, but the combination of low parameter count and clear purpose keeps it reasonably complete.

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

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema provides 100% description coverage for the single parameter (slug). The tool description merely echoes 'by slug' without adding new semantic meaning, so it does not improve beyond the baseline.

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 description clearly states the verb ('Get'), the resource ('a single collection'), and the identifier ('by slug'). It also specifies the return includes the full field schema. This distinguishes it from sibling tools like list_collections and create_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?

The description implies use when you need a single collection by slug, but it does not explicitly contrast with alternative tools such as list_collections for retrieving multiple collections or get_project for project-level data. No when-not guidance is provided.

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