Apache ShardingSphere · Capability

Apache ShardingSphere REST API — DataSources

Apache ShardingSphere REST API — DataSources. 2 operations. Lead operation: Apache ShardingSphere List Data Sources. Self-contained Naftiko capability covering one Apache Shardingsphere business surface.

Run with Naftiko Apache ShardingsphereDataSources

What You Can Do

GET
Listdatasources — Apache ShardingSphere List Data Sources
/v1/databases/{databasename}/data-sources
POST
Adddatasource — Apache ShardingSphere Add Data Source
/v1/databases/{databasename}/data-sources

MCP Tools

apache-shardingsphere-list-data-sources

Apache ShardingSphere List Data Sources

read-only idempotent
apache-shardingsphere-add-data-source

Apache ShardingSphere Add Data Source

Capability Spec

rest-datasources.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Apache ShardingSphere REST API — DataSources
  description: 'Apache ShardingSphere REST API — DataSources. 2 operations. Lead operation: Apache ShardingSphere List Data
    Sources. Self-contained Naftiko capability covering one Apache Shardingsphere business surface.'
  tags:
  - Apache Shardingsphere
  - DataSources
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    APACHE_SHARDINGSPHERE_API_KEY: APACHE_SHARDINGSPHERE_API_KEY
capability:
  consumes:
  - type: http
    namespace: rest-datasources
    baseUri: https://shardingsphere.example.com/api
    description: Apache ShardingSphere REST API — DataSources business capability. Self-contained, no shared references.
    resources:
    - name: databases-databaseName-data-sources
      path: /databases/{databaseName}/data-sources
      operations:
      - name: listdatasources
        method: GET
        description: Apache ShardingSphere List Data Sources
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: databaseName
          in: path
          type: string
          required: true
      - name: adddatasource
        method: POST
        description: Apache ShardingSphere Add Data Source
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: databaseName
          in: path
          type: string
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
  exposes:
  - type: rest
    namespace: rest-datasources-rest
    port: 8080
    description: REST adapter for Apache ShardingSphere REST API — DataSources. One Spectral-compliant resource per consumed
      operation, prefixed with /v1.
    resources:
    - path: /v1/databases/{databasename}/data-sources
      name: databases-databasename-data-sources
      description: REST surface for databases-databaseName-data-sources.
      operations:
      - method: GET
        name: listdatasources
        description: Apache ShardingSphere List Data Sources
        call: rest-datasources.listdatasources
        with:
          databaseName: rest.databaseName
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: adddatasource
        description: Apache ShardingSphere Add Data Source
        call: rest-datasources.adddatasource
        with:
          databaseName: rest.databaseName
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: rest-datasources-mcp
    port: 9090
    transport: http
    description: MCP adapter for Apache ShardingSphere REST API — DataSources. One tool per consumed operation, routed inline
      through this capability's consumes block.
    tools:
    - name: apache-shardingsphere-list-data-sources
      description: Apache ShardingSphere List Data Sources
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-datasources.listdatasources
      with:
        databaseName: tools.databaseName
      outputParameters:
      - type: object
        mapping: $.
    - name: apache-shardingsphere-add-data-source
      description: Apache ShardingSphere Add Data Source
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: rest-datasources.adddatasource
      with:
        databaseName: tools.databaseName
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.