buddypress_list_components
View active BuddyPress components to understand which community features are currently enabled on your WordPress site.
Instructions
List active BuddyPress components
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:727-729 (handler)Handler for the 'buddypress_list_components' tool. Executes by calling the shared 'buddypressRequest' helper with the '/components' endpoint to retrieve active BuddyPress components.else if (name === 'buddypress_list_components') { result = await buddypressRequest('/components'); }
- src/index.ts:505-511 (registration)Tool registration in the 'tools' array, defining the name, description, and empty input schema (no parameters required). This is used by the ListToolsRequestHandler.name: 'buddypress_list_components', description: 'List active BuddyPress components', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:507-510 (schema)Input schema definition for the tool, specifying an object with no required properties.inputSchema: { type: 'object', properties: {}, },
- src/index.ts:18-46 (helper)Shared helper function used by all BuddyPress tools, including this one, to make authenticated HTTP 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(); }