WordPress · Capability

WordPress REST API — Categories

WordPress REST API — Categories. 2 operations. Lead operation: WordPress List Categories. Self-contained Naftiko capability covering one Wordpress business surface.

Run with Naftiko WordpressCategories

What You Can Do

GET
Listcategories — WordPress List Categories
/v1/wp/v2/categories
POST
Createcategory — WordPress Create Category
/v1/wp/v2/categories

MCP Tools

wordpress-list-categories

WordPress List Categories

read-only idempotent
wordpress-create-category

WordPress Create Category

Capability Spec

rest-categories.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: WordPress REST API — Categories
  description: 'WordPress REST API — Categories. 2 operations. Lead operation: WordPress List Categories. Self-contained Naftiko
    capability covering one Wordpress business surface.'
  tags:
  - Wordpress
  - Categories
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    WORDPRESS_API_KEY: WORDPRESS_API_KEY
capability:
  consumes:
  - type: http
    namespace: rest-categories
    baseUri: https://{site}/wp-json
    description: WordPress REST API — Categories business capability. Self-contained, no shared references.
    resources:
    - name: wp-v2-categories
      path: /wp/v2/categories
      operations:
      - name: listcategories
        method: GET
        description: WordPress List Categories
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: page
          in: query
          type: integer
          description: Current page of the collection.
        - name: per_page
          in: query
          type: integer
          description: Maximum number of items.
        - name: search
          in: query
          type: string
          description: Limit results to matching categories.
        - name: hide_empty
          in: query
          type: boolean
          description: Whether to hide terms not assigned to any posts.
      - name: createcategory
        method: POST
        description: WordPress Create Category
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    authentication:
      type: apikey
      key: wordpress_logged_in
      value: '{{env.WORDPRESS_API_KEY}}'
      placement: cookie
  exposes:
  - type: rest
    namespace: rest-categories-rest
    port: 8080
    description: REST adapter for WordPress REST API — Categories. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/wp/v2/categories
      name: wp-v2-categories
      description: REST surface for wp-v2-categories.
      operations:
      - method: GET
        name: listcategories
        description: WordPress List Categories
        call: rest-categories.listcategories
        with:
          page: rest.page
          per_page: rest.per_page
          search: rest.search
          hide_empty: rest.hide_empty
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: createcategory
        description: WordPress Create Category
        call: rest-categories.createcategory
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: rest-categories-mcp
    port: 9090
    transport: http
    description: MCP adapter for WordPress REST API — Categories. One tool per consumed operation, routed inline through this
      capability's consumes block.
    tools:
    - name: wordpress-list-categories
      description: WordPress List Categories
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-categories.listcategories
      with:
        page: tools.page
        per_page: tools.per_page
        search: tools.search
        hide_empty: tools.hide_empty
      outputParameters:
      - type: object
        mapping: $.
    - name: wordpress-create-category
      description: WordPress Create Category
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: rest-categories.createcategory
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.