npm · Capability

npm Hooks API — Hooks

npm Hooks API — Hooks. 5 operations. Lead operation: List webhooks. Self-contained Naftiko capability covering one Npm business surface.

Run with Naftiko NpmHooks

What You Can Do

GET
Listhooks — List webhooks
/v1//npm/v1/hooks
POST
Createhook — Create a webhook
/v1//npm/v1/hooks/hook
GET
Gethook — Get a webhook
/v1//npm/v1/hooks/hook/{id}
PUT
Updatehook — Update a webhook
/v1//npm/v1/hooks/hook/{id}
DELETE
Deletehook — Delete a webhook
/v1//npm/v1/hooks/hook/{id}

MCP Tools

list-webhooks

List webhooks

read-only idempotent
create-webhook

Create a webhook

get-webhook

Get a webhook

read-only idempotent
update-webhook

Update a webhook

idempotent
delete-webhook

Delete a webhook

idempotent

Capability Spec

hooks-hooks.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: npm Hooks API — Hooks
  description: 'npm Hooks API — Hooks. 5 operations. Lead operation: List webhooks. Self-contained Naftiko capability covering
    one Npm business surface.'
  tags:
  - Npm
  - Hooks
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    NPM_API_KEY: NPM_API_KEY
capability:
  consumes:
  - type: http
    namespace: hooks-hooks
    baseUri: https://registry.npmjs.org
    description: npm Hooks API — Hooks business capability. Self-contained, no shared references.
    resources:
    - name: --npm-v1-hooks
      path: /-/npm/v1/hooks
      operations:
      - name: listhooks
        method: GET
        description: List webhooks
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: package
          in: query
          type: string
          description: Filter hooks by package name. Does not support regular expressions.
        - name: limit
          in: query
          type: integer
          description: Maximum number of hooks to return.
        - name: offset
          in: query
          type: integer
          description: Number of hooks to skip for pagination.
    - name: --npm-v1-hooks-hook
      path: /-/npm/v1/hooks/hook
      operations:
      - name: createhook
        method: POST
        description: Create a webhook
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: --npm-v1-hooks-hook-id
      path: /-/npm/v1/hooks/hook/{id}
      operations:
      - name: gethook
        method: GET
        description: Get a webhook
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: updatehook
        method: PUT
        description: Update a webhook
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
      - name: deletehook
        method: DELETE
        description: Delete a webhook
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    authentication:
      type: bearer
      token: '{{env.NPM_API_KEY}}'
  exposes:
  - type: rest
    namespace: hooks-hooks-rest
    port: 8080
    description: REST adapter for npm Hooks API — Hooks. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1//npm/v1/hooks
      name: npm-v1-hooks
      description: REST surface for --npm-v1-hooks.
      operations:
      - method: GET
        name: listhooks
        description: List webhooks
        call: hooks-hooks.listhooks
        with:
          package: rest.package
          limit: rest.limit
          offset: rest.offset
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1//npm/v1/hooks/hook
      name: npm-v1-hooks-hook
      description: REST surface for --npm-v1-hooks-hook.
      operations:
      - method: POST
        name: createhook
        description: Create a webhook
        call: hooks-hooks.createhook
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1//npm/v1/hooks/hook/{id}
      name: npm-v1-hooks-hook-id
      description: REST surface for --npm-v1-hooks-hook-id.
      operations:
      - method: GET
        name: gethook
        description: Get a webhook
        call: hooks-hooks.gethook
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: updatehook
        description: Update a webhook
        call: hooks-hooks.updatehook
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: deletehook
        description: Delete a webhook
        call: hooks-hooks.deletehook
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: hooks-hooks-mcp
    port: 9090
    transport: http
    description: MCP adapter for npm Hooks API — Hooks. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: list-webhooks
      description: List webhooks
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: hooks-hooks.listhooks
      with:
        package: tools.package
        limit: tools.limit
        offset: tools.offset
      outputParameters:
      - type: object
        mapping: $.
    - name: create-webhook
      description: Create a webhook
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: hooks-hooks.createhook
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: get-webhook
      description: Get a webhook
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: hooks-hooks.gethook
      outputParameters:
      - type: object
        mapping: $.
    - name: update-webhook
      description: Update a webhook
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: hooks-hooks.updatehook
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: delete-webhook
      description: Delete a webhook
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: hooks-hooks.deletehook
      outputParameters:
      - type: object
        mapping: $.