30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

Install Library Snippet

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

Abilitysnippets/install-library-snippet
ToolsetWPCode — toolset/wpcode
GroupWPCode › The Library
RequiresWPCode, active on the site
Capabilitymanage_options
SafetyWrites data
RepeatableNot idempotent — each call changes the row set, so re-running is not a no-op
Ships inAcrossAI 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

NameTypeRequiredWhat it is
library_idintegerYesLibrary snippet ID, from snippets/search-library.
confirmbooleanYes — must be trueThe irreversibility gate. Without it the call is refused before anything is touched.

What comes back

NameTypeWhat it is
snippetobjectThe installed snippet, inactive.
in_cachebooleanWhether WPCode’s loader cache holds the snippet. This, not the post status, is what decides whether it actually runs.
safe_modebooleanWhether safe mode is active. When it is, no snippet runs regardless of everything else.
successbooleanWhether the call completed.
messagestringA one-line summary of what happened, suitable for showing a human.
error_codestringPresent 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 the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading