---
id: gk-block-mcp-agent-role
title: "Filter - gk/block-mcp/agent/role"
sidebar_label: "gk/block-mcp/agent/role"
tags:
  - "2.0.0"
---

# Filter: gk/block-mcp/agent/role

Run the AI agent on a role you control instead of the built-in one.

By default the plugin registers and manages a tidy `block_mcp_agent` role for you. Return your own slug here when you already govern capabilities centrally — say a membership plugin, a compliance policy, or a shared "content bot" role across several tools. The moment you return a custom slug, the plugin steps back and stops creating or modifying the role, so it's yours to define.

## Parameters

| Name | Type | Description |
|------|------|-------------|
| $role | `string` | Role slug for the agent account. Default 'block_mcp_agent'. |

## Example

// Assign the agent to a role your team already manages.

```php
add_filter( 'gk/block-mcp/agent/role', function () {
    return 'content_automation';
} );
```

### Since

- [2.0.0](../../since/2-0-0/)

### Source

Defined in `wordpress-plugin/gk-block-api/includes/class-agent-provisioner.php` at line 134

