Skip to main content
Glama
vfa-khuongdv

MCP Chatwork Server

by vfa-khuongdv

delete_message

Delete any message from a Chatwork room by supplying the room ID and message ID.

Instructions

Delete a message from a room.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
room_idYesThe unique identifier of the Chatwork room.
message_idYesThe unique identifier of the message to delete.

Implementation Reference

  • The main tool definition for 'delete_message'. Defines name, description, schema, and the executor function that calls client.deleteMessage() and returns a formatted response.
    import { ChatworkClient } from "../api/client.js";
    import { DeleteMessageSchema } from "../schemas/messages.js";
    import { z } from "zod";
    
    export const deleteMessageTool = {
      name: "delete_message",
      description: "Delete a message from a room.",
      schema: DeleteMessageSchema,
      executor: async (client: ChatworkClient, args: z.infer<typeof DeleteMessageSchema>) => {
        const { room_id, message_id } = args;
        try {
          const result = await client.deleteMessage(room_id, message_id);
          return {
            content: [
              {
                type: "text" as const,
                text: `Message ${result.message_id} deleted successfully from room ${room_id}.`,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text" as const,
                text: `Failed to delete message: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
            isError: true,
          };
        }
  • Zod schema for DeleteMessageSchema, validating room_id (number) and message_id (string) input parameters.
    export const DeleteMessageSchema = z.object({
      room_id: z.number().describe("The unique identifier of the Chatwork room."),
      message_id: z.string().describe("The unique identifier of the message to delete."),
    });
  • src/index.ts:84-92 (registration)
    Registration of the 'delete_message' tool with the MCP server via server.tool(), using the tool's name, description, schema, and executor.
    server.tool(
      deleteMessageTool.name,
      deleteMessageTool.description,
      deleteMessageTool.schema.shape,
      async (args) => {
        // @ts-ignore
        return deleteMessageTool.executor(client, args);
      }
    );
  • API client method deleteMessage() that sends a DELETE request to /rooms/{roomId}/messages/{messageId} and returns the message_id.
    async deleteMessage(roomId: number, messageId: string): Promise<{ message_id: string }> {
      try {
        const response = await this.client.delete<{ message_id: string }>(
          `/rooms/${roomId}/messages/${messageId}`
        );
        return response.data;
      } catch (error) {
        if (axios.isAxiosError(error)) {
          throw new Error(`Chatwork API Error (Delete Message Room ${roomId}): ${error.message} - ${JSON.stringify(error.response?.data)}`);
        }
        throw error;
      }
    }
  • src/tools/index.ts:7-7 (registration)
    Re-exports the deleteMessage tool module so it can be imported from src/index.ts.
    export * from "./deleteMessage.js";
Behavior2/5

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

No annotations provided. The description fails to disclose that deletion is irreversible, requires specific permissions, or what happens if the message doesn't exist. Insufficient for a destructive operation.

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

Conciseness3/5

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

Single sentence is concise but lacks additional context. It does not provide value beyond the obvious, though it is not overly 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?

No output schema, so description should explain return behavior or confirmation. It omits what the tool returns after deletion, making it incomplete for an agent.

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?

Input schema covers 100% of parameters with descriptions. The description adds no extra meaning beyond stating the action; baseline score of 3 is appropriate.

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 explicitly states the action 'Delete' and the resource 'message from a room', making the purpose clear. It effectively distinguishes from siblings like send_message and list_messages.

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 leaving a room or completing a task. No prerequisites or conditions mentioned.

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/vfa-khuongdv/mcp-chatwork'

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