GoatCounter · Capability

GoatCounter API — Sites

GoatCounter API — Sites. 5 operations. Lead operation: List sites. Self-contained Naftiko capability covering one Goatcounter business surface.

Run with Naftiko GoatcounterSites

What You Can Do

GET
Listsites — List sites
/v1/sites
PUT
Createsite — Create a new site
/v1/sites
GET
Getsite — Get site detail
/v1/sites/{id}
POST
Updatesitepost — Update a site
/v1/sites/{id}
PATCH
Patchsite — Patch a site
/v1/sites/{id}

MCP Tools

list-sites

List sites

read-only idempotent
create-new-site

Create a new site

idempotent
get-site-detail

Get site detail

read-only idempotent
update-site

Update a site

patch-site

Patch a site

idempotent

Capability Spec

goatcounter-sites.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: GoatCounter API — Sites
  description: 'GoatCounter API — Sites. 5 operations. Lead operation: List sites. Self-contained Naftiko capability covering
    one Goatcounter business surface.'
  tags:
  - Goatcounter
  - Sites
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    GOATCOUNTER_API_KEY: GOATCOUNTER_API_KEY
capability:
  consumes:
  - type: http
    namespace: goatcounter-sites
    baseUri: https://goatcounter.com/api/v0
    description: GoatCounter API — Sites business capability. Self-contained, no shared references.
    resources:
    - name: sites
      path: /sites
      operations:
      - name: listsites
        method: GET
        description: List sites
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: createsite
        method: PUT
        description: Create a new site
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: sites-id
      path: /sites/{id}
      operations:
      - name: getsite
        method: GET
        description: Get site detail
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: id
          in: path
          type: integer
          required: true
      - name: updatesitepost
        method: POST
        description: Update a site
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: id
          in: path
          type: integer
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
      - name: patchsite
        method: PATCH
        description: Patch a site
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: id
          in: path
          type: integer
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    authentication:
      type: bearer
      token: '{{env.GOATCOUNTER_API_KEY}}'
  exposes:
  - type: rest
    namespace: goatcounter-sites-rest
    port: 8080
    description: REST adapter for GoatCounter API — Sites. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/sites
      name: sites
      description: REST surface for sites.
      operations:
      - method: GET
        name: listsites
        description: List sites
        call: goatcounter-sites.listsites
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: createsite
        description: Create a new site
        call: goatcounter-sites.createsite
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/sites/{id}
      name: sites-id
      description: REST surface for sites-id.
      operations:
      - method: GET
        name: getsite
        description: Get site detail
        call: goatcounter-sites.getsite
        with:
          id: rest.id
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: updatesitepost
        description: Update a site
        call: goatcounter-sites.updatesitepost
        with:
          id: rest.id
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: PATCH
        name: patchsite
        description: Patch a site
        call: goatcounter-sites.patchsite
        with:
          id: rest.id
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: goatcounter-sites-mcp
    port: 9090
    transport: http
    description: MCP adapter for GoatCounter API — Sites. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: list-sites
      description: List sites
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: goatcounter-sites.listsites
      outputParameters:
      - type: object
        mapping: $.
    - name: create-new-site
      description: Create a new site
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: goatcounter-sites.createsite
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: get-site-detail
      description: Get site detail
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: goatcounter-sites.getsite
      with:
        id: tools.id
      outputParameters:
      - type: object
        mapping: $.
    - name: update-site
      description: Update a site
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: goatcounter-sites.updatesitepost
      with:
        id: tools.id
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: patch-site
      description: Patch a site
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: goatcounter-sites.patchsite
      with:
        id: tools.id
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.