Send chat message
wopee_send_chat_messagePost status updates or informational messages to the project chat room. Messages appear as system messages to keep the team informed.
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 and handler function for wopee_send_chat_message. The handler fetches the chat room for the configured project UUID, then sends the chat message with the provided content, contentType, sourcePlatform='CMD', and authorType='SYSTEM'. Returns success/failure messages.
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: expects 'content' (string) and optional 'contentType' (enum: STATUS_UPDATE or 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 the wopeeSendChatMessage tool in the TOOLS array (line 25).
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, ]; - GraphQL queries used by the handler: SendChatMessage mutation (lines 233-243) sends a chat message with input fields, and FetchChatRoom query (lines 259-267) fetches the chat room UUID for a project.
// Chat tools export const SendChatMessage = ` mutation SendChatMessage($input: SendChatMessageInput!) { sendChatMessage(input: $input) { uuid content contentType authorType createdAt } } `; export const FetchChatMessages = ` query FetchChatMessages($roomUuid: ID!, $limit: Int) { fetchChatMessages(roomUuid: $roomUuid, limit: $limit) { uuid authorType authorName content contentType sourcePlatform createdAt } } `; export const FetchChatRoom = ` query FetchChatRoom($projectUuid: ID!) { fetchChatRoom(projectUuid: $projectUuid) { uuid contextSummary createdAt } } `; export const CreateGitHubIssue = ` mutation CreateGitHubIssue($projectUuid: ID!, $title: String!, $body: String!, $labels: [String!]) { createGitHubIssue(projectUuid: $projectUuid, title: $title, body: $body, labels: $labels) { url number title } } `; - src/tools/shared/types.ts:13-13 (helper)Enum definition mapping ToolName.WOPEE_SEND_CHAT_MESSAGE to the string 'wopee_send_chat_message'.
WOPEE_SEND_CHAT_MESSAGE = "wopee_send_chat_message",