Knowledge Base registers WordPress Abilities API tools for AI agents and other integrations. The free plugin provides read-only article search and section discovery. Knowledge Base Pro adds draft article creation, the Ask the Docs ability and GitHub import tools.

The Abilities API is built into WordPress 6.9 and later. Knowledge Base does not include a polyfill. All Knowledge Base abilities use the shared webberzone category.

Discover and run abilities

Use wp_get_abilities() in PHP to inspect registered abilities. The WordPress REST API exposes them at:

GET https://example.com/wp-json/wp-abilities/v1/abilities

Run a read-only ability with GET and pass its input as query parameters. Run an ability that changes site data with POST and pass its input as JSON. The HTTP method is determined by the ability’s annotations.

curl --get \
  --data-urlencode 'input[query]=reset password' \
  --data-urlencode 'input[limit]=10' \
  'https://example.com/wp-json/wp-abilities/v1/abilities/knowledgebase/search-articles/run'

Create-article uses POST with an input object in the JSON body:

curl --request POST \
  --header 'Content-Type: application/json' \
  --data '{"input":{"title":"Reset a password","content":"<p>Follow these steps…</p>"}}' \
  'https://example.com/wp-json/wp-abilities/v1/abilities/knowledgebase/create-article/run'

Requests use WordPress REST authentication. The ability permission callback is enforced for PHP, REST and MCP calls; listing an ability does not grant permission to run it.

Free abilities

knowledgebase/search-articles

Search published Knowledge Base articles. Use a few distinctive keywords and optionally limit results to a section by its term ID or slug.

InputTypeRequiredDescription
querystringyesSearch keywords or a short phrase, 2 to 500 characters.
sectioninteger or stringnowzkb_category term ID or slug. String values are matched as slugs first, then numeric strings fall back to a term ID.
limitintegernoMaximum results, 1 to 50. Default: 10.

Each result contains id, plain-text title, url, plain-text excerpt, and a section array. Each section contains id, name, and slug.

The ability requires the read capability and filters each result through WordPress’s read_post capability. It also respects the wzkb_rest_route_permission filter for the search route, so visibility rules configured for the REST search endpoint also apply.

knowledgebase/get-sections

Return the hierarchical wzkb_category section tree.

InputTypeRequiredDescription
parentintegernoParent section ID. Omit or use 0 for top-level sections.

Each section contains id, name, slug, url, and children. Supplying a parent returns its child sections and their descendants. The ability requires read and respects the wzkb_rest_route_permission filter for the sections route.

Pro abilities

knowledgebase/create-article

Create an article as a draft for an editor to review. The ability always sets post_status to draft; publishing remains a manual action in WordPress.

InputTypeRequiredDescription
titlestringyesArticle title, 1 to 200 characters.
contentstringyesArticle content, 1 to 100,000 characters. Safe post HTML is allowed.
sectionintegernoExisting wzkb_category term ID.

The ability requires the Knowledge Base post type’s create capability, which defaults to edit_posts. When section is supplied, the user must also be able to assign terms. It returns the new article’s id and edit_url.

knowledgebase/ask

Knowledge Base Pro also registers the Ask the Docs ability. It accepts a question, returns the same answer data as the Ask the Docs REST endpoint, and is available to logged-in users by default. It is registered only on WordPress 7.0 or later, where Ask the Docs loads. See the Ask the Docs developer reference for its filters, response and limits.

GitHub import abilities (Pro only)

Knowledge Base Pro 3.3.0 adds three abilities that let an AI agent drive the GitHub documentation sync: list your import sources, preview a planned import and run it. They use the GitHub mappings configured under Knowledge Base → Settings → GitHub (see Syncing Docs with GitHub). Credentials are never returned.

knowledgebase/list-github-mappings

Lists every enabled GitHub import source.

FieldTypeDescription
idstringStable source ID. It changes if the mapping’s import-related settings change.
repostringGitHub owner and repository name.
folderstringImported repository folder, or an empty string for the repository root.
branchstringConfigured branch, or an empty string to use the repository default.
has_credentialsbooleanWhether a mapping or global GitHub token is configured. This does not verify token access.

knowledgebase/preview-github-import and knowledgebase/import-github-articles

Both abilities take the same input. Preview reports the planned changes without touching articles; import applies them, following each mapping’s duplicate handling, exclusions, product and default status.

InputTypeRequiredDescription
mapping_idsarray of stringsone of the two selectorsStable mapping IDs returned by the list ability.
allbooleanone of the two selectorsSet true to select every enabled mapping. Cannot be combined with mapping_ids.
filestringnoExact repository-relative Markdown path to limit the run to one file. Omit to process every Markdown file in the selected mappings.

Each result contains mapping_id, repo, path, action (such as created, updated, skipped, excluded, deleted, uncertain or error), post_id, and a note, warning and error with any details.

Listing and previewing require manage_options. Importing also requires the Knowledge Base post type’s edit, publish and delete capabilities, and the ability to assign the Knowledge Base section, product and tag terms.

curl --get \
  --data-urlencode 'input[all]=true' \
  'https://example.com/wp-json/wp-abilities/v1/abilities/knowledgebase/preview-github-import/run'

Import is destructive, so it runs with POST and a JSON body:

curl --request POST \
  --header 'Content-Type: application/json' \
  --data '{"input":{"mapping_ids":["<stable-mapping-id>"],"file":"docs/getting-started.md"}}' \
  'https://example.com/wp-json/wp-abilities/v1/abilities/knowledgebase/import-github-articles/run'

WP-CLI

Knowledge Base Pro 3.3.0 adds WP-CLI commands for search, status, cache, settings, ratings, Ask the Docs and GitHub documentation sync. See Knowledge Base WP-CLI commands for the full reference.

See also

Was this article helpful?