Send chat message
wopee_send_chat_messagePost status updates or informational messages to the project chat room as system messages.
Instructions
Send a message to the current project's chat room. Use this to post status updates (e.g., 'Test run started...', 'Analysis complete') or informational messages to the chat. The message will appear as a SYSTEM message in the chat room. Requires WOPEE_PROJECT_UUID to be configured.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | The message content to send to the chat room | |
| contentType | No | The type of message: TEXT for regular messages, STATUS_UPDATE for status notifications | TEXT |
Implementation Reference
- The main tool definition containing the handler function. It fetches the chat room for the project via FetchChatRoom query, then sends the message via SendChatMessage mutation with input fields: roomUuid, content, contentType, sourcePlatform ('CMD'), and authorType ('SYSTEM'). Uses _parseError for error handling.
export const wopeeSendChatMessage = { name: ToolName.WOPEE_SEND_CHAT_MESSAGE, config: { title: "Send chat message", description: "Send a message to the current project's chat room. Use this to post status updates (e.g., 'Test run started...', 'Analysis complete') or informational messages to the chat. The message will appear as a SYSTEM message in the chat room. Requires WOPEE_PROJECT_UUID to be configured.", inputSchema: InputSchema.shape, }, handler: async (input: Input) => { try { const { WOPEE_PROJECT_UUID } = getConfig(); if (!WOPEE_PROJECT_UUID) return { content: [ { type: "text" as const, text: "WOPEE_PROJECT_UUID is not set" }, ], }; // First fetch the chat room for this project const roomResult = await requestClient<{ fetchChatRoom: { uuid: string } | null; }>(FetchChatRoom, { projectUuid: WOPEE_PROJECT_UUID, }); if (!roomResult?.fetchChatRoom) return { content: [ { type: "text" as const, text: "No chat room found for this project", }, ], }; const result = await requestClient<{ sendChatMessage: { uuid: string; content: string; createdAt: string } | null; }>(SendChatMessage, { input: { roomUuid: roomResult.fetchChatRoom.uuid, content: input.content, contentType: input.contentType, sourcePlatform: "CMD", authorType: "SYSTEM", }, }); if (!result?.sendChatMessage) return { content: [ { type: "text" as const, text: "Failed to send message to chat room", }, ], }; return { content: [ { type: "text" as const, text: `Message sent successfully to chat room.`, }, ], }; } catch (error) { return _parseError(error); } }, }; - Input validation schema using Zod: content (string, required) and contentType (enum STATUS_UPDATE | TEXT, defaults to TEXT).
const InputSchema = z.object({ content: z.string().describe("The message content to send to the chat room"), contentType: z .enum(["STATUS_UPDATE", "TEXT"]) .default("TEXT") .describe( "The type of message: TEXT for regular messages, STATUS_UPDATE for status notifications", ), }); - src/tools/index.ts:9-28 (registration)Import and registration of wopeeSendChatMessage in the TOOLS array (line 25) that gets exported to the MCP server.
import { wopeeSendChatMessage } from "./wopee_send_chat_message/index.js"; import { wopeeReadChatHistory } from "./wopee_read_chat_history/index.js"; import { wopeeCreateGithubIssue } from "./wopee_create_github_issue/index.js"; export const TOOLS = [ wopeeCreateBlankSuite, wopeeFetchAnalysisSuites, wopeeFetchExecutedTestCases, wopeeDispatchAnalysis, wopeeDispatchAgent, wopeeFetchArtifact, wopeeUpdateArtifact, wopeeGenerateArtifact, wopeeSendChatMessage, wopeeReadChatHistory, wopeeCreateGithubIssue, ]; - src/tools/shared/types.ts:13-16 (registration)Enum definition mapping ToolName.WOPEE_SEND_CHAT_MESSAGE to the string 'wopee_send_chat_message'.
WOPEE_SEND_CHAT_MESSAGE = "wopee_send_chat_message", WOPEE_READ_CHAT_HISTORY = "wopee_read_chat_history", WOPEE_CREATE_GITHUB_ISSUE = "wopee_create_github_issue", } - SendChatMessage GraphQL mutation and FetchChatRoom GraphQL query used by the handler. SendChatMessage takes SendChatMessageInput and returns uuid, content, contentType, authorType, createdAt.
export const SendChatMessage = ` mutation SendChatMessage($input: SendChatMessageInput!) { sendChatMessage(input: $input) { uuid content contentType authorType createdAt } } `;