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

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

No annotations are provided, so the description carries the burden. It indicates a read operation returning a collection, but doesn't disclose potential side effects, permissions, or rate limits. The behavior is clear but lacks extra context.

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, front-loaded sentence with no wasted words. Every part earns its place.

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?

Given the tool's simplicity (one parameter, no output schema), the description is complete. It clearly specifies what is returned and how to specify the collection.

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?

With 100% schema description coverage, the baseline is 3. The description adds minimal extra meaning beyond the schema's parameter description ('by slug' reinforces but does not expand).

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 action ('Get'), the resource ('a single collection'), and the distinguishing feature ('with its full field schema by slug'). This differentiates it from sibling tools like 'list_collections'.

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

Usage Guidelines4/5

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

The description implies usage when needing a specific collection's details, but does not explicitly state when not to use it or mention alternatives. The sibling list provides implicit context.

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