---
title: "fswa_ability_definitions — Filter Hook"
description: "Filters the ability definitions that make up the AI agent toolset and the WordPress Abilities / MCP exposure."
url: "https://wpwebhooks.org/docs/fswa-ability-definitions/"
---

[WP Webhooks](https://wpwebhooks.org/) / [Docs](https://wpwebhooks.org/docs/) / fswa\_ability\_definitions

Filter since v2.0.0

# fswa\_ability\_definitions

Filters the ability definitions that make up the AI agent toolset and the WordPress Abilities / MCP exposure.

/ Signature

```
apply_filters( 'fswa_ability_definitions', $definitions )
```

/ When it fires

Fires whenever the ability registry assembles its definitions — for the in-admin Build with AI agent (catalog, plan execution) and, when the WordPress Abilities API is present, for the `wp_register_ability` / MCP exposure. This is how an extension adds its own abilities to the toolset. Use the `webhook-actions` category: the Abilities API refuses an ability whose category is not registered.

/ Parameters

| Name | In | Type | Req | Description |
| --- | --- | --- | --- | --- |
| $definitions | param | array | yes | Ability definitions keyed by short name. Each entry: \`label\`, \`description\`, \`category\` (every built-in uses \`webhook-actions\`, the only category the plugin registers), \`scope\` (\`read\`|\`full\`), \`requires\_confirm\` (\`false\`|\`when\_live\`|\`when\_destructive\_method\`|\`always\`; omitted = \`false\`), \`input\_schema\` (JSON Schema), \`callback\` (\`callable( array $input ): array|WP\_Error\`). |

/ Returns

`array` Modified definitions array. Added entries become tools the Build with AI agent can plan with and are registered as WordPress Abilities.

/ Examples

Register a custom ability for the agent

```
add_filter( 'fswa_ability_definitions', function ( $definitions ) {
    $definitions['flush_cache'] = [
        'label'            => 'Flush the site cache',
        'description'      => 'Flush the object cache after webhook changes.',
        'category'         => 'webhook-actions',
        'scope'            => 'full',
        'requires_confirm' => 'always',
        'input_schema'     => [ 'type' => 'object', 'properties' => new stdClass() ],
        'callback'         => fn () => [ 'flushed' => wp_cache_flush() ],
    ];
    return $definitions;
} );
```

/ Related

[Build with AI](https://wpwebhooks.org/docs/build-with-ai/)[Developer Extensibility](https://wpwebhooks.org/docs/developer-extensibility/)

/Ready

## Your next automation is  
one sentence away.

[Try the Live Preview](https://playground.wordpress.net/?blueprint-url=https://wpwebhooks.org/blueprint.json) [See the Plugin →](https://wpwebhooks.org/wordpress-webhook-plugin/)

$ wp plugin install flowsystems-webhook-actions --activate

## Structured data

```json
{"@context":"https://schema.org","@type":"TechArticle","name":"fswa_ability_definitions — Filter Hook — Webhook Actions Docs","description":"Filters the ability definitions that make up the AI agent toolset and the WordPress Abilities / MCP exposure.","url":"https://wpwebhooks.org/docs/fswa-ability-definitions/","isPartOf":{"@type":"WebSite","name":"WP Webhooks","url":"https://wpwebhooks.org"},"about":{"@type":"SoftwareApplication","name":"Webhook Actions","applicationCategory":"WordPress Plugin"}}
```
