JSONPlaceholder · Capability

JSONPlaceholder REST API — Comments

Comments — the JSONPlaceholder comments surface. 6 operations. Lead operation: List Comments. Self-contained Naftiko capability covering one JSONPlaceholder business surface.

Run with Naftiko JSONPlaceholderCommentsFake REST

What You Can Do

GET
Listcomments — List all comments.
/v1/comments
POST
Createcomment — Create a new comment (simulated).
/v1/comments
GET
Getcomment — Get a single comment by id.
/v1/comments/{id}
PUT
Replacecomment — Replace a comment in full (simulated).
/v1/comments/{id}
PATCH
Updatecomment — Partially update a comment (simulated).
/v1/comments/{id}
DELETE
Deletecomment — Delete a comment (simulated).
/v1/comments/{id}

MCP Tools

list-comments

List all comments, optionally filtered by postId.

read-only idempotent
create-comment

Create a new comment (simulated).

get-comment

Get a single comment by id.

read-only idempotent
replace-comment

Replace a comment in full (simulated).

idempotent
update-comment

Partially update a comment (simulated).

idempotent
delete-comment

Delete a comment (simulated).

idempotent

Capability Spec

jsonplaceholder-comments.yaml Raw ↑
naftiko: "1.0.0-alpha2"

info:
  label: "JSONPlaceholder REST API — Comments"
  description: >-
    Comments — the JSONPlaceholder comments surface. 6 operations. Lead
    operation: List Comments. Self-contained Naftiko capability covering one
    JSONPlaceholder business surface.
  tags:
    - JSONPlaceholder
    - Comments
    - Fake REST
  created: "2026-05-29"
  modified: "2026-05-29"

binds:
  - namespace: env
    keys:
      JSONPLACEHOLDER_BASE_URL: JSONPLACEHOLDER_BASE_URL

capability:

  consumes:
    - type: http
      namespace: "jsonplaceholder-comments"
      baseUri: "https://jsonplaceholder.typicode.com"
      description: "JSONPlaceholder Comments surface. No authentication required."
      resources:
        - name: "comments"
          path: "/comments"
          operations:
            - name: "listComments"
              method: GET
              description: "List all 500 comments; optional query filters."
              inputParameters:
                - name: "postId"
                  in: query
                  type: integer
                  required: false
                  description: "Filter comments by post id."
              outputRawFormat: json
              outputParameters:
                - name: result
                  type: object
                  value: "$."
            - name: "createComment"
              method: POST
              description: "Create a new comment (simulated)."
              inputParameters:
                - name: "body"
                  in: body
                  type: object
                  required: true
                  description: "Comment payload."
              outputRawFormat: json
              outputParameters:
                - name: result
                  type: object
                  value: "$."
        - name: "comment"
          path: "/comments/{id}"
          operations:
            - name: "getComment"
              method: GET
              description: "Get a single comment by id."
              inputParameters:
                - name: "id"
                  in: path
                  type: integer
                  required: true
                  description: "Comment identifier (1-500)."
              outputRawFormat: json
              outputParameters:
                - name: result
                  type: object
                  value: "$."
            - name: "replaceComment"
              method: PUT
              description: "Replace a comment in full (simulated)."
              inputParameters:
                - name: "id"
                  in: path
                  type: integer
                  required: true
                  description: "Comment identifier."
                - name: "body"
                  in: body
                  type: object
                  required: true
                  description: "Full replacement payload."
              outputRawFormat: json
              outputParameters:
                - name: result
                  type: object
                  value: "$."
            - name: "updateComment"
              method: PATCH
              description: "Partially update a comment (simulated)."
              inputParameters:
                - name: "id"
                  in: path
                  type: integer
                  required: true
                  description: "Comment identifier."
                - name: "body"
                  in: body
                  type: object
                  required: true
                  description: "Partial update payload."
              outputRawFormat: json
              outputParameters:
                - name: result
                  type: object
                  value: "$."
            - name: "deleteComment"
              method: DELETE
              description: "Delete a comment (simulated)."
              inputParameters:
                - name: "id"
                  in: path
                  type: integer
                  required: true
                  description: "Comment identifier."
              outputRawFormat: json
              outputParameters:
                - name: result
                  type: object
                  value: "$."

  exposes:
    - type: rest
      namespace: "jsonplaceholder-comments-rest"
      port: 8080
      description: "REST adapter for JSONPlaceholder Comments."
      resources:
        - path: "/v1/comments"
          name: "comments"
          description: "List and create comments."
          operations:
            - method: GET
              name: "listComments"
              description: "List all comments."
              call: "jsonplaceholder-comments.listComments"
              with:
                "postId": "rest.postId"
              outputParameters:
                - type: object
                  mapping: "$."
            - method: POST
              name: "createComment"
              description: "Create a new comment (simulated)."
              call: "jsonplaceholder-comments.createComment"
              with:
                "body": "rest.body"
              outputParameters:
                - type: object
                  mapping: "$."
        - path: "/v1/comments/{id}"
          name: "comment"
          description: "Read, replace, update, or delete a single comment."
          operations:
            - method: GET
              name: "getComment"
              description: "Get a single comment by id."
              call: "jsonplaceholder-comments.getComment"
              with:
                "id": "rest.id"
              outputParameters:
                - type: object
                  mapping: "$."
            - method: PUT
              name: "replaceComment"
              description: "Replace a comment in full (simulated)."
              call: "jsonplaceholder-comments.replaceComment"
              with:
                "id": "rest.id"
                "body": "rest.body"
              outputParameters:
                - type: object
                  mapping: "$."
            - method: PATCH
              name: "updateComment"
              description: "Partially update a comment (simulated)."
              call: "jsonplaceholder-comments.updateComment"
              with:
                "id": "rest.id"
                "body": "rest.body"
              outputParameters:
                - type: object
                  mapping: "$."
            - method: DELETE
              name: "deleteComment"
              description: "Delete a comment (simulated)."
              call: "jsonplaceholder-comments.deleteComment"
              with:
                "id": "rest.id"
              outputParameters:
                - type: object
                  mapping: "$."

    - type: mcp
      namespace: "jsonplaceholder-comments-mcp"
      port: 9090
      transport: http
      description: "MCP adapter for JSONPlaceholder Comments."
      tools:
        - name: "list-comments"
          description: "List all comments, optionally filtered by postId."
          hints:
            readOnly: true
            destructive: false
            idempotent: true
          call: "jsonplaceholder-comments.listComments"
          with:
            "postId": "tools.postId"
          outputParameters:
            - type: object
              mapping: "$."
        - name: "create-comment"
          description: "Create a new comment (simulated)."
          hints:
            readOnly: false
            destructive: false
            idempotent: false
          call: "jsonplaceholder-comments.createComment"
          with:
            "body": "tools.body"
          outputParameters:
            - type: object
              mapping: "$."
        - name: "get-comment"
          description: "Get a single comment by id."
          hints:
            readOnly: true
            destructive: false
            idempotent: true
          call: "jsonplaceholder-comments.getComment"
          with:
            "id": "tools.id"
          outputParameters:
            - type: object
              mapping: "$."
        - name: "replace-comment"
          description: "Replace a comment in full (simulated)."
          hints:
            readOnly: false
            destructive: false
            idempotent: true
          call: "jsonplaceholder-comments.replaceComment"
          with:
            "id": "tools.id"
            "body": "tools.body"
          outputParameters:
            - type: object
              mapping: "$."
        - name: "update-comment"
          description: "Partially update a comment (simulated)."
          hints:
            readOnly: false
            destructive: false
            idempotent: true
          call: "jsonplaceholder-comments.updateComment"
          with:
            "id": "tools.id"
            "body": "tools.body"
          outputParameters:
            - type: object
              mapping: "$."
        - name: "delete-comment"
          description: "Delete a comment (simulated)."
          hints:
            readOnly: false
            destructive: true
            idempotent: true
          call: "jsonplaceholder-comments.deleteComment"
          with:
            "id": "tools.id"
          outputParameters:
            - type: object
              mapping: "$."