Skip to main content
Glama

buddypress_create_message

Create and send private messages between users on a BuddyPress community site. Specify recipients, subject, and content to facilitate user communication.

Instructions

Create a new message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sender_idNoSender user ID (default: current user)
recipientsYesArray of recipient user IDs
subjectYesMessage subject
messageYesMessage content

Implementation Reference

  • Executes the buddypress_create_message tool by sending a POST request to the BuddyPress /messages endpoint with the provided arguments using the shared buddypressRequest helper.
    else if (name === 'buddypress_create_message') {
      result = await buddypressRequest('/messages', 'POST', args);
    }
  • Input schema defining the parameters for the buddypress_create_message tool, including required recipients, subject, and message.
    inputSchema: {
      type: 'object',
      properties: {
        sender_id: { type: 'number', description: 'Sender user ID (default: current user)' },
        recipients: { type: 'array', items: { type: 'number' }, description: 'Array of recipient user IDs', required: true },
        subject: { type: 'string', description: 'Message subject', required: true },
        message: { type: 'string', description: 'Message content', required: true },
      },
      required: ['recipients', 'subject', 'message'],
    },
  • src/index.ts:428-441 (registration)
    Tool object registration in the tools array, used by listTools handler, including name, description, and schema.
    {
      name: 'buddypress_create_message',
      description: 'Create a new message',
      inputSchema: {
        type: 'object',
        properties: {
          sender_id: { type: 'number', description: 'Sender user ID (default: current user)' },
          recipients: { type: 'array', items: { type: 'number' }, description: 'Array of recipient user IDs', required: true },
          subject: { type: 'string', description: 'Message subject', required: true },
          message: { type: 'string', description: 'Message content', required: true },
        },
        required: ['recipients', 'subject', 'message'],
      },
    },
  • Shared helper function that makes authenticated HTTP requests to the BuddyPress REST API, used by all tool handlers including buddypress_create_message.
    async function buddypressRequest(
      endpoint: string,
      method: string = 'GET',
      body?: any
    ): Promise<any> {
      const url = `${BUDDYPRESS_URL}/wp-json/buddypress/v2${endpoint}`;
      const auth = Buffer.from(`${BUDDYPRESS_USERNAME}:${BUDDYPRESS_PASSWORD}`).toString('base64');
    
      const options: any = {
        method,
        headers: {
          'Authorization': `Basic ${auth}`,
          'Content-Type': 'application/json',
        },
      };
    
      if (body && method !== 'GET') {
        options.body = JSON.stringify(body);
      }
    
      const response = await fetch(url, options);
    
      if (!response.ok) {
        const errorText = await response.text();
        throw new Error(`BuddyPress API Error (${response.status}): ${errorText}`);
      }
    
      return await response.json();
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Create a new message' implies a write operation, but it doesn't specify permissions required, whether it's idempotent, error conditions, or what happens on success (e.g., returns a message ID). For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 ('Create a new message') that directly states the tool's purpose without unnecessary words. It's front-loaded and wastes no space, making it easy for an agent to parse quickly.

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 the complexity of a message creation tool (a mutation with 4 parameters), no annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like authentication needs, error handling, or return values, leaving the agent to guess critical details for correct invocation.

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%, with clear descriptions for all 4 parameters (sender_id, recipients, subject, message). The description doesn't add any meaning beyond what the schema provides—it doesn't explain parameter interactions, constraints, or examples. With high schema coverage, the baseline score of 3 is appropriate as the schema does the heavy lifting.

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 'Create a new message' clearly states the verb ('Create') and resource ('message'), making the purpose immediately understandable. However, it doesn't distinguish this from sibling tools like 'buddypress_delete_message' or 'buddypress_get_message', which would require mentioning it's specifically for creating (not retrieving or deleting) messages.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., user authentication), when not to use it (e.g., for retrieving messages), or how it relates to sibling tools like 'buddypress_list_messages' or 'buddypress_delete_message'. The agent must infer usage from the name alone.

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/vapvarun/buddypress-mcp'

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