Skip to main content
Glama

buddypress_list_groups

Retrieve BuddyPress groups using filters like status, user membership, or search terms to manage community groups through the BuddyPress MCP Server.

Instructions

List BuddyPress groups with optional filters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number (default: 1)
per_pageNoItems per page (default: 20)
searchNoSearch term
statusNoGroup status (public, private, hidden)
user_idNoFilter groups by user membership
group_typeNoGroup type

Implementation Reference

  • Handler logic for executing the buddypress_list_groups tool. Constructs URLSearchParams from input arguments and calls the shared buddypressRequest helper to GET /groups endpoint.
    else if (name === 'buddypress_list_groups') { const params = new URLSearchParams(); if (args.page) params.append('page', String(args.page)); if (args.per_page) params.append('per_page', String(args.per_page)); if (args.search) params.append('search', String(args.search)); if (args.status) params.append('status', String(args.status)); if (args.user_id) params.append('user_id', String(args.user_id)); if (args.group_type) params.append('group_type', String(args.group_type)); result = await buddypressRequest(`/groups?${params}`); }
  • Input schema defining the parameters for the buddypress_list_groups tool, including pagination, search, status, user filter, and group type.
    inputSchema: { type: 'object', properties: { page: { type: 'number', description: 'Page number (default: 1)' }, per_page: { type: 'number', description: 'Items per page (default: 20)' }, search: { type: 'string', description: 'Search term' }, status: { type: 'string', description: 'Group status (public, private, hidden)' }, user_id: { type: 'number', description: 'Filter groups by user membership' }, group_type: { type: 'string', description: 'Group type' }, }, },
  • src/index.ts:184-198 (registration)
    Registration of the buddypress_list_groups tool in the global tools array, which is returned by the ListToolsRequestSchema handler.
    { name: 'buddypress_list_groups', description: 'List BuddyPress groups with optional filters', inputSchema: { type: 'object', properties: { page: { type: 'number', description: 'Page number (default: 1)' }, per_page: { type: 'number', description: 'Items per page (default: 20)' }, search: { type: 'string', description: 'Search term' }, status: { type: 'string', description: 'Group status (public, private, hidden)' }, user_id: { type: 'number', description: 'Filter groups by user membership' }, group_type: { type: 'string', description: 'Group type' }, }, }, },
  • Shared helper utility function for making authenticated requests to BuddyPress REST API, used by all tool handlers including buddypress_list_groups.
    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(); }

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