Spring Data · Capability

Spring Data REST API — Collection

Spring Data REST API — Collection. 2 operations. Lead operation: List Repository Resources. Self-contained Naftiko capability covering one Spring Data business surface.

Run with Naftiko Spring DataCollection

What You Can Do

GET
Listresources — List Repository Resources
/v1/{repository}
POST
Createresource — Create Repository Resource
/v1/{repository}

MCP Tools

list-repository-resources

List Repository Resources

read-only idempotent
create-repository-resource

Create Repository Resource

Capability Spec

rest-collection.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Spring Data REST API — Collection
  description: 'Spring Data REST API — Collection. 2 operations. Lead operation: List Repository Resources. Self-contained
    Naftiko capability covering one Spring Data business surface.'
  tags:
  - Spring Data
  - Collection
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    SPRING_DATA_API_KEY: SPRING_DATA_API_KEY
capability:
  consumes:
  - type: http
    namespace: rest-collection
    baseUri: http://localhost:8080
    description: Spring Data REST API — Collection business capability. Self-contained, no shared references.
    resources:
    - name: repository
      path: /{repository}
      operations:
      - name: listresources
        method: GET
        description: List Repository Resources
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: repository
          in: path
          type: string
          description: Repository resource path (e.g., users, orders)
          required: true
        - name: page
          in: query
          type: integer
          description: Zero-based page number
        - name: size
          in: query
          type: integer
          description: Number of items per page
        - name: sort
          in: query
          type: array
          description: Sort expression (e.g., name,asc or createdAt,desc)
      - name: createresource
        method: POST
        description: Create Repository Resource
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: repository
          in: path
          type: string
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
  exposes:
  - type: rest
    namespace: rest-collection-rest
    port: 8080
    description: REST adapter for Spring Data REST API — Collection. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/{repository}
      name: repository
      description: REST surface for repository.
      operations:
      - method: GET
        name: listresources
        description: List Repository Resources
        call: rest-collection.listresources
        with:
          repository: rest.repository
          page: rest.page
          size: rest.size
          sort: rest.sort
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: createresource
        description: Create Repository Resource
        call: rest-collection.createresource
        with:
          repository: rest.repository
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: rest-collection-mcp
    port: 9090
    transport: http
    description: MCP adapter for Spring Data REST API — Collection. One tool per consumed operation, routed inline through
      this capability's consumes block.
    tools:
    - name: list-repository-resources
      description: List Repository Resources
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-collection.listresources
      with:
        repository: tools.repository
        page: tools.page
        size: tools.size
        sort: tools.sort
      outputParameters:
      - type: object
        mapping: $.
    - name: create-repository-resource
      description: Create Repository Resource
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: rest-collection.createresource
      with:
        repository: tools.repository
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.