Skip to main content
Glama

Send chat message

wopee_send_chat_message

Post 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

TableJSON Schema
NameRequiredDescriptionDefault
contentYesThe message content to send to the chat room
contentTypeNoThe type of message: TEXT for regular messages, STATUS_UPDATE for status notificationsTEXT

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",
        ),
    });
  • 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,
    ];
  • 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
        }
      }
    `;
Behavior3/5

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

The description discloses that the message appears as a SYSTEM message, which is useful behavioral context. However, with no annotations provided, the description could further detail side effects, error handling, or authentication requirements. The information is adequate but not exhaustive.

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

Conciseness5/5

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

The description is three sentences with no filler. It front-loads the primary action and immediately provides usage context. Every sentence adds value.

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

Completeness4/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 covers the essential aspects: what it does, when to use, prerequisite configuration, and message behavior (SYSTEM message). It is slightly lacking in return value details but overall complete for the tool's complexity.

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?

The input schema already describes both parameters (content and contentType) with 100% coverage. The description adds minimal extra semantics beyond stating the message type (SYSTEM). The schema descriptions themselves are clear, so the description's contribution is limited.

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

Purpose5/5

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

Description clearly states the tool sends a message to the current project's chat room, specifying the verb 'send' and resource 'chat message'. It contrasts with the sibling tool wopee_read_chat_history, which is for reading, thus avoiding confusion.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit examples of when to use (posting status updates or informational messages) and notes the prerequisite of configuring WOPEE_PROJECT_UUID. However, it does not mention when not to use or explicitly name alternatives.

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/Wopee-io/wopee-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server