Skip to content

Rules Engine Abilities

These abilities are active when the vmfa-rules-engine add-on is installed and active (VMFA_RULES_ENGINE_VERSION defined).

Category slug: vmfo-rules-engine
REST namespace: vmfa-rules/v1


Label: List Rules
Permission: upload_files
Flags: readonly · idempotent

Returns all folder-assignment rules ordered by priority.

No parameters.

An array of rule objects:

[
{
"id": "abc123",
"name": "Invoices",
"folder_id": 55,
"conditions": [
{ "type": "filename", "operator": "contains", "value": "invoice" }
],
"enabled": true,
"priority": 10,
"description": "Route invoice PDFs to the Invoices folder."
}
]
Terminal window
curl -s -X POST "https://example.com/wp-json/mcp/mcp-adapter-default-server" \
-u "admin:xxxx xxxx xxxx xxxx xxxx xxxx" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0", "id": 1, "method": "tools/call",
"params": {
"name": "mcp-adapter-execute-ability",
"arguments": { "ability_name": "vmfo-rules/list-rules", "parameters": {} }
}
}'

Label: Create Rule
Permission: manage_options
Flags:

Creates a new folder-assignment rule.

ParameterTypeRequiredDefaultDescription
namestring (min 1)YesRule display name
folder_idinteger ≥ 1YesTarget folder term ID
conditionsarrayYesArray of condition objects (see below)
enabledbooleanNotrueWhether the rule runs automatically
priorityinteger ≥ 1NoEvaluation order; lower = evaluated first
descriptionstringNoHuman-readable description

Condition object:

{ "type": "filename|mimetype|title|alt", "operator": "contains|equals|starts_with|ends_with", "value": "..." }

The created rule object (same shape as list-rules items).

Terminal window
curl -s -X POST "https://example.com/wp-json/mcp/mcp-adapter-default-server" \
-u "admin:xxxx xxxx xxxx xxxx xxxx xxxx" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0", "id": 1, "method": "tools/call",
"params": {
"name": "mcp-adapter-execute-ability",
"arguments": {
"ability_name": "vmfo-rules/create-rule",
"parameters": {
"name": "Invoices",
"folder_id": 55,
"conditions": [
{ "type": "filename", "operator": "contains", "value": "invoice" }
],
"priority": 10
}
}
}
}'

Label: Update Rule
Permission: manage_options
Flags: idempotent

Updates an existing rule. Only the fields you supply are changed.

ParameterTypeRequiredDefaultDescription
rule_idstringYesRule ID to update (from list-rules)
namestringNoNew display name
folder_idinteger ≥ 1NoNew target folder
conditionsarrayNoReplacement condition list
enabledbooleanNoEnable or disable the rule
priorityinteger ≥ 1NoNew priority
descriptionstringNoNew description

The updated rule object.

Terminal window
curl -s -X POST "https://example.com/wp-json/mcp/mcp-adapter-default-server" \
-u "admin:xxxx xxxx xxxx xxxx xxxx xxxx" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0", "id": 1, "method": "tools/call",
"params": {
"name": "mcp-adapter-execute-ability",
"arguments": {
"ability_name": "vmfo-rules/update-rule",
"parameters": { "rule_id": "abc123", "enabled": false }
}
}
}'

Label: Delete Rule
Permission: manage_options
Flags: destructive

Permanently deletes a folder-assignment rule. Existing media assignments are not changed.

ParameterTypeRequiredDescription
rule_idstringYesRule ID to delete
{ "deleted": true, "rule_id": "abc123" }
Terminal window
curl -s -X POST "https://example.com/wp-json/mcp/mcp-adapter-default-server" \
-u "admin:xxxx xxxx xxxx xxxx xxxx xxxx" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0", "id": 1, "method": "tools/call",
"params": {
"name": "mcp-adapter-execute-ability",
"arguments": {
"ability_name": "vmfo-rules/delete-rule",
"parameters": { "rule_id": "abc123" }
}
}
}'

Label: Preview Rule Matches
Permission: upload_files
Flags: readonly

Simulates which media items would be assigned by a rule (or all enabled rules) without making any changes.

ParameterTypeRequiredDefaultDescription
rule_idstringNoPreview a specific rule; omit to preview all enabled rules
unassigned_onlybooleanNotrueLimit preview to media not yet in any folder
limitintegerNo50Max items to return
offsetintegerNo0Pagination offset
{
"total_count": 120,
"matched": 14,
"unmatched": 106,
"items": [ { "attachment_id": 1001, "title": "invoice_jan.pdf", "matched_rule_id": "abc123", "target_folder_id": 55 } ],
"rule_id": "abc123"
}
Terminal window
curl -s -X POST "https://example.com/wp-json/mcp/mcp-adapter-default-server" \
-u "admin:xxxx xxxx xxxx xxxx xxxx xxxx" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0", "id": 1, "method": "tools/call",
"params": {
"name": "mcp-adapter-execute-ability",
"arguments": {
"ability_name": "vmfo-rules/preview",
"parameters": { "rule_id": "abc123", "unassigned_only": true }
}
}
}'

Label: Apply Rules
Permission: manage_options
Flags:

Applies all enabled rules to existing media, assigning items to their target folders. This is the batch-run equivalent of the automatic rule engine that runs on upload.

ParameterTypeRequiredDefaultDescription
rule_idstringNoApply only this rule; omit to apply all enabled rules
unassigned_onlybooleanNotrueOnly process media not already in a folder
{
"processed": 120,
"assigned": 14,
"skipped": 106
}
Terminal window
curl -s -X POST "https://example.com/wp-json/mcp/mcp-adapter-default-server" \
-u "admin:xxxx xxxx xxxx xxxx xxxx xxxx" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0", "id": 1, "method": "tools/call",
"params": {
"name": "mcp-adapter-execute-ability",
"arguments": {
"ability_name": "vmfo-rules/apply",
"parameters": { "unassigned_only": true }
}
}
}'