Skip to main content
Glama

buddypress_create_group

Create new BuddyPress groups with customizable settings including name, description, status, and forum options to build online communities.

Instructions

Create a new group

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
creator_idNoCreator user ID (default: current user)
descriptionNoGroup description
enable_forumNoEnable group forum
nameYesGroup name
statusNoGroup status (public, private, hidden)

Implementation Reference

  • Handler logic for the buddypress_create_group tool. It makes a POST request to the BuddyPress /groups endpoint using the shared buddypressRequest helper with the provided arguments.
    else if (name === 'buddypress_create_group') { result = await buddypressRequest('/groups', 'POST', args); }
  • Input schema definition for the buddypress_create_group tool, specifying parameters like name (required), description, status, enable_forum, and creator_id.
    inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Group name', required: true }, description: { type: 'string', description: 'Group description' }, status: { type: 'string', description: 'Group status (public, private, hidden)' }, enable_forum: { type: 'boolean', description: 'Enable group forum' }, creator_id: { type: 'number', description: 'Creator user ID (default: current user)' }, }, required: ['name'], },
  • src/index.ts:210-224 (registration)
    Registration of the buddypress_create_group tool in the tools array, including name, description, and inputSchema. This array is returned by the list tools handler.
    { name: 'buddypress_create_group', description: 'Create a new group', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Group name', required: true }, description: { type: 'string', description: 'Group description' }, status: { type: 'string', description: 'Group status (public, private, hidden)' }, enable_forum: { type: 'boolean', description: 'Enable group forum' }, creator_id: { type: 'number', description: 'Creator user ID (default: current user)' }, }, required: ['name'], }, },
  • Shared helper function used by all BuddyPress tools, including buddypress_create_group, to make authenticated API requests to the BuddyPress REST API endpoints.
    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