Skip to main content
Glama

update_comment

Update a comment's content by providing discussion and comment IDs along with a JSON message array. Modify existing comments in Storyblok discussions.

Instructions

Updates a comment in a discussion via the Storyblok Management API.

Required:

  • discussion_id: Numeric ID of the discussion.

  • comment_id: Numeric ID of the comment.

Payload:

  • message_json: Required. Array of message objects, each with keys "type", "text", "attrs".

  • message: Optional string or null.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
discussion_idYesNumeric ID of the discussion
comment_idYesNumeric ID of the comment
message_jsonYesRequired. Array of message objects, each with keys "type", "text", "attrs"
messageNoOptional string or null

Implementation Reference

  • The handler function for the update_comment tool. Calls apiPut to the Storyblok Management API endpoint /discussions/{discussion_id}/comments/{comment_id} with a payload containing message_json (array of message objects) and optional message string. Returns JSON response or error.
      // Tool: update_comment
      server.tool(
        'update_comment',
        `Updates a comment in a discussion via the Storyblok Management API.
    
    Required:
    - discussion_id: Numeric ID of the discussion.
    - comment_id: Numeric ID of the comment.
    
    Payload:
    - message_json: Required. Array of message objects, each with keys "type", "text", "attrs".
    - message: Optional string or null.`,
        {
          discussion_id: z.number().describe('Numeric ID of the discussion'),
          comment_id: z.number().describe('Numeric ID of the comment'),
          message_json: z
            .array(z.record(z.unknown()))
            .describe('Required. Array of message objects, each with keys "type", "text", "attrs"'),
          message: z.string().optional().describe('Optional string or null'),
        },
        async ({ discussion_id, comment_id, message_json, message }) => {
          try {
            const payload: { comment: { message_json: Record<string, unknown>[]; message?: string } } = {
              comment: {
                message_json,
              },
            };
            if (message !== undefined) {
              payload.comment.message = message;
            }
            const data = await apiPut(`/discussions/${discussion_id}/comments/${comment_id}`, payload);
            return createJsonResponse(data);
          } catch (error) {
            if (error instanceof APIError) {
              return createErrorResponse(error);
            }
            throw error;
          }
        }
      );
  • Input schema for update_comment tool: discussion_id (number), comment_id (number), message_json (array of record objects), and optional message (string). Defined using Zod.
      // Tool: update_comment
      server.tool(
        'update_comment',
        `Updates a comment in a discussion via the Storyblok Management API.
    
    Required:
    - discussion_id: Numeric ID of the discussion.
    - comment_id: Numeric ID of the comment.
    
    Payload:
    - message_json: Required. Array of message objects, each with keys "type", "text", "attrs".
    - message: Optional string or null.`,
        {
          discussion_id: z.number().describe('Numeric ID of the discussion'),
          comment_id: z.number().describe('Numeric ID of the comment'),
          message_json: z
            .array(z.record(z.unknown()))
            .describe('Required. Array of message objects, each with keys "type", "text", "attrs"'),
          message: z.string().optional().describe('Optional string or null'),
        },
        async ({ discussion_id, comment_id, message_json, message }) => {
          try {
            const payload: { comment: { message_json: Record<string, unknown>[]; message?: string } } = {
              comment: {
                message_json,
              },
            };
            if (message !== undefined) {
              payload.comment.message = message;
            }
            const data = await apiPut(`/discussions/${discussion_id}/comments/${comment_id}`, payload);
            return createJsonResponse(data);
          } catch (error) {
            if (error instanceof APIError) {
              return createErrorResponse(error);
            }
            throw error;
          }
        }
      );
  • Registration of the update_comment tool via server.tool('update_comment', ...) inside the registerDiscussions function.
      // Tool: update_comment
      server.tool(
        'update_comment',
        `Updates a comment in a discussion via the Storyblok Management API.
    
    Required:
    - discussion_id: Numeric ID of the discussion.
    - comment_id: Numeric ID of the comment.
    
    Payload:
    - message_json: Required. Array of message objects, each with keys "type", "text", "attrs".
    - message: Optional string or null.`,
        {
          discussion_id: z.number().describe('Numeric ID of the discussion'),
          comment_id: z.number().describe('Numeric ID of the comment'),
          message_json: z
            .array(z.record(z.unknown()))
            .describe('Required. Array of message objects, each with keys "type", "text", "attrs"'),
          message: z.string().optional().describe('Optional string or null'),
        },
        async ({ discussion_id, comment_id, message_json, message }) => {
          try {
            const payload: { comment: { message_json: Record<string, unknown>[]; message?: string } } = {
              comment: {
                message_json,
              },
            };
            if (message !== undefined) {
              payload.comment.message = message;
            }
            const data = await apiPut(`/discussions/${discussion_id}/comments/${comment_id}`, payload);
            return createJsonResponse(data);
          } catch (error) {
            if (error instanceof APIError) {
              return createErrorResponse(error);
            }
            throw error;
          }
        }
      );
  • The registerDiscussions function that registers all discussion tools including update_comment.
    export function registerDiscussions(server: McpServer): void {
  • Import of registerDiscussions from './discussions.js' in the tool aggregator.
    import { registerDiscussions } from './discussions.js';
Behavior2/5

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

No annotations are provided, and the description only states 'Updates a comment', which implies a write operation but does not disclose side effects, permissions, or whether the update is a full replacement or merge. The missing behavioral details lower transparency.

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 very concise and well-structured, using bullet points for required and payload sections. No unnecessary words.

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 tool's complexity (4 params, no output schema, no annotations), the description provides basic information but lacks context on return values, error conditions, and when to use among siblings. It is adequate but not comprehensive.

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?

With 100% schema description coverage, the description adds minimal extra meaning beyond the schema. It reiterates required fields and specifies keys for message_json, but does not provide new context not already in 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 action ('Updates a comment') and the resource ('comment in a discussion'), and differentiates from siblings like create_comment and delete_comment by specifying 'update'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description lists required parameters but does not provide explicit guidance on when to use this tool vs alternatives (e.g., comparing with edit operations or noting prerequisites like having a comment_id).

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/hypescale/storyblok-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server