Skip to content

WordPress Abilities API

The FRS ecosystem integrates with the WordPress Abilities API (WP 6.9+) for AI assistant integration.

What are Abilities?

Abilities are registered functions that AI assistants can discover and call. They provide:

  • Discoverability - AI can list available actions
  • Schema Validation - Input/output validation via JSON Schema
  • Permission Checks - Capability-based access control
  • MCP Compatibility - Works with Model Context Protocol

Ability Categories

User Management

AbilityDescription
frs-users/list-profilesQuery profiles with filters
frs-users/get-profileGet single profile
frs-users/search-profilesFull-text search

Intranet

AbilityDescription
frs-intranet/search-directorySearch staff directory
frs-intranet/get-org-chartGet org hierarchy
frs-intranet/get-direct-reportsGet user's reports
frs-intranet/find-colleagueNatural language search
frs-intranet/get-bookmarksGet user bookmarks
frs-intranet/add-bookmarkAdd bookmark

Data Management

AbilityDescription
frs-modern-data/get-postsQuery posts
frs-modern-data/get-usersQuery users
frs-modern-data/create-postCreate post
frs-modern-data/update-postUpdate post
frs-modern-data/bulk-actionBatch operations

Greenshift (Conditional)

AbilityDescription
greenshift/create-elementCreate block
greenshift/create-sectionCreate section
greenshift/create-query-gridCreate post grid
greenshift/insert-blocksInsert into post

Using Abilities

PHP Registration

php
wp_register_ability('my-plugin/my-action', [
    'label' => 'My Action',
    'description' => 'Does something useful',
    'category' => 'my-category',
    'capability' => 'edit_posts',
    'input_schema' => [
        'type' => 'object',
        'properties' => [
            'name' => ['type' => 'string']
        ],
        'required' => ['name']
    ],
    'output_schema' => [
        'type' => 'object',
        'properties' => [
            'success' => ['type' => 'boolean']
        ]
    ],
    'callback' => function($input) {
        return ['success' => true];
    }
]);

Calling via MCP

json
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "frs-intranet/search-directory",
    "arguments": {
      "search": "John",
      "department": "Sales"
    }
  },
  "id": 1
}

MCP Protocol

The MCP adapter in frs-wp-modern-data implements:

Methods

MethodDescription
initializeHandshake
tools/listList abilities
tools/callExecute ability
resources/listList resources
resources/readRead resource

Resource URIs

wordpress://post/{id}
wordpress://user/{id}
wordpress://page/{id}

Example Queries

Find Colleague

User: "Who works in marketing?"
→ frs-intranet/search-directory { department: "Marketing" }

Get Org Chart

User: "Show me the org chart"
→ frs-intranet/get-org-chart {}

Create Content

User: "Create a new blog post about rates"
→ frs-modern-data/create-post {
    title: "Current Rate Update",
    content: "...",
    status: "draft"
  }

Hub21 Platform Documentation