Skip to main content
Glama

buddypress_get_xprofile_field

Retrieve a specific extended profile field from a BuddyPress community site using its ID, with optional field data inclusion for comprehensive user profile management.

Instructions

Get a single XProfile field

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesField ID
fetch_field_dataNoInclude field data

Implementation Reference

  • Handler logic for the buddypress_get_xprofile_field tool. Constructs query parameters and calls the BuddyPress XProfile fields API endpoint `/xprofile/fields/${args.id}`.
    else if (name === 'buddypress_get_xprofile_field') {
      const params = new URLSearchParams();
      if (args.fetch_field_data !== undefined) params.append('fetch_field_data', String(args.fetch_field_data));
      result = await buddypressRequest(`/xprofile/fields/${args.id}?${params}`);
    }
  • src/index.ts:326-337 (registration)
    Registration of the buddypress_get_xprofile_field tool in the tools list, including name, description, and input schema definition.
    {
      name: 'buddypress_get_xprofile_field',
      description: 'Get a single XProfile field',
      inputSchema: {
        type: 'object',
        properties: {
          id: { type: 'number', description: 'Field ID', required: true },
          fetch_field_data: { type: 'boolean', description: 'Include field data' },
        },
        required: ['id'],
      },
    },
  • Input schema definition for the buddypress_get_xprofile_field tool, specifying required 'id' parameter and optional 'fetch_field_data'.
    inputSchema: {
      type: 'object',
      properties: {
        id: { type: 'number', description: 'Field ID', required: true },
        fetch_field_data: { type: 'boolean', description: 'Include field data' },
      },
      required: ['id'],
    },
  • Shared helper function buddypressRequest used by all BuddyPress tools, including buddypress_get_xprofile_field, to make authenticated API calls to BuddyPress REST 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();
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Get' which implies a read operation, but doesn't clarify if this requires authentication, what happens with invalid IDs (e.g., errors vs. null returns), rate limits, or the response format. For a read tool with zero annotation coverage, this is a significant gap in transparency.

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, efficient sentence with zero waste—it directly states the tool's purpose without fluff or redundancy. It's appropriately sized for a simple retrieval tool and front-loaded with the core action.

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?

Given no annotations and no output schema, the description is incomplete for a tool that retrieves data. It doesn't explain what an 'XProfile field' is (context from siblings suggests it's part of BuddyPress user profiles), what the return includes, or error handling. For a read operation with structured parameters, more context is needed to guide the agent effectively.

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%, with both parameters ('id' and 'fetch_field_data') clearly documented in the schema. The description doesn't add any meaning beyond what the schema provides (e.g., it doesn't explain what 'XProfile field' entails or how 'fetch_field_data' affects the output). Baseline 3 is appropriate when the schema does the heavy lifting.

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 verb 'Get' and the resource 'a single XProfile field', which is specific and unambiguous. It distinguishes from sibling tools like 'buddypress_list_xprofile_fields' (which lists multiple fields) and 'buddypress_get_xprofile_data' (which gets data values rather than field definitions). However, it doesn't explicitly contrast with all siblings, so it's not a perfect 5.

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. It doesn't mention when to use it instead of 'buddypress_list_xprofile_fields' (for listing all fields) or 'buddypress_get_xprofile_data' (for field values), nor does it specify prerequisites like needing a valid field ID. This leaves the agent without contextual usage cues.

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