Skip to main content
Glama

zulip_send_direct_message

Send direct messages to specific users in Zulip workspaces by specifying recipient email addresses or user IDs and message content.

Instructions

Send a direct message to one or more users

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
recipientsYesEmail addresses or user IDs of recipients
contentYesThe message content to send

Implementation Reference

  • Handler logic for the 'zulip_send_direct_message' tool: parses arguments, validates them, calls the ZulipClient's sendDirectMessage method, and returns the response.
    case "zulip_send_direct_message": {
      const args = request.params.arguments as unknown as SendDirectMessageArgs;
      if (!args.recipients || !args.content) {
        throw new Error(
          "Missing required arguments: recipients and content"
        );
      }
      const response = await zulipClient.sendDirectMessage(
        args.recipients,
        args.content
      );
      return {
        content: [{ type: "text", text: JSON.stringify(response) }],
      };
    }
  • Schema definition for the 'zulip_send_direct_message' tool, including input schema, required fields, and description.
    const sendDirectMessageTool: Tool = {
      name: "zulip_send_direct_message",
      description: "Send a direct message to one or more users",
      inputSchema: {
        type: "object",
        properties: {
          recipients: {
            type: "array",
            items: {
              type: "string",
            },
            description: "Email addresses or user IDs of recipients",
          },
          content: {
            type: "string",
            description: "The message content to send",
          },
        },
        required: ["recipients", "content"],
      },
    };
  • index.ts:538-547 (registration)
    Registration of the 'zulip_send_direct_message' tool (as sendDirectMessageTool) in the list of available tools returned by ListToolsRequest.
    tools: [
      listChannelsTool,
      postMessageTool,
      sendDirectMessageTool,
      addReactionTool,
      getChannelHistoryTool,
      getTopicsTool,
      subscribeToChannelTool,
      getUsersTool,
    ],
  • Helper method in ZulipClient class that performs the actual API call to send a direct message via Zulip.
    async sendDirectMessage(recipients: string[], content: string) {
      try {
        const params = {
          to: recipients,
          type: "private",
          content: content,
        };
        
        return await this.client.messages.send(params);
      } catch (error) {
        console.error("Error sending direct message:", error);
        throw error;
      }
    }
  • TypeScript interface defining the arguments for the send direct message tool.
    interface SendDirectMessageArgs {
      recipients: string[];
      content: string;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('send') but lacks details on permissions required, rate limits, error handling, or what happens upon success (e.g., message ID returned). This is inadequate for a mutation tool with zero annotation coverage.

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 a single, efficient sentence that directly states the tool's function without unnecessary words. It is appropriately sized and front-loaded, with every word earning its place.

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

Completeness2/5

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

Given this is a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain behavioral aspects like authentication needs, potential side effects, or return values, leaving significant gaps for an AI agent to operate effectively.

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 description coverage is 100%, so the input schema already documents both parameters ('recipients' and 'content') with clear descriptions. The tool description adds no additional meaning beyond what the schema provides, meeting the baseline for high schema coverage.

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

Purpose4/5

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

The description clearly states the action ('send') and resource ('direct message to one or more users'), making the tool's purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'zulip_post_message' (which might be for channels), leaving some ambiguity about when to choose one over the other.

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 is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., authentication), exclusions, or comparisons to siblings like 'zulip_post_message', leaving the agent to infer usage context without explicit direction.

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/Monadical-SAS/zulip-mcp'

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