Skip to main content
Glama
elmapicms

elmapicms-mcp-server

Official
by elmapicms

Get Collection

get_collection

Retrieve a complete collection including its field schema by specifying the collection slug, enabling structured data access from ElmapiCMS.

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

  • Complete implementation of get_collection tool: registration with title, description, input schema, and the handler function that makes a GET request to /collections/{slug} and returns JSON formatted results
    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 definition for get_collection tool: accepts a slug parameter (string) describing the collection slug (e.g., 'blog-posts')
    inputSchema: {
      slug: z.string().describe("The collection slug (e.g. 'blog-posts')"),
    },
  • Handler function that executes get_collection logic: destructures slug from input, makes GET request to /collections/${slug}, and returns the result as formatted JSON text content
    }, async ({ slug }) => {
      const result = await client.get(`/collections/${slug}`);
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };
    });

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