planetscale · Capability

PlanetScale Platform API — Service Tokens

PlanetScale Platform API — Service Tokens. 6 operations. Lead operation: List service tokens. Self-contained Naftiko capability covering one Planetscale business surface.

Run with Naftiko PlanetscaleService Tokens

What You Can Do

GET
Listservicetokens — List service tokens
/v1/organizations/{organization}/service-tokens
POST
Createservicetoken — Create a service token
/v1/organizations/{organization}/service-tokens
GET
Getservicetoken — Get a service token
/v1/organizations/{organization}/service-tokens/{service-token-id}
DELETE
Deleteservicetoken — Delete a service token
/v1/organizations/{organization}/service-tokens/{service-token-id}
GET
Listservicetokenaccesses — List service token accesses
/v1/organizations/{organization}/service-tokens/{service-token-id}/accesses
POST
Createservicetokenaccess — Grant service token access
/v1/organizations/{organization}/service-tokens/{service-token-id}/accesses

MCP Tools

list-service-tokens

List service tokens

read-only idempotent
create-service-token

Create a service token

get-service-token

Get a service token

read-only idempotent
delete-service-token

Delete a service token

idempotent
list-service-token-accesses

List service token accesses

read-only idempotent
grant-service-token-access

Grant service token access

Capability Spec

platform-service-tokens.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: PlanetScale Platform API — Service Tokens
  description: 'PlanetScale Platform API — Service Tokens. 6 operations. Lead operation: List service tokens. Self-contained
    Naftiko capability covering one Planetscale business surface.'
  tags:
  - Planetscale
  - Service Tokens
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    PLANETSCALE_API_KEY: PLANETSCALE_API_KEY
capability:
  consumes:
  - type: http
    namespace: platform-service-tokens
    baseUri: https://api.planetscale.com/v1
    description: PlanetScale Platform API — Service Tokens business capability. Self-contained, no shared references.
    resources:
    - name: organizations-organization-service-tokens
      path: /organizations/{organization}/service-tokens
      operations:
      - name: listservicetokens
        method: GET
        description: List service tokens
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: createservicetoken
        method: POST
        description: Create a service token
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: organizations-organization-service-tokens-service_token_id
      path: /organizations/{organization}/service-tokens/{service_token_id}
      operations:
      - name: getservicetoken
        method: GET
        description: Get a service token
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: deleteservicetoken
        method: DELETE
        description: Delete a service token
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: organizations-organization-service-tokens-service_token_id-accesses
      path: /organizations/{organization}/service-tokens/{service_token_id}/accesses
      operations:
      - name: listservicetokenaccesses
        method: GET
        description: List service token accesses
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: createservicetokenaccess
        method: POST
        description: Grant service token access
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    authentication:
      type: bearer
      token: '{{env.PLANETSCALE_API_KEY}}'
  exposes:
  - type: rest
    namespace: platform-service-tokens-rest
    port: 8080
    description: REST adapter for PlanetScale Platform API — Service Tokens. One Spectral-compliant resource per consumed
      operation, prefixed with /v1.
    resources:
    - path: /v1/organizations/{organization}/service-tokens
      name: organizations-organization-service-tokens
      description: REST surface for organizations-organization-service-tokens.
      operations:
      - method: GET
        name: listservicetokens
        description: List service tokens
        call: platform-service-tokens.listservicetokens
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: createservicetoken
        description: Create a service token
        call: platform-service-tokens.createservicetoken
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/organizations/{organization}/service-tokens/{service-token-id}
      name: organizations-organization-service-tokens-service-token-id
      description: REST surface for organizations-organization-service-tokens-service_token_id.
      operations:
      - method: GET
        name: getservicetoken
        description: Get a service token
        call: platform-service-tokens.getservicetoken
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: deleteservicetoken
        description: Delete a service token
        call: platform-service-tokens.deleteservicetoken
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/organizations/{organization}/service-tokens/{service-token-id}/accesses
      name: organizations-organization-service-tokens-service-token-id-accesses
      description: REST surface for organizations-organization-service-tokens-service_token_id-accesses.
      operations:
      - method: GET
        name: listservicetokenaccesses
        description: List service token accesses
        call: platform-service-tokens.listservicetokenaccesses
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: createservicetokenaccess
        description: Grant service token access
        call: platform-service-tokens.createservicetokenaccess
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: platform-service-tokens-mcp
    port: 9090
    transport: http
    description: MCP adapter for PlanetScale Platform API — Service Tokens. One tool per consumed operation, routed inline
      through this capability's consumes block.
    tools:
    - name: list-service-tokens
      description: List service tokens
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: platform-service-tokens.listservicetokens
      outputParameters:
      - type: object
        mapping: $.
    - name: create-service-token
      description: Create a service token
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: platform-service-tokens.createservicetoken
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: get-service-token
      description: Get a service token
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: platform-service-tokens.getservicetoken
      outputParameters:
      - type: object
        mapping: $.
    - name: delete-service-token
      description: Delete a service token
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: platform-service-tokens.deleteservicetoken
      outputParameters:
      - type: object
        mapping: $.
    - name: list-service-token-accesses
      description: List service token accesses
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: platform-service-tokens.listservicetokenaccesses
      outputParameters:
      - type: object
        mapping: $.
    - name: grant-service-token-access
      description: Grant service token access
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: platform-service-tokens.createservicetokenaccess
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.