@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix content: <http://purl.org/rss/1.0/modules/content/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<https://lhero.org/portfolio/lh-mcp-buddypress-queries/>
  a sioc:Post ;
  dc:title "Notes" ;
  dcterms:identifier 150333 ;
  dc:modified "2026-10-15T00:45:15Z"^^xsd:dateTime ;
  dc:created "2026-10-15T00:45:15Z"^^xsd:dateTime ;
  sioc:link <https://lhero.org/portfolio/lh-mcp-buddypress-queries/notes/> ;
  sioc:has_creator <https://lhero.org/author/1/#account> ;
  sioc:has_container <https://lhero.org/#posts> ;
  content:encoded """<ul class="lh_portfolio-meta"><li><strong>Part of:</strong> <a href="https://lhero.org/portfolio/lh-mcp-buddypress-queries/">LH MCP BuddyPress Queries</a></li></ul>
<p class="wp-block-paragraph">All seven abilities are read-only. Deliberately not exposed: private messages (<code>messages_get_threads</code>) and friend connections (<code>friends_get_friend_user_ids</code>), a different risk category to group, activity and directory metadata.</p>



<h2 class="wp-block-heading">Worked example: admin contact lookup</h2>



<p class="wp-block-paragraph">Finding a group&#8217;s admin name and email is a two-call round trip, usable from any subsite connector:</p>



<pre class="wp-block-code"><code>// 1. Resolve the group and get admin user ID(s)
{ "tool": "lh-mcp-buddypress-queries/get-group", "params": { "slug": "sugar-gliders" } }
// -&gt; admin_ids: [7407]

// 2. Get that admin's name and email
{ "tool": "lh-mcp-buddypress-queries/get-group-members", "params": { "group_id": 21, "role": "admin" } }
// -&gt; name and email of the group admin</code></pre>



<h2 class="wp-block-heading">Architectural notes</h2>



<ul class="wp-block-list">

<li>Bootstraps entirely on <code>plugins_loaded</code> (no <code>bp_loaded</code> dependency, unlike <code>lh-buddypress-group-taxonomies</code>) since it has no BuddyPress-specific class loading order requirements. Every execute callback guards with <code>function_exists()</code>/<code>class_exists()</code> checks instead, since BuddyPress itself may not be fully loaded at <code>plugins_loaded</code> time on every request path.</li>


<li>Requires WordPress 6.9+ since <code>wp_register_ability()</code>/<code>wp_register_ability_category()</code> require that version.</li>


<li><code>list-groups</code> and <code>get-groups-by-taxonomy</code> (in the taxonomy plugin) share the same status-filter-after-fetch pattern, since BuddyPress core doesn&#8217;t yet support filtering <code>groups_get_groups()</code> by a list of statuses directly.</li>


<li><code>get-group-activity</code> passes the group to <code>bp_activity_get()</code> in its <code>filter</code> argument (<code>object: groups</code>, <code>primary_id</code>) with <code>show_hidden</code> on, so private and hidden groups&#8217; activity is included. Before 2.2.1 the group was passed as top-level arguments, which BuddyPress ignores, so every group returned the network&#8217;s latest activity.</li>


<li>Plugin folder, main file, class name, and ability namespace were all renamed from <code>lh-buddypress-queries</code> to <code>lh-mcp-buddypress-queries</code> in v2.0.0, a breaking change for anything calling the old ability names directly.</li>

</ul>



<h2 class="wp-block-heading">Related plugins</h2>



<ul class="wp-block-list">

<li><a href="/portfolio/lh-buddypress-group-taxonomies/">lh-buddypress-group-taxonomies</a>: taxonomy-scoped group queries (<code>get-groups-by-taxonomy</code>, <code>list-terms</code>, <code>list-group-taxonomies</code>)</li>


<li><code>lh-membership</code>: taxonomy-based (not directory-based) member listing, same <code>edit_users</code> capability precedent for email-bearing abilities</li>

</ul>
"""^^rdf:XMLLiteral ;
  sioc:content """Part of: LH MCP BuddyPress Queries
All seven abilities are read-only. Deliberately not exposed: private messages (messages_get_threads) and friend connections (friends_get_friend_user_ids), a different risk category to group, activity and directory metadata.



Worked example: admin contact lookup



Finding a group&#8217;s admin name and email is a two-call round trip, usable from any subsite connector:



// 1. Resolve the group and get admin user ID(s)
{ "tool": "lh-mcp-buddypress-queries/get-group", "params": { "slug": "sugar-gliders" } }
// -&gt; admin_ids: [7407]

// 2. Get that admin's name and email
{ "tool": "lh-mcp-buddypress-queries/get-group-members", "params": { "group_id": 21, "role": "admin" } }
// -&gt; name and email of the group admin



Architectural notes





Bootstraps entirely on plugins_loaded (no bp_loaded dependency, unlike lh-buddypress-group-taxonomies) since it has no BuddyPress-specific class loading order requirements. Every execute callback guards with function_exists()/class_exists() checks instead, since BuddyPress itself may not be fully loaded at plugins_loaded time on every request path.


Requires WordPress 6.9+ since wp_register_ability()/wp_register_ability_category() require that version.


list-groups and get-groups-by-taxonomy (in the taxonomy plugin) share the same status-filter-after-fetch pattern, since BuddyPress core doesn&#8217;t yet support filtering groups_get_groups() by a list of statuses directly.


get-group-activity passes the group to bp_activity_get() in its filter argument (object: groups, primary_id) with show_hidden on, so private and hidden groups&#8217; activity is included. Before 2.2.1 the group was passed as top-level arguments, which BuddyPress ignores, so every group returned the network&#8217;s latest activity.


Plugin folder, main file, class name, and ability namespace were all renamed from lh-buddypress-queries to lh-mcp-buddypress-queries in v2.0.0, a breaking change for anything calling the old ability names directly.





Related plugins





lh-buddypress-group-taxonomies: taxonomy-scoped group queries (get-groups-by-taxonomy, list-terms, list-group-taxonomies)


lh-membership: taxonomy-based (not directory-based) member listing, same edit_users capability precedent for email-bearing abilities


""" ;
  sioc:topic <https://lhero.org/?taxonomy=author&term=cap-1> .

<https://lhero.org/author/1/#account> rdfs:seeAlso <https://lhero.org/author/1/?feed=lhrdf&format=turtle> .
<https://lhero.org/?taxonomy=author&term=cap-1> rdfs:seeAlso <https://lhero.org/?taxonomy=author&term=cap-1&feed=lhrdf&format=turtle> .
