Skip to main content
Glama

buddypress_list_group_members

Retrieve and filter members from a specific BuddyPress group using group ID, pagination, and role-based filtering to manage community participation.

Instructions

List members of a specific group

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
group_idYesGroup ID
pageNoPage number (default: 1)
per_pageNoItems per page (default: 20)
rolesNoFilter by roles (admin, mod, member, banned)

Implementation Reference

  • Handler function that destructures arguments, builds query parameters for page, per_page, and roles, and calls the BuddyPress API endpoint `/groups/{group_id}/members` to retrieve the list of group members.
    else if (name === 'buddypress_list_group_members') {
      const { group_id, ...params } = args as any;
      const queryParams = new URLSearchParams();
      if (params.page) queryParams.append('page', String(params.page));
      if (params.per_page) queryParams.append('per_page', String(params.per_page));
      if (params.roles) queryParams.append('roles', String(params.roles));
      result = await buddypressRequest(`/groups/${group_id}/members?${queryParams}`);
    }
  • Tool definition including name, description, and input schema specifying required group_id and optional pagination/role parameters.
    {
      name: 'buddypress_list_group_members',
      description: 'List members of a specific group',
      inputSchema: {
        type: 'object',
        properties: {
          group_id: { type: 'number', description: 'Group ID', required: true },
          page: { type: 'number', description: 'Page number (default: 1)' },
          per_page: { type: 'number', description: 'Items per page (default: 20)' },
          roles: { type: 'string', description: 'Filter by roles (admin, mod, member, banned)' },
        },
        required: ['group_id'],
      },
    },
  • src/index.ts:528-530 (registration)
    Registers the list tools handler which returns the full tools array containing the buddypress_list_group_members tool.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
  • Shared helper function used by all tools, including buddypress_list_group_members, 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?

With no annotations provided, the description carries full burden for behavioral disclosure. While 'List' implies a read operation, it doesn't specify whether this requires authentication, what happens with invalid group IDs, whether results are paginated (though parameters suggest it), or the format of returned data. For a tool with 4 parameters and no output schema, this leaves significant behavioral gaps.

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, clear sentence with zero wasted words. It's front-loaded with the core purpose and doesn't include unnecessary elaboration. Every word earns its place in conveying the essential function.

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?

For a tool with 4 parameters, no annotations, and no output schema, the description is insufficient. It doesn't address authentication requirements, error handling, response format, or how to interpret pagination results. While the schema covers parameter definitions, the behavioral context needed for effective tool invocation is largely missing.

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 all parameters are documented in the schema. The description doesn't add any parameter-specific information beyond what's in the schema (e.g., it doesn't explain role filtering behavior or pagination defaults). This meets the baseline for high schema coverage where the description doesn't need to compensate.

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 ('List') and resource ('members of a specific group'), making the purpose immediately understandable. It distinguishes this tool from 'buddypress_list_members' by specifying group membership, but doesn't explicitly differentiate from 'buddypress_get_group' which might also return member information. The verb+resource combination is specific and accurate.

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 like 'buddypress_list_members' (all members) or 'buddypress_get_group' (which might include member data). There's no mention of prerequisites, error conditions, or comparison with sibling tools. The agent must infer usage from the name and parameters 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