Skip to main content
Glama
elmapicms

elmapicms-mcp-server

Official
by elmapicms

Create Entry

create_entry

Creates a new content entry in a specified collection, setting field values and publication status.

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

  • The async handler function that executes the 'create_entry' tool logic: calls client.post with the collection_slug, data, status, and locale parameters and returns JSON result.
    }, 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) }],
      };
    });
  • Input schema for 'create_entry' using Zod: defines collection_slug (string), data (record of unknown), status (optional string: 'published' or 'draft'), and locale (optional string).
    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')"),
    },
  • Registration of the tool as 'create_entry' via server.registerTool(), with title 'Create Entry' and description 'Create a new content entry in a collection'.
    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) }],
      };
    });
  • The client.post method used by create_entry's handler to send the HTTP POST request to the API endpoint.
    async post(path: string, body?: unknown): Promise<unknown> {
      const response = await fetch(`${this.baseUrl}${path}`, {
        method: "POST",
        headers: this.headers(),
        body: body ? JSON.stringify(body) : undefined,
      });
    
      return this.handleResponse(response);
    }
  • src/index.ts:38-39 (registration)
    Top-level registration call that invokes registerContentTools(server, client) from src/index.ts, which in turn registers the create_entry tool.
    registerContentTools(server, client);
    registerAssetTools(server, client);
Behavior2/5

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

No annotations exist, so the description should disclose behavioral traits. It only repeats the basic purpose and offers no details on idempotency, side effects, or return behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence without wasted words, but under-specified. Could include more context without becoming verbose.

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?

With 4 parameters, nested objects, and no output schema, the description is too minimal. It lacks explanation of return values or behavior beyond creation.

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?

Schema description coverage is 100%, so baseline is 3. The description adds no additional meaning beyond the schema.

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 'Create', the resource 'content entry', and the scope 'in a collection'. It distinguishes from sibling tools like delete_entry and update_entry.

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 such as update_entry or list_entries. No prerequisites or context provided.

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