snippets/install-library-snippet installs a library snippet onto this site. It refuses without confirm: true.
It is always installed inactive, whatever the library payload says.
At a glance
| Ability | snippets/install-library-snippet |
| Toolset | WPCode — toolset/wpcode |
| Group | WPCode › The Library |
| Requires | WPCode, active on the site |
| Capability | manage_options |
| Safety | Writes data |
| Repeatable | Not idempotent — each call changes the row set, so re-running is not a no-op |
| Ships in | AcrossAI Abilities Manager 0.0.34 and later |
Somebody else’s code, on your site
A library snippet is third-party code that will run on this site once it is activated. It lands inactive no matter what the payload says, so nothing executes until a person switches it on — but the confirmation marks the point where somebody else’s code entered the site.
Inactive, always
Library snippets carry an active state in their payload, and some of them say active. That is a sensible default for somebody clicking install in the WPCode admin, having just read the description on screen. It is not a sensible default for code arriving through an assistant.
So the state is overridden on the way in: everything lands inactive, and switching it on is a separate call with its own confirmation. A person decides whether third-party code runs here, always.
Installing requires the site to be signed in to the library. Searching does not — you can find a snippet, read about it, and only then discover the site is not connected, so the response reports the connection state and where to fix it.
Read the snippet first with snippets/get-library-snippet. Install, review, then activate.
Input
| Name | Type | Required | What it is |
|---|---|---|---|
library_id | integer | Yes | Library snippet ID, from snippets/search-library. |
confirm | boolean | Yes — must be true | The irreversibility gate. Without it the call is refused before anything is touched. |
What comes back
| Name | Type | What it is |
|---|---|---|
snippet | object | The installed snippet, inactive. |
in_cache | boolean | Whether WPCode’s loader cache holds the snippet. This, not the post status, is what decides whether it actually runs. |
safe_mode | boolean | Whether safe mode is active. When it is, no snippet runs regardless of everything else. |
success | boolean | Whether the call completed. |
message | string | A one-line summary of what happened, suitable for showing a human. |
error_code | string | Present only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation. |
Example
Ask your assistant:
Install library snippet 3312.
It resolves to one call:
{
"ability": "snippets/install-library-snippet",
"parameters": {
"library_id": 3312,
"confirm": true
}
}Worth knowing
- Always inactive on arrival. Nothing runs until you activate it.
- Requires the site to be signed in to the library.
- Not idempotent — installing twice creates two snippets.
- Read it first. The install is not the review.
Related abilities
- Get Library Snippet — read it before installing
- Activate Code Snippet — switch it on afterwards
- List Snippet Updates — keep it current later
Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager
Browse the rest: Every ability, by category