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

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

No annotations are provided, so the description must disclose all behavioral traits. It only states 'update', which implies mutation, but does not mention potential side effects, permission requirements, or reversibility. For a destructive operation, more detail is needed.

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, front-loaded with the action and target, containing no extraneous words. It is highly concise while conveying the core functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the low complexity of the tool (update two fields) and no output schema, the description is minimally adequate. However, it could be improved by mentioning what the tool returns or any prerequisites (e.g., collection existence).

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?

The input schema covers 100% of parameters with descriptions, so the baseline is 3. The description adds no extra meaning beyond the schema, merely restating 'name and slug' without additional clarification or usage examples.

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 tool updates an existing collection's name and slug, distinguishing it from siblings like create_collection (creation) and get_collection (read). The verb 'Update' and resource 'collection' are specific.

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 is provided on when to use this tool versus alternatives. While the sibling list is available, the description lacks any explicit context, exclusions, or when-not scenarios, leaving the agent to infer usage from the tool name alone.

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