Skip to main content
Glama
vfa-khuongdv

MCP Chatwork Server

by vfa-khuongdv

leave_room

Remove an AI agent from a Chatwork room by specifying its unique room ID. Enables automated room cleanup and membership management.

Instructions

Leave a room.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
room_idYesThe unique identifier of the Chatwork room to leave.

Implementation Reference

  • The main tool definition for 'leave_room' including the executor function that calls client.leaveRoom(room_id) and returns a success/error response.
    export const leaveRoomTool = {
      name: "leave_room",
      description: "Leave a room.",
      schema: LeaveRoomSchema,
      executor: async (client: ChatworkClient, args: z.infer<typeof LeaveRoomSchema>) => {
        const { room_id } = args;
        try {
          await client.leaveRoom(room_id);
          return {
            content: [
              {
                type: "text" as const,
                text: `Left room ${room_id} successfully.`,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text" as const,
                text: `Failed to leave room: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
            isError: true,
          };
        }
      },
    };
  • The LeaveRoomSchema Zod schema defining the required 'room_id' (number) input parameter.
    export const LeaveRoomSchema = z.object({
      room_id: z.number().describe("The unique identifier of the Chatwork room to leave."),
    });
  • src/index.ts:104-112 (registration)
    Registration of the leave_room tool with the MCP server using server.tool().
    server.tool(
      leaveRoomTool.name,
      leaveRoomTool.description,
      leaveRoomTool.schema.shape,
      async (args) => {
        // @ts-ignore
        return leaveRoomTool.executor(client, args);
      }
    );
  • The API client helper method 'leaveRoom' that sends a DELETE /rooms/{roomId} request with action_type=leave to the Chatwork API.
    async leaveRoom(roomId: number): Promise<{ action_id: number, score: number }> {
      try {
        const response = await this.client.delete<{ action_id: number, score: number }>(
          `/rooms/${roomId}`,
          {
            data: new URLSearchParams({ action_type: "leave" }),
          }
        );
        return response.data;
      } catch (error) {
        if (axios.isAxiosError(error)) {
          throw new Error(`Chatwork API Error (Leave Room ${roomId}): ${error.message} - ${JSON.stringify(error.response?.data)}`);
        }
        throw error;
      }
Behavior1/5

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

No annotations provided and description fails to disclose any behavioral traits such as permissions, side effects, or irreversibility. The agent cannot assess implications of calling this tool.

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

Conciseness2/5

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

Extremely short but at the cost of clarity. No structure, front-loading is irrelevant because there is minimal content. It sacrifices usefulness for brevity.

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

Completeness1/5

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

With no output schema and no annotations, the description fails to explain the tool's effect, return value, or any constraints. Completely inadequate for a tool with only one parameter.

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 a clear description for room_id. Description adds no extra meaning beyond schema, so baseline score of 3 is appropriate.

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

Purpose2/5

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

Description is 'Leave a room.' which is a tautology of the tool name 'leave_room'. It does not add any specificity about what leaving entails or how it differs from other actions.

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 vs alternatives, no prerequisites or context described. The agent has no information about appropriate scenarios.

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