---
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](/) / [Docs](/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 when the ability registry assembles its definitions — both for the in-admin Build with AI agent and for the `wp_register_ability` / MCP exposure. This is how the Pro plugin adds its Code Glue abilities.

/ Parameters

| Name | In | Type | Req | Description |
| --- | --- | --- | --- | --- |
| $definitions | param | array | yes | Ability definitions keyed by short name. Each entry: \`label\`, \`description\`, \`category\`, \`scope\` (\`read\`|\`full\`), \`requires\_confirm\` (\`false\`|\`when\_live\`|\`always\`), \`input\_schema\` (JSON Schema), \`callback\`. |

/ 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'         => 'maintenance',
        'scope'            => 'full',
        'requires_confirm' => 'always',
        'input_schema'     => [ 'type' => 'object', 'properties' => new stdClass() ],
        'callback'         => fn () => [ 'flushed' => wp_cache_flush() ],
    ];
    return $definitions;
} );
```

/ Related

[Build with AI](/docs/build-with-ai/)[Developer Extensibility](/docs/developer-extensibility/)

/Ready

## Your next automation is  
one sentence away.

[Install Plugin→](https://wordpress.org/plugins/flowsystems-webhook-actions/) [See the Plugin →](/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"}}
```
