Skip to main content
Glama

buddypress_list_xprofile_fields

Retrieve BuddyPress extended profile fields to access user profile data and structure. Filter by field groups or include field data for comprehensive profile management.

Instructions

List XProfile fields

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fetch_field_dataNoInclude field data
profile_group_idNoFilter by field group ID

Implementation Reference

  • Handler function that executes the tool by building query parameters from the input arguments (profile_group_id and fetch_field_data) and making an authenticated GET request to the BuddyPress XProfile fields API endpoint.
    else if (name === 'buddypress_list_xprofile_fields') { const params = new URLSearchParams(); if (args.profile_group_id) params.append('profile_group_id', String(args.profile_group_id)); if (args.fetch_field_data !== undefined) params.append('fetch_field_data', String(args.fetch_field_data)); result = await buddypressRequest(`/xprofile/fields?${params}`); }
  • src/index.ts:315-325 (registration)
    Registration of the tool in the tools array, specifying the name, description, and input schema.
    { name: 'buddypress_list_xprofile_fields', description: 'List XProfile fields', inputSchema: { type: 'object', properties: { profile_group_id: { type: 'number', description: 'Filter by field group ID' }, fetch_field_data: { type: 'boolean', description: 'Include field data' }, }, }, },
  • Input schema definition for the tool, defining optional parameters profile_group_id (number) and fetch_field_data (boolean).
    inputSchema: { type: 'object', properties: { profile_group_id: { type: 'number', description: 'Filter by field group ID' }, fetch_field_data: { type: 'boolean', description: 'Include field data' }, }, },
  • Helper function used by all BuddyPress tools, including this one, to make authenticated API 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(); }

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