Apache Pulsar · Capability

Apache Pulsar Admin REST API — Topics

Apache Pulsar Admin REST API — Topics. 6 operations. Lead operation: List persistent topics. Self-contained Naftiko capability covering one Apache Pulsar business surface.

Run with Naftiko Apache PulsarTopics

What You Can Do

GET
Listpersistenttopics — List persistent topics
/v1/persistent/{tenant}/{namespace}
PUT
Createnonpartitionedtopic — Create non-partitioned topic
/v1/persistent/{tenant}/{namespace}/{topic}
DELETE
Deletetopic — Delete topic
/v1/persistent/{tenant}/{namespace}/{topic}
GET
Getpartitionedtopicmetadata — Get partitioned topic metadata
/v1/persistent/{tenant}/{namespace}/{topic}/partitions
PUT
Createpartitionedtopic — Create partitioned topic
/v1/persistent/{tenant}/{namespace}/{topic}/partitions
GET
Gettopicstats — Get topic stats
/v1/persistent/{tenant}/{namespace}/{topic}/stats

MCP Tools

list-persistent-topics

List persistent topics

read-only idempotent
create-non-partitioned-topic

Create non-partitioned topic

idempotent
delete-topic

Delete topic

idempotent
get-partitioned-topic-metadata

Get partitioned topic metadata

read-only idempotent
create-partitioned-topic

Create partitioned topic

idempotent
get-topic-stats

Get topic stats

read-only idempotent

Capability Spec

pulsar-admin-topics.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Apache Pulsar Admin REST API — Topics
  description: 'Apache Pulsar Admin REST API — Topics. 6 operations. Lead operation: List persistent topics. Self-contained
    Naftiko capability covering one Apache Pulsar business surface.'
  tags:
  - Apache Pulsar
  - Topics
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    APACHE_PULSAR_API_KEY: APACHE_PULSAR_API_KEY
capability:
  consumes:
  - type: http
    namespace: pulsar-admin-topics
    baseUri: http://localhost:8080/admin/v2
    description: Apache Pulsar Admin REST API — Topics business capability. Self-contained, no shared references.
    resources:
    - name: persistent-tenant-namespace
      path: /persistent/{tenant}/{namespace}
      operations:
      - name: listpersistenttopics
        method: GET
        description: List persistent topics
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: tenant
          in: path
          type: string
          required: true
        - name: namespace
          in: path
          type: string
          required: true
    - name: persistent-tenant-namespace-topic
      path: /persistent/{tenant}/{namespace}/{topic}
      operations:
      - name: createnonpartitionedtopic
        method: PUT
        description: Create non-partitioned topic
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: tenant
          in: path
          type: string
          required: true
        - name: namespace
          in: path
          type: string
          required: true
        - name: topic
          in: path
          type: string
          required: true
      - name: deletetopic
        method: DELETE
        description: Delete topic
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: tenant
          in: path
          type: string
          required: true
        - name: namespace
          in: path
          type: string
          required: true
        - name: topic
          in: path
          type: string
          required: true
        - name: force
          in: query
          type: boolean
    - name: persistent-tenant-namespace-topic-partitions
      path: /persistent/{tenant}/{namespace}/{topic}/partitions
      operations:
      - name: getpartitionedtopicmetadata
        method: GET
        description: Get partitioned topic metadata
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: tenant
          in: path
          type: string
          required: true
        - name: namespace
          in: path
          type: string
          required: true
        - name: topic
          in: path
          type: string
          required: true
      - name: createpartitionedtopic
        method: PUT
        description: Create partitioned topic
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: tenant
          in: path
          type: string
          required: true
        - name: namespace
          in: path
          type: string
          required: true
        - name: topic
          in: path
          type: string
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: persistent-tenant-namespace-topic-stats
      path: /persistent/{tenant}/{namespace}/{topic}/stats
      operations:
      - name: gettopicstats
        method: GET
        description: Get topic stats
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: tenant
          in: path
          type: string
          required: true
        - name: namespace
          in: path
          type: string
          required: true
        - name: topic
          in: path
          type: string
          required: true
        - name: getPreciseBacklog
          in: query
          type: boolean
        - name: subscriptionBacklogSize
          in: query
          type: boolean
  exposes:
  - type: rest
    namespace: pulsar-admin-topics-rest
    port: 8080
    description: REST adapter for Apache Pulsar Admin REST API — Topics. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/persistent/{tenant}/{namespace}
      name: persistent-tenant-namespace
      description: REST surface for persistent-tenant-namespace.
      operations:
      - method: GET
        name: listpersistenttopics
        description: List persistent topics
        call: pulsar-admin-topics.listpersistenttopics
        with:
          tenant: rest.tenant
          namespace: rest.namespace
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/persistent/{tenant}/{namespace}/{topic}
      name: persistent-tenant-namespace-topic
      description: REST surface for persistent-tenant-namespace-topic.
      operations:
      - method: PUT
        name: createnonpartitionedtopic
        description: Create non-partitioned topic
        call: pulsar-admin-topics.createnonpartitionedtopic
        with:
          tenant: rest.tenant
          namespace: rest.namespace
          topic: rest.topic
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: deletetopic
        description: Delete topic
        call: pulsar-admin-topics.deletetopic
        with:
          tenant: rest.tenant
          namespace: rest.namespace
          topic: rest.topic
          force: rest.force
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/persistent/{tenant}/{namespace}/{topic}/partitions
      name: persistent-tenant-namespace-topic-partitions
      description: REST surface for persistent-tenant-namespace-topic-partitions.
      operations:
      - method: GET
        name: getpartitionedtopicmetadata
        description: Get partitioned topic metadata
        call: pulsar-admin-topics.getpartitionedtopicmetadata
        with:
          tenant: rest.tenant
          namespace: rest.namespace
          topic: rest.topic
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: createpartitionedtopic
        description: Create partitioned topic
        call: pulsar-admin-topics.createpartitionedtopic
        with:
          tenant: rest.tenant
          namespace: rest.namespace
          topic: rest.topic
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/persistent/{tenant}/{namespace}/{topic}/stats
      name: persistent-tenant-namespace-topic-stats
      description: REST surface for persistent-tenant-namespace-topic-stats.
      operations:
      - method: GET
        name: gettopicstats
        description: Get topic stats
        call: pulsar-admin-topics.gettopicstats
        with:
          tenant: rest.tenant
          namespace: rest.namespace
          topic: rest.topic
          getPreciseBacklog: rest.getPreciseBacklog
          subscriptionBacklogSize: rest.subscriptionBacklogSize
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: pulsar-admin-topics-mcp
    port: 9090
    transport: http
    description: MCP adapter for Apache Pulsar Admin REST API — Topics. One tool per consumed operation, routed inline through
      this capability's consumes block.
    tools:
    - name: list-persistent-topics
      description: List persistent topics
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: pulsar-admin-topics.listpersistenttopics
      with:
        tenant: tools.tenant
        namespace: tools.namespace
      outputParameters:
      - type: object
        mapping: $.
    - name: create-non-partitioned-topic
      description: Create non-partitioned topic
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: pulsar-admin-topics.createnonpartitionedtopic
      with:
        tenant: tools.tenant
        namespace: tools.namespace
        topic: tools.topic
      outputParameters:
      - type: object
        mapping: $.
    - name: delete-topic
      description: Delete topic
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: pulsar-admin-topics.deletetopic
      with:
        tenant: tools.tenant
        namespace: tools.namespace
        topic: tools.topic
        force: tools.force
      outputParameters:
      - type: object
        mapping: $.
    - name: get-partitioned-topic-metadata
      description: Get partitioned topic metadata
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: pulsar-admin-topics.getpartitionedtopicmetadata
      with:
        tenant: tools.tenant
        namespace: tools.namespace
        topic: tools.topic
      outputParameters:
      - type: object
        mapping: $.
    - name: create-partitioned-topic
      description: Create partitioned topic
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: pulsar-admin-topics.createpartitionedtopic
      with:
        tenant: tools.tenant
        namespace: tools.namespace
        topic: tools.topic
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: get-topic-stats
      description: Get topic stats
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: pulsar-admin-topics.gettopicstats
      with:
        tenant: tools.tenant
        namespace: tools.namespace
        topic: tools.topic
        getPreciseBacklog: tools.getPreciseBacklog
        subscriptionBacklogSize: tools.subscriptionBacklogSize
      outputParameters:
      - type: object
        mapping: $.