Skip to main content
Glama

buddypress_list_messages

Retrieve and organize user message threads from BuddyPress community sites, filtering by inbox/sentbox, read/unread status, and pagination for efficient management.

Instructions

List message threads

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idNoUser ID to get messages for
boxNoMessage box (inbox, sentbox, notices)
typeNoMessage type (all, read, unread)
pageNoPage number (default: 1)
per_pageNoItems per page (default: 20)

Implementation Reference

  • Handler implementation for the buddypress_list_messages tool. Constructs query parameters from input arguments and makes an authenticated API request to the BuddyPress /messages endpoint.
    else if (name === 'buddypress_list_messages') {
      const params = new URLSearchParams();
      if (args.user_id) params.append('user_id', String(args.user_id));
      if (args.box) params.append('box', String(args.box));
      if (args.type) params.append('type', String(args.type));
      if (args.page) params.append('page', String(args.page));
      if (args.per_page) params.append('per_page', String(args.per_page));
      result = await buddypressRequest(`/messages?${params}`);
  • src/index.ts:403-416 (registration)
    Registration of the buddypress_list_messages tool in the tools array, including name, description, and input schema definition.
    {
      name: 'buddypress_list_messages',
      description: 'List message threads',
      inputSchema: {
        type: 'object',
        properties: {
          user_id: { type: 'number', description: 'User ID to get messages for' },
          box: { type: 'string', description: 'Message box (inbox, sentbox, notices)' },
          type: { type: 'string', description: 'Message type (all, read, unread)' },
          page: { type: 'number', description: 'Page number (default: 1)' },
          per_page: { type: 'number', description: 'Items per page (default: 20)' },
        },
      },
    },
  • Input schema definition for validating arguments to the buddypress_list_messages tool.
    inputSchema: {
      type: 'object',
      properties: {
        user_id: { type: 'number', description: 'User ID to get messages for' },
        box: { type: 'string', description: 'Message box (inbox, sentbox, notices)' },
        type: { type: 'string', description: 'Message type (all, read, unread)' },
        page: { type: 'number', description: 'Page number (default: 1)' },
        per_page: { type: 'number', description: 'Items per page (default: 20)' },
      },
    },
  • Shared helper function used by the tool handler to make authenticated requests to the BuddyPress REST API.
    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 full burden. It states 'List message threads', implying a read-only operation, but doesn't disclose behavioral traits such as authentication needs, rate limits, pagination behavior (beyond parameters), or what the output format looks like. This leaves significant gaps for an agent to understand how the tool behaves.

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 extremely concise with 'List message threads', a single phrase that front-loads the core purpose without waste. Every word earns its place, making it efficient and easy to parse.

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 no annotations, no output schema, and 5 parameters, the description is incomplete. It doesn't cover behavioral aspects like safety, response format, or error handling. For a listing tool with multiple filtering options, more context is needed to guide effective use, leaving the agent with insufficient information.

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 schema already documents all 5 parameters thoroughly. The description adds no additional meaning beyond the schema, such as explaining relationships between parameters (e.g., how 'box' and 'type' interact) or usage examples. Baseline 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.

Purpose3/5

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

The description 'List message threads' clearly states the verb ('List') and resource ('message threads'), providing a basic purpose. However, it doesn't differentiate from siblings like 'buddypress_get_message' (which likely retrieves a single message) or specify what 'threads' means versus individual messages, making it somewhat vague.

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. For example, it doesn't clarify if this is for browsing conversations versus retrieving specific messages (as with 'buddypress_get_message') or how it relates to other listing tools like 'buddypress_list_activities'. The description lacks context for selection.

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