Skip to main content
Glama

buddypress_update_xprofile_data

Update user profile field data in BuddyPress by specifying user ID, field ID, and new value to modify extended profile information.

Instructions

Update XProfile data for a specific user and field

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
field_idYesField ID
user_idYesUser ID
valueYesField value

Implementation Reference

  • The handler that implements the core logic for the 'buddypress_update_xprofile_data' tool. It destructures the input arguments (field_id, user_id, value) and calls the buddypressRequest helper to perform a PUT request to the BuddyPress XProfile API endpoint `/xprofile/{field_id}/data/{user_id}` with the value.
    else if (name === 'buddypress_update_xprofile_data') {
      const { field_id, user_id, value } = args as any;
      result = await buddypressRequest(`/xprofile/${field_id}/data/${user_id}`, 'PUT', { value });
    }
  • JSON Schema defining the input parameters and validation for the tool: field_id (required number), user_id (required number), value (required string).
    inputSchema: {
      type: 'object',
      properties: {
        field_id: { type: 'number', description: 'Field ID', required: true },
        user_id: { type: 'number', description: 'User ID', required: true },
        value: { type: 'string', description: 'Field value', required: true },
      },
      required: ['field_id', 'user_id', 'value'],
    },
  • src/index.ts:350-362 (registration)
    The tool registration object added to the 'tools' array, which is returned by the ListTools handler. Includes name, description, and inputSchema.
    {
      name: 'buddypress_update_xprofile_data',
      description: 'Update XProfile data for a specific user and field',
      inputSchema: {
        type: 'object',
        properties: {
          field_id: { type: 'number', description: 'Field ID', required: true },
          user_id: { type: 'number', description: 'User ID', required: true },
          value: { type: 'string', description: 'Field value', required: true },
        },
        required: ['field_id', 'user_id', 'value'],
      },
    },
  • Shared helper utility function that makes authenticated HTTP requests to the BuddyPress REST API (v2). Used by the tool handler to perform the actual API call.
    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 full burden. It states 'Update' implying a mutation, but doesn't disclose behavioral traits like required permissions, whether changes are reversible, error handling (e.g., invalid IDs), or side effects. For a mutation 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's front-loaded with the core action and resource, making it easy to parse. Every word contributes directly to the tool's purpose without redundancy.

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 the tool's complexity (mutation with 3 parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like permissions, error cases, or return values, leaving significant gaps for an AI agent to use it correctly in context with siblings.

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 clear parameter names and types. The description adds minimal value beyond the schema, only implying that 'field_id' and 'user_id' target specific entities and 'value' is the data to set. It doesn't explain parameter relationships, validation rules, or format details, meeting the baseline for high schema coverage.

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 action ('Update') and resource ('XProfile data') with specificity about targeting 'a specific user and field'. It distinguishes from siblings like 'buddypress_get_xprofile_data' (read vs. write) and 'buddypress_update_member' (different resource). However, it doesn't explicitly mention that XProfile refers to BuddyPress extended user profiles, which could help differentiate from other profile systems.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., existing field/user), when not to use it (e.g., for bulk updates), or direct alternatives like 'buddypress_update_member' for basic profile data. The description assumes context without explicit usage instructions.

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