Skip to main content
Glama

buddypress_list_friends

Retrieve a user's friends list from a BuddyPress community site with options to filter by confirmed status and paginate results.

Instructions

List friendships

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idNoUser ID to get friends for
is_confirmedNoFilter by confirmed status
pageNoPage number (default: 1)
per_pageNoItems per page (default: 20)

Implementation Reference

  • Executes the buddypress_list_friends tool by building query parameters from input arguments and calling the BuddyPress /friends API endpoint using the buddypressRequest helper.
    else if (name === 'buddypress_list_friends') {
      const params = new URLSearchParams();
      if (args.user_id) params.append('user_id', String(args.user_id));
      if (args.is_confirmed !== undefined) params.append('is_confirmed', String(args.is_confirmed));
      if (args.page) params.append('page', String(args.page));
      if (args.per_page) params.append('per_page', String(args.per_page));
      result = await buddypressRequest(`/friends?${params}`);
    }
  • src/index.ts:365-377 (registration)
    Registers the buddypress_list_friends tool in the tools array, including its name, description, and input schema. This array is returned by the ListToolsRequestHandler.
    {
      name: 'buddypress_list_friends',
      description: 'List friendships',
      inputSchema: {
        type: 'object',
        properties: {
          user_id: { type: 'number', description: 'User ID to get friends for' },
          is_confirmed: { type: 'boolean', description: 'Filter by confirmed status' },
          page: { type: 'number', description: 'Page number (default: 1)' },
          per_page: { type: 'number', description: 'Items per page (default: 20)' },
        },
      },
    },
  • Defines the input schema for the buddypress_list_friends tool, specifying optional parameters for filtering and pagination.
    inputSchema: {
      type: 'object',
      properties: {
        user_id: { type: 'number', description: 'User ID to get friends for' },
        is_confirmed: { type: 'boolean', description: 'Filter by confirmed status' },
        page: { type: 'number', description: 'Page number (default: 1)' },
        per_page: { type: 'number', description: 'Items per page (default: 20)' },
      },
    },
  • Shared helper function used by all BuddyPress tools, including buddypress_list_friends, to make authenticated HTTP requests to 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();
    }
Behavior1/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. 'List friendships' gives no information about whether this is a read-only operation, what permissions are required, how pagination works (beyond what the schema implies), or what the output format looks like. For a tool with 4 parameters and no output schema, this is a significant gap in behavioral context.

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 extremely concise at just two words, with zero wasted language. It's front-loaded and to the point, though this brevity contributes to its inadequacy in other dimensions. Every word earns its place, making it structurally efficient despite being under-specified.

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 (4 parameters, no annotations, no output schema, and multiple sibling tools), the description is incomplete. It doesn't clarify what 'friendships' entails versus 'friends', provide output expectations, or differentiate from similar listing tools. With no annotations to cover behavioral aspects, the description fails to offer sufficient context for effective agent use.

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%, so the input schema already documents all 4 parameters with clear descriptions. The description adds no additional meaning beyond what the schema provides—it doesn't explain relationships between parameters (e.g., how user_id interacts with is_confirmed) or provide usage examples. 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.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'List friendships' is a tautology that essentially restates the tool name 'buddypress_list_friends'. While it indicates a listing operation, it doesn't specify what resource is being listed (friendships vs. friends themselves) or provide any distinguishing detail from sibling tools like 'buddypress_list_members' or 'buddypress_list_group_members'. The purpose is vague and lacks specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/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 any context, prerequisites, or exclusions. Given sibling tools like 'buddypress_get_member' or 'buddypress_list_members', there's no indication of how this tool differs or when it should be preferred, leaving the agent with no usage direction.

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