Skip to main content
Glama
elmapicms

elmapicms-mcp-server

Official
by elmapicms

Update Collection

update_collection

Update an existing collection's display name and slug. Provide the current slug, new name, and new slug.

Instructions

Update the name and slug of an existing collection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slugYesCurrent slug of the collection to update
nameYesNew display name
new_slugYesNew slug

Implementation Reference

  • The async handler function that executes the update_collection tool logic. It calls client.put to send name and new_slug to /collections/{slug}.
    }, async ({ slug, name, new_slug }) => {
      const result = await client.put(`/collections/${slug}`, {
        name,
        slug: new_slug,
      });
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };
    });
  • Input schema for update_collection: slug (current slug, required), name (new display name, required), new_slug (new slug, required), all defined as Zod strings.
    inputSchema: {
      slug: z.string().describe("Current slug of the collection to update"),
      name: z.string().describe("New display name"),
      new_slug: z.string().describe("New slug"),
    },
  • Registration of the 'update_collection' tool via server.registerTool, including title 'Update Collection' and description.
    server.registerTool("update_collection", {
      title: "Update Collection",
      description: "Update the name and slug of an existing collection",
      inputSchema: {
        slug: z.string().describe("Current slug of the collection to update"),
        name: z.string().describe("New display name"),
        new_slug: z.string().describe("New slug"),
      },
    }, async ({ slug, name, new_slug }) => {
      const result = await client.put(`/collections/${slug}`, {
        name,
        slug: new_slug,
      });
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };
    });
  • src/index.ts:36-36 (registration)
    Where registerCollectionTools (which registers the update_collection tool) is called from the main entry point.
    registerCollectionTools(server, client);
  • The ElmapiClient.put method used by the update_collection handler to send the PUT request to the API.
    async put(path: string, body?: unknown): Promise<unknown> {
      const response = await fetch(`${this.baseUrl}${path}`, {
        method: "PUT",
        headers: this.headers(),
        body: body ? JSON.stringify(body) : undefined,
      });
    
      return this.handleResponse(response);
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full burden but only says 'update', which implies mutation. It does not disclose side effects, required permissions, idempotency, 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.

Conciseness5/5

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

The description is a single sentence with no unnecessary words, efficiently conveying the core functionality with zero fluff.

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?

Given the absence of output schema and annotations, the description is insufficient. It does not explain return values, prerequisites (e.g., collection existence), or uniqueness constraints for new_slug, leaving gaps for agent decision-making.

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 coverage is 100% with descriptions for all three parameters. The description reiterates 'name and slug' but adds no additional meaning beyond the schema, so baseline score of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('update') and the specific fields impacted (name and slug) on an existing collection, distinguishing it from create_collection and get_collection.

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 like create_collection or reorder_collections. The description does not provide context for selection.

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