Discord · Capability

Discord REST API — Roles

Discord REST API — Roles. 4 operations. Lead operation: Discord List guild roles. Self-contained Naftiko capability covering one Discord business surface.

Run with Naftiko DiscordRoles

What You Can Do

GET
Getguildroles — Discord List guild roles
/v1/guilds/{guild-id}/roles
POST
Createguildrole — Discord Create guild role
/v1/guilds/{guild-id}/roles
PATCH
Modifyguildrole — Discord Modify guild role
/v1/guilds/{guild-id}/roles/{role-id}
DELETE
Deleteguildrole — Discord Delete guild role
/v1/guilds/{guild-id}/roles/{role-id}

MCP Tools

discord-list-guild-roles

Discord List guild roles

read-only idempotent
discord-create-guild-role

Discord Create guild role

discord-modify-guild-role

Discord Modify guild role

idempotent
discord-delete-guild-role

Discord Delete guild role

idempotent

Capability Spec

rest-roles.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Discord REST API — Roles
  description: 'Discord REST API — Roles. 4 operations. Lead operation: Discord List guild roles. Self-contained Naftiko capability
    covering one Discord business surface.'
  tags:
  - Discord
  - Roles
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    DISCORD_API_KEY: DISCORD_API_KEY
capability:
  consumes:
  - type: http
    namespace: rest-roles
    baseUri: https://discord.com/api/v10
    description: Discord REST API — Roles business capability. Self-contained, no shared references.
    resources:
    - name: guilds-guild_id-roles
      path: /guilds/{guild_id}/roles
      operations:
      - name: getguildroles
        method: GET
        description: Discord List guild roles
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: createguildrole
        method: POST
        description: Discord Create guild role
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: guilds-guild_id-roles-role_id
      path: /guilds/{guild_id}/roles/{role_id}
      operations:
      - name: modifyguildrole
        method: PATCH
        description: Discord Modify guild role
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: role_id
          in: path
          type: string
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
      - name: deleteguildrole
        method: DELETE
        description: Discord Delete guild role
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: role_id
          in: path
          type: string
          required: true
    authentication:
      type: bearer
      token: '{{env.DISCORD_API_KEY}}'
  exposes:
  - type: rest
    namespace: rest-roles-rest
    port: 8080
    description: REST adapter for Discord REST API — Roles. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/guilds/{guild-id}/roles
      name: guilds-guild-id-roles
      description: REST surface for guilds-guild_id-roles.
      operations:
      - method: GET
        name: getguildroles
        description: Discord List guild roles
        call: rest-roles.getguildroles
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: createguildrole
        description: Discord Create guild role
        call: rest-roles.createguildrole
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/guilds/{guild-id}/roles/{role-id}
      name: guilds-guild-id-roles-role-id
      description: REST surface for guilds-guild_id-roles-role_id.
      operations:
      - method: PATCH
        name: modifyguildrole
        description: Discord Modify guild role
        call: rest-roles.modifyguildrole
        with:
          role_id: rest.role_id
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: deleteguildrole
        description: Discord Delete guild role
        call: rest-roles.deleteguildrole
        with:
          role_id: rest.role_id
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: rest-roles-mcp
    port: 9090
    transport: http
    description: MCP adapter for Discord REST API — Roles. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: discord-list-guild-roles
      description: Discord List guild roles
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-roles.getguildroles
      outputParameters:
      - type: object
        mapping: $.
    - name: discord-create-guild-role
      description: Discord Create guild role
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: rest-roles.createguildrole
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: discord-modify-guild-role
      description: Discord Modify guild role
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: rest-roles.modifyguildrole
      with:
        role_id: tools.role_id
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: discord-delete-guild-role
      description: Discord Delete guild role
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: rest-roles.deleteguildrole
      with:
        role_id: tools.role_id
      outputParameters:
      - type: object
        mapping: $.