Skip to main content
Glama
elmapicms

elmapicms-mcp-server

Official
by elmapicms

Create Entry

create_entry

Add new content entries to collections in ElmapiCMS, specifying fields, status, and locale for structured content management.

Instructions

Create a new content entry in a collection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collection_slugYesThe collection slug
dataYesObject where keys are field names and values are the content (e.g. { title: 'My Post', slug: 'my-post' })
statusNoPublication status: 'published' or 'draft' (default)
localeNoLocale code (e.g. 'en')

Implementation Reference

  • Complete implementation of the create_entry tool - includes registration, input schema (collection_slug, data, status, locale), and handler logic that POSTs to the client to create a new content entry in a collection
    // ── create_entry ──────────────────────────────────────────────────
    server.registerTool("create_entry", {
      title: "Create Entry",
      description: "Create a new content entry in a collection",
      inputSchema: {
        collection_slug: z.string().describe("The collection slug"),
        data: z
          .record(z.string(), z.unknown())
          .describe(
            "Object where keys are field names and values are the content (e.g. { title: 'My Post', slug: 'my-post' })"
          ),
        status: z
          .string()
          .optional()
          .describe("Publication status: 'published' or 'draft' (default)"),
        locale: z.string().optional().describe("Locale code (e.g. 'en')"),
      },
    }, async ({ collection_slug, data, status, locale }) => {
      const body: Record<string, unknown> = { data };
      if (status) body.status = status;
      if (locale) body.locale = locale;
    
      const result = await client.post(`/${collection_slug}`, body);
      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