list_rooms
Retrieve a list of all Chatwork rooms you belong to, enabling quick overview and management of your conversations.
Instructions
Retrieves a list of Chatwork rooms the user belongs to.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/listRooms.ts:4-19 (handler)The main tool definition for 'list_rooms'. Contains the executor function that calls client.listRooms() and returns the room list as JSON text content.
export const listRoomsTool = { name: "list_rooms", description: "Retrieves a list of Chatwork rooms the user belongs to.", schema: ListRoomsSchema, executor: async (client: ChatworkClient) => { const rooms = await client.listRooms(); return { content: [ { type: "text" as const, text: JSON.stringify(rooms, null, 2), }, ], }; }, }; - src/schemas/rooms.ts:3-3 (schema)Schema for list_rooms - an empty Zod object (no input parameters required).
export const ListRoomsSchema = z.object({}); - src/index.ts:24-32 (registration)Registration of the tool in the MCP server using server.tool() with name, description, schema, and handler callback.
server.tool( listRoomsTool.name, listRoomsTool.description, listRoomsTool.schema.shape, async (_args) => { // @ts-ignore return listRoomsTool.executor(client); } ); - src/api/client.ts:18-28 (helper)Helper method in ChatworkClient that makes the actual HTTP GET request to /rooms and returns ChatworkRoom[] data.
async listRooms(): Promise<ChatworkRoom[]> { try { const response = await this.client.get<ChatworkRoom[]>("/rooms"); return response.data; } catch (error) { if (axios.isAxiosError(error)) { throw new Error(`Chatwork API Error: ${error.message} - ${JSON.stringify(error.response?.data)}`); } throw error; } } - src/tools/index.ts:1-9 (registration)Re-export of listRoomsTool from the tools barrel module.
export * from "./listRooms.js"; export * from "./listMessages.js"; export * from "./sendMessage.js"; export * from "./getRoomMembers.js"; export * from "./createTask.js"; export * from "./getMyTasks.js"; export * from "./deleteMessage.js"; export * from "./completeTask.js"; export * from "./leaveRoom.js";