Skip to main content
Glama
vfa-khuongdv

MCP Chatwork Server

by vfa-khuongdv

send_message

Deliver a text message to a designated Chatwork room. Provide the room ID and message content to post updates, notifications, or replies directly.

Instructions

Allows the agent to send messages to a room.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
room_idYesThe unique identifier of the Chatwork room.
bodyYesThe message content to send.

Implementation Reference

  • The tool executor/handler that calls client.sendMessage and formats the response as MCP content.
    export const sendMessageTool = {
      name: "send_message",
      description: "Allows the agent to send messages to a room.",
      schema: SendMessageSchema,
      executor: async (client: ChatworkClient, args: z.infer<typeof SendMessageSchema>) => {
        const result = await client.sendMessage(args.room_id, args.body);
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      },
    };
  • Zod schema defining input validation for send_message tool: room_id (number) and body (string).
    export const SendMessageSchema = z.object({
      room_id: z.number().describe("The unique identifier of the Chatwork room."),
      body: z.string().describe("The message content to send."),
    });
  • src/index.ts:44-52 (registration)
    Registration of the send_message tool with the MCP server, linking name, description, schema, and executor.
    server.tool(
      sendMessageTool.name,
      sendMessageTool.description,
      sendMessageTool.schema.shape,
      async (args) => {
        // @ts-ignore
        return sendMessageTool.executor(client, args);
      }
    );
  • Helper method in ChatworkClient that sends the actual HTTP POST request to Chatwork API to send a message.
    async sendMessage(roomId: number, body: string): Promise<{ message_id: string }> {
      try {
        const response = await this.client.post<{ message_id: string }>(
          `/rooms/${roomId}/messages`,
          new URLSearchParams({ body })
        );
        return response.data;
      } catch (error) {
        if (axios.isAxiosError(error)) {
          throw new Error(`Chatwork API Error (Send Message Room ${roomId}): ${error.message} - ${JSON.stringify(error.response?.data)}`);
        }
        throw error;
      }
    }
  • src/tools/index.ts:3-3 (registration)
    Re-exports the sendMessageTool from the tools barrel module so it can be imported by index.ts.
    export * from "./sendMessage.js";
Behavior2/5

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

With no annotations, the description carries full burden but only states it 'sends messages', implying a write operation. It omits side effects, permission requirements, rate limits, or error behavior, leaving significant gaps for an AI agent.

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?

The description is a single, efficient sentence with no wasted words. However, it could include brief usage guidelines without harming conciseness, so it is very good but not perfect.

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?

For a simple two-parameter tool with no output schema, the description fails to mention return behavior, success indications, or error cases. Given the lack of annotations, this is incomplete for safe invocation.

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%, so both parameters have descriptions in the schema. The description adds no extra meaning beyond what the schema already provides, meeting the baseline but not exceeding it.

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 (send messages) and the target (a room), effectively distinguishing it from sibling tools like delete_message and list_messages. Though it could specify the platform (Chatwork), the input schema context makes it clear.

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 such as delete_message or list_messages. There are no prerequisites, exclusions, or context for when sending is appropriate.

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