Using AI Assistants with Woody Code Snippets
You can connect an AI assistant to inspect your Woody snippets. If you explicitly allow write access, it can also create, update, activate, trash, or restore snippets and restore revisions.
In this article
Before You Start
Install an AI connector that exposes WordPress abilities (actions a plugin makes available to connected assistants). For example, follow the Easy MCP AI getting started guide to connect your assistant to your WordPress site.
The connected WordPress user must have administrator-level permission to manage Woody snippets and permission to edit the snippet post type. Creating a snippet also requires permission to create snippets; reading the code of, updating, or activating an existing snippet requires permission to edit that particular snippet. Connecting an assistant does not bypass the permissions used by Woody's snippet editor.
Enable Woody Abilities in Easy MCP AI
- In Easy MCP AI, go to Easy MCP AI > Tools > Abilities.
- Find and expand the Woody category.
- Turn on the read abilities if you want your assistant to inspect snippets.
- Turn on write abilities only when you want the assistant to save, activate, trash, or restore snippets or restore revisions, then click Save changes in Easy MCP AI.

| Ability | What it does | Access |
|---|---|---|
woody/list-snippets | Finds snippets and returns their type, scope, insertion location, status, and activation state without returning code. | Read |
woody/get-snippet | Reads one snippet, including its code and display conditions. | Read |
woody/upsert-snippet | Creates an inactive snippet or updates supported code and execution settings. | Write |
woody/set-snippet-state | Activates or deactivates a snippet. | Write |
woody/get-options | Reads snippet types, scopes, locations, condition parameters, operators, allowed values, and existing tags. | Read |
woody/get-snippet-errors | Reads the last recorded fatal error for a snippet, or recent recorded snippet errors. | Read |
woody/list-revisions | Lists saved revisions and can read a selected revision's code. Requires Premium. | Read |
woody/trash-snippet | Moves a snippet to the trash or restores it without activating it. | Write |
woody/restore-revision | Restores a revision's title and code. Requires Premium. | Write |
Here, “settings” means a snippet's execution settings, such as Snippet Scope, Location, display conditions, description, and activation state. These abilities do not change Woody's global plugin settings.
Snippet Options and Filters
Ask the assistant to call woody/get-options before choosing a location or display condition. Use the returned identifiers, operators, allowed values, and availability flags rather than guessing them. Country values require an updated Premium add-on that supplies them to this ability; older Premium builds may not return them.
woody/list-snippets supports type, scope, active, status, search, tag, and location filters. Its default status="any" excludes trashed snippets; use status="trash" to find them.
woody/upsert-snippet accepts tags and priority. Supplying tags replaces the existing tags; tags=[] clears them. For CSS and JavaScript snippets, linking accepts external or inline, with external the default for a new snippet.
For non-PHP snippets, conditions accepts an array of groups or a JSON string containing that structure. New or changed conditions support one group with type set to showif or hideif. Its conditions array contains scopes; each scope contains a conditions array of rules with param, operator, and value. All scopes must match (AND), while any rule within a scope can match (OR). The rule's type can be omitted because Woody derives it from the parameter. Omit conditions to leave them unchanged, or pass [] to clear them. A blank string is invalid; do not submit multiple new condition groups.
Safety Behavior
- New snippets created through the AI ability start inactive.
- Saving new or changed PHP and Universal code through
woody/upsert-snippetnever runs it. Woody checks its syntax and, for inactive snippets, checks for top-level declarations whose names are already in use. Adry_runperforms the same checks without saving. A successful check does not guarantee that code is safe. - Changing the code or scope of an active PHP or Universal snippet saves it inactive. Activate it again separately with
woody/set-snippet-stateafter reviewing the change. - Activating an automatically running PHP or Universal snippet runs its code once with output discarded. Activation is refused if the code raises an error or warning or returns
false. woody/upsert-snippetcan create and update CSS and JavaScript snippets, but their code is not syntax-checked. Woody writes generated files in the uploads directory, which must be writable. New snippets still start inactive.- Trashing or restoring a snippet also requires permission to delete that snippet.
woody/trash-snippetnever permanently deletes it: trashing deactivates it, and restoring returns its previous WordPress post status but leaves activation off. Activate it separately withwoody/set-snippet-state. If WordPress trash is disabled, deactivate the snippet instead. - Restoring a Premium revision does not run the restored code. Changed PHP or Universal code receives the same checks as an upsert, and an active PHP or Universal snippet whose code changes is saved inactive.
- Premium display-condition parameters can only be saved when Woody Code Snippets Premium is installed.
Activating a PHP or Universal snippet can execute code that affects your site. Review proposed code before activation, and leave write abilities disabled when you do not need them.
Example Prompts
- “Which active Woody snippets run PHP on every page?”
- “Find the snippet that loads
gtagand tell me where it is inserted.” - “Show me the code of my header scripts snippet and explain it without changing anything.”
- “Check this PHP change with a dry run, but do not save or activate it.”
