Stack Overflow · Capability

Stack Overflow API — Answers

Stack Overflow API — Answers. 4 operations. Lead operation: Get All Answers. Self-contained Naftiko capability covering one Stack Overflow business surface.

Run with Naftiko Stack OverflowAnswers

What You Can Do

GET
Getanswers — Get All Answers
/v1/answers
GET
Getanswersbyids — Get Answers by IDs
/v1/answers/{ids}
GET
Getanswersforquestion — Get Answers for Questions
/v1/questions/{ids}/answers
GET
Getanswersbyuser — Get Answers by User
/v1/users/{ids}/answers

MCP Tools

get-all-answers

Get All Answers

read-only idempotent
get-answers-ids

Get Answers by IDs

read-only idempotent
get-answers-questions

Get Answers for Questions

read-only idempotent
get-answers-user

Get Answers by User

read-only idempotent

Capability Spec

stack-overflow-answers.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Stack Overflow API — Answers
  description: 'Stack Overflow API — Answers. 4 operations. Lead operation: Get All Answers. Self-contained Naftiko capability
    covering one Stack Overflow business surface.'
  tags:
  - Stack Overflow
  - Answers
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    STACK_OVERFLOW_API_KEY: STACK_OVERFLOW_API_KEY
capability:
  consumes:
  - type: http
    namespace: stack-overflow-answers
    baseUri: https://api.stackexchange.com/2.3
    description: Stack Overflow API — Answers business capability. Self-contained, no shared references.
    resources:
    - name: answers
      path: /answers
      operations:
      - name: getanswers
        method: GET
        description: Get All Answers
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: answers-ids
      path: /answers/{ids}
      operations:
      - name: getanswersbyids
        method: GET
        description: Get Answers by IDs
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: ids
          in: path
          type: string
          description: Semicolon-delimited list of answer IDs
          required: true
    - name: questions-ids-answers
      path: /questions/{ids}/answers
      operations:
      - name: getanswersforquestion
        method: GET
        description: Get Answers for Questions
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: ids
          in: path
          type: string
          description: Semicolon-delimited list of question IDs
          required: true
    - name: users-ids-answers
      path: /users/{ids}/answers
      operations:
      - name: getanswersbyuser
        method: GET
        description: Get Answers by User
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: ids
          in: path
          type: string
          description: Semicolon-delimited list of user IDs
          required: true
    authentication:
      type: bearer
      token: '{{env.STACK_OVERFLOW_API_KEY}}'
  exposes:
  - type: rest
    namespace: stack-overflow-answers-rest
    port: 8080
    description: REST adapter for Stack Overflow API — Answers. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/answers
      name: answers
      description: REST surface for answers.
      operations:
      - method: GET
        name: getanswers
        description: Get All Answers
        call: stack-overflow-answers.getanswers
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/answers/{ids}
      name: answers-ids
      description: REST surface for answers-ids.
      operations:
      - method: GET
        name: getanswersbyids
        description: Get Answers by IDs
        call: stack-overflow-answers.getanswersbyids
        with:
          ids: rest.ids
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/questions/{ids}/answers
      name: questions-ids-answers
      description: REST surface for questions-ids-answers.
      operations:
      - method: GET
        name: getanswersforquestion
        description: Get Answers for Questions
        call: stack-overflow-answers.getanswersforquestion
        with:
          ids: rest.ids
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/users/{ids}/answers
      name: users-ids-answers
      description: REST surface for users-ids-answers.
      operations:
      - method: GET
        name: getanswersbyuser
        description: Get Answers by User
        call: stack-overflow-answers.getanswersbyuser
        with:
          ids: rest.ids
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: stack-overflow-answers-mcp
    port: 9090
    transport: http
    description: MCP adapter for Stack Overflow API — Answers. One tool per consumed operation, routed inline through this
      capability's consumes block.
    tools:
    - name: get-all-answers
      description: Get All Answers
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: stack-overflow-answers.getanswers
      outputParameters:
      - type: object
        mapping: $.
    - name: get-answers-ids
      description: Get Answers by IDs
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: stack-overflow-answers.getanswersbyids
      with:
        ids: tools.ids
      outputParameters:
      - type: object
        mapping: $.
    - name: get-answers-questions
      description: Get Answers for Questions
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: stack-overflow-answers.getanswersforquestion
      with:
        ids: tools.ids
      outputParameters:
      - type: object
        mapping: $.
    - name: get-answers-user
      description: Get Answers by User
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: stack-overflow-answers.getanswersbyuser
      with:
        ids: tools.ids
      outputParameters:
      - type: object
        mapping: $.