Go Back to Parent Doc

Tool Reference

Sokket ships 20 tools in five groups. Each one lists the WordPress capability it requires and whether it counts as a write.

Reading this table is how you decide what to tick on a token. Remember all three gates apply: the tool must be in the connection’s allowlist, the connection must not be read-only if the tool writes, and the bound user must have the capability. See Tokens & Permissions.

At a glance

ToolGroupTypeCapability
get_site_infoSite & diagnosticsreadmanage_options
list_pluginsSite & diagnosticsreadactivate_plugins
list_themesSite & diagnosticsreadswitch_themes
get_php_error_log_tailSite & diagnosticsreadmanage_options
get_site_settingsSite & diagnosticsreadmanage_options
list_postsContentreadedit_posts
get_postContentreadedit_posts
search_contentContentreadedit_posts
create_postContentwriteedit_posts
update_postContentwriteedit_posts
list_mediaMediareadupload_files
upload_mediaMediawriteupload_files
set_featured_imageMediawriteedit_posts
list_taxonomiesTaxonomies & termsreadedit_posts
list_termsTaxonomies & termsreadedit_posts
create_termTaxonomies & termswritemanage_categories
assign_termsTaxonomies & termswriteedit_posts
list_commentsCommentsreadmoderate_comments
moderate_commentCommentswritemoderate_comments
reply_to_commentCommentswritemoderate_comments

Every write tool is off by default on a new token.


Site & diagnostics

get_site_info

An overview of the site: WordPress version, PHP version, active theme, environment type, and debug settings. Usually the first call an agent makes — it’s the context everything else builds on.

No arguments. Requires manage_options.

list_plugins

Installed plugins with their version, active state, and whether an update is available. The fastest way to answer "what changed before this broke?"

No arguments. Requires activate_plugins.

list_themes

Installed themes with their version and whether they are active.

No arguments. Requires switch_themes.

get_php_error_log_tail

The last lines of the PHP error log.

ArgumentTypeNotes
linesinteger1–100. Default 50.

Requires manage_options.

This is the only tool in the free plugin that touches the filesystem, and it is constrained hard on purpose: it reads only the path returned by ini_get( 'error_log' ) — never a path the caller supplies — and caps the response at the last 100 lines. There is no way to point it at another file.

get_site_settings

The site’s general, writing, reading, discussion, and permalink settings.

ArgumentTypeNotes
groupstringOne of general, writing, reading, discussion, permalinks. Default: all groups.

Requires manage_options.

The options are a fixed, hard-coded allowlist — the caller cannot name an option to read. general includes blogname, siteurl, home, admin_email, timezone_string, date and time formats, and registration settings; reading includes show_on_front, posts_per_page, and blog_public; discussion covers the comment settings; permalinks covers permalink_structure and the category and tag bases.

admin_email is in the general group. It’s the same address that user sees under Settings → General, but if you’d rather not expose it, leave this tool off.


Content

list_posts

Posts or pages with id, title, status, and dates, paginated.

ArgumentTypeNotes
post_typestringDefault post.
statusstringpublish, draft, pending, future, private, or any. Default any.
per_pageinteger1–50. Default 10.
pageintegerDefault 1.

Requires edit_posts.

get_post

One post or page in full, including its content.

ArgumentTypeNotes
idintegerRequired.

Requires edit_posts.

search_content

Search post and page titles and content for a keyword.

ArgumentTypeNotes
querystringRequired. The keyword or phrase.
post_typestringRestrict to one post type. Default: posts and pages.
per_pageinteger1–50. Default 10.

Requires edit_posts.

create_post — write

Create a new post or page.

ArgumentTypeNotes
titlestringRequired.
contentstringHTML allowed, filtered.
excerptstring
statusstringdraft, pending, private, or publish. Default draft.
post_typestringDefault post.

Requires edit_posts.

Content is created as a draft unless another status is requested and permitted. Asking for publish or private on a connection whose user cannot publish that post type returns an error rather than quietly downgrading it, so the agent knows the request didn’t do what it asked.

update_post — write

Update the title, content, excerpt, or status of an existing post or page.

ArgumentTypeNotes
idintegerRequired.
titlestring
contentstringHTML allowed, filtered.
excerptstring
statusstringdraft, pending, private, or publish.

Requires edit_posts, plus edit permission on that specific post.


Media

list_media

Media library attachments with id, title, URL, MIME type, and dimensions. Use it to find an existing image before uploading a new one.

ArgumentTypeNotes
searchstringTitle, filename, or caption.
mime_typestringe.g. image/png.
post_idintegerOnly attachments uploaded to this post.
per_pageinteger1–50. Default 20.
pageintegerDefault 1.

Requires upload_files.

upload_media — write

Upload an image to the media library from base64-encoded bytes; returns the attachment id and URL.

ArgumentTypeNotes
filenamestringRequired. e.g. sunset.jpg. The extension is corrected to match the actual image data.
datastringRequired. Base64-encoded file contents. A data:image/…;base64, prefix is accepted and stripped.
titlestringDefaults to the file name.
alt_textstringStrongly recommended.
captionstring
descriptionstring
post_idintegerAttach to this post. Requires edit permission on it.

Requires upload_files.

This tool is deliberately narrow, and the limits are worth knowing before you enable it:

  • Raster images only — JPEG, PNG, GIF, WebP, and AVIF. SVG is always refused, because SVG is XML that can carry script — and that holds even on sites that have enabled SVG uploads elsewhere or set unfiltered_upload.
  • The type comes from the bytes, not the name. A payload called photo.jpg that isn’t really an image is rejected, and the stored extension is rewritten to match the real data.
  • The bytes arrive inside the request. Sokket never fetches a URL, so enabling uploads still means zero outbound requests from your site — and no SSRF surface.
  • Rate limited — 20 files and 25 MB per user per hour by default (both filterable), with a per-file size cap. An agent stuck in a loop cannot fill your uploads directory.
  • Logged — the audit log records the resulting attachment id.

set_featured_image — write

Set or clear a post’s featured image.

ArgumentTypeNotes
post_idintegerRequired.
attachment_idintegerRequired. The image attachment id, or 0 to clear.

Requires edit_posts, plus edit permission on that post.


Taxonomies & terms

list_taxonomies

The taxonomies registered on this site, which post types they apply to, and whether they’re hierarchical.

ArgumentTypeNotes
post_typestringOnly taxonomies attached to this post type.

Requires edit_posts.

list_terms

Terms in a taxonomy with id, name, slug, parent, and post count.

ArgumentTypeNotes
taxonomystringRequired. e.g. category, post_tag.
searchstringFilter terms by name.
parentintegerOnly direct children of this term.
hide_emptybooleanExclude terms with no posts. Default false.
per_pageinteger1–100. Default 50.
pageintegerDefault 1.

Requires edit_posts.

create_term — write

Create a term in a taxonomy — a category, a tag, or anything custom.

ArgumentTypeNotes
taxonomystringRequired.
namestringRequired.
slugstringGenerated from the name when omitted.
descriptionstring
parentintegerHierarchical taxonomies only.

Requires manage_categories, re-checked against that taxonomy’s own management capability.

assign_terms — write

Assign existing terms to a post. Terms may be given as ids, exact names, or slugs.

ArgumentTypeNotes
post_idintegerRequired.
taxonomystringRequired.
termsarrayRequired. Term ids, names, or slugs.
appendbooleanAdd to existing terms instead of replacing them. Default false.

Requires edit_posts, plus edit permission on that post.

Unknown terms are reported back, not silently created — so an agent that hallucinates a category gets told about it instead of littering your taxonomy. Call create_term first when you genuinely want a new one.

delete_term was added in 1.2.0. It counts as a write, so a read-only connection can never call it, and it is announced with the MCP destructiveHint annotation so your client can ask you to confirm first. Posts using a deleted term are not deleted — they simply lose the assignment.


Comments

list_comments

Comments with their status, author, and content. This is how an agent reads the moderation queue.

ArgumentTypeNotes
statusstringhold, approve, spam, trash, or all. Default hold.
post_idintegerOnly comments on this post.
searchstringFilter by content or author.
per_pageinteger1–50. Default 20.
pageintegerDefault 1.

Requires moderate_comments.

This tool returns commenter email addresses — the same data a moderator sees in wp-admin. If you’d rather not expose them to a client, leave it off.

moderate_comment — write

Change a comment’s moderation status.

ArgumentTypeNotes
comment_idintegerRequired.
actionstringRequired. approve, unapprove, spam, unspam, trash, or untrash.

Requires moderate_comments, re-checked per comment.

Comments are never permanently deleted by this tool. The worst it can do is trash one — and it can untrash it again.

reply_to_comment — write

Post a reply to a comment, authored as the WordPress user the connection is bound to.

ArgumentTypeNotes
comment_idintegerRequired.
contentstringRequired. The reply text.

Requires moderate_comments.

The reply is attributed to the bound user — so think about which account you bind a comment-moderation connection to, because their name goes on the site.


What is deliberately missing

The free plugin ships no filesystem-write tool, no database query tool, no WP-CLI passthrough, and no plugin or theme installer. That isn’t an oversight — each one is a remote code or data execution surface, and keeping them out is what makes the free plugin safe to hand an agent by default.

Those tools are the Pro add-on’s job, and they register through the same public filter any developer can use.

Adding your own tools

Any plugin can register additional tools with the sokket_register_tools filter. They appear in the token allowlist automatically (in the Other group unless they declare one) and pass exactly the same three gates. See the Developer Reference.

Related

Shopping Cart
  • Your cart is empty.