Google Fit REST · Capability

Google Fit REST API

Google Fit REST API. 9 operations. Lead operation: List data sources. Self-contained Naftiko capability covering one Google Fitness business surface.

Run with Naftiko Google FitnessGoogle Fit REST API

What You Can Do

GET
Listdatasources — List data sources
/v1/users/{userid}/datasources
POST
Createdatasource — Create a data source
/v1/users/{userid}/datasources
GET
Getdatasource — Get a data source
/v1/users/{userid}/datasources/{datasourceid}
GET
Getdataset — Get a dataset
/v1/users/{userid}/datasources/{datasourceid}/datasets/{datasetid}
PATCH
Patchdataset — Add data points to a dataset
/v1/users/{userid}/datasources/{datasourceid}/datasets/{datasetid}
POST
Aggregatedataset — Aggregate data
/v1/users/{userid}/dataset-aggregate
GET
Listsessions — List sessions
/v1/users/{userid}/sessions
PUT
Updatesession — Update or insert a session
/v1/users/{userid}/sessions/{sessionid}
DELETE
Deletesession — Delete a session
/v1/users/{userid}/sessions/{sessionid}

MCP Tools

list-data-sources

List data sources

read-only idempotent
create-data-source

Create a data source

get-data-source

Get a data source

read-only idempotent
get-dataset

Get a dataset

read-only idempotent
add-data-points-dataset

Add data points to a dataset

idempotent
aggregate-data

Aggregate data

list-sessions

List sessions

read-only idempotent
update-insert-session

Update or insert a session

idempotent
delete-session

Delete a session

idempotent

Capability Spec

fitness.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Google Fit REST API
  description: 'Google Fit REST API. 9 operations. Lead operation: List data sources. Self-contained Naftiko capability covering
    one Google Fitness business surface.'
  tags:
  - Google Fitness
  - Google Fit REST API
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    GOOGLE_FITNESS_API_KEY: GOOGLE_FITNESS_API_KEY
capability:
  consumes:
  - type: http
    namespace: fitness
    baseUri: https://www.googleapis.com/fitness/v1
    description: Google Fit REST API business capability. Self-contained, no shared references.
    resources:
    - name: users-userId-dataSources
      path: /users/{userId}/dataSources
      operations:
      - name: listdatasources
        method: GET
        description: List data sources
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: userId
          in: path
          type: string
          required: true
      - name: createdatasource
        method: POST
        description: Create a data source
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: userId
          in: path
          type: string
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: users-userId-dataSources-dataSourceId
      path: /users/{userId}/dataSources/{dataSourceId}
      operations:
      - name: getdatasource
        method: GET
        description: Get a data source
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: userId
          in: path
          type: string
          required: true
        - name: dataSourceId
          in: path
          type: string
          required: true
    - name: users-userId-dataSources-dataSourceId-datasets-datasetId
      path: /users/{userId}/dataSources/{dataSourceId}/datasets/{datasetId}
      operations:
      - name: getdataset
        method: GET
        description: Get a dataset
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: userId
          in: path
          type: string
          required: true
        - name: dataSourceId
          in: path
          type: string
          required: true
        - name: datasetId
          in: path
          type: string
          required: true
        - name: limit
          in: query
          type: integer
        - name: pageToken
          in: query
          type: string
      - name: patchdataset
        method: PATCH
        description: Add data points to a dataset
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: userId
          in: path
          type: string
          required: true
        - name: dataSourceId
          in: path
          type: string
          required: true
        - name: datasetId
          in: path
          type: string
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: users-userId-dataset:aggregate
      path: /users/{userId}/dataset:aggregate
      operations:
      - name: aggregatedataset
        method: POST
        description: Aggregate data
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: userId
          in: path
          type: string
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: users-userId-sessions
      path: /users/{userId}/sessions
      operations:
      - name: listsessions
        method: GET
        description: List sessions
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: userId
          in: path
          type: string
          required: true
        - name: startTime
          in: query
          type: string
        - name: endTime
          in: query
          type: string
        - name: pageToken
          in: query
          type: string
    - name: users-userId-sessions-sessionId
      path: /users/{userId}/sessions/{sessionId}
      operations:
      - name: updatesession
        method: PUT
        description: Update or insert a session
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: userId
          in: path
          type: string
          required: true
        - name: sessionId
          in: path
          type: string
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
      - name: deletesession
        method: DELETE
        description: Delete a session
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: userId
          in: path
          type: string
          required: true
        - name: sessionId
          in: path
          type: string
          required: true
    authentication:
      type: bearer
      token: '{{env.GOOGLE_FITNESS_API_KEY}}'
  exposes:
  - type: rest
    namespace: fitness-rest
    port: 8080
    description: REST adapter for Google Fit REST API. One Spectral-compliant resource per consumed operation, prefixed with
      /v1.
    resources:
    - path: /v1/users/{userid}/datasources
      name: users-userid-datasources
      description: REST surface for users-userId-dataSources.
      operations:
      - method: GET
        name: listdatasources
        description: List data sources
        call: fitness.listdatasources
        with:
          userId: rest.userId
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: createdatasource
        description: Create a data source
        call: fitness.createdatasource
        with:
          userId: rest.userId
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/users/{userid}/datasources/{datasourceid}
      name: users-userid-datasources-datasourceid
      description: REST surface for users-userId-dataSources-dataSourceId.
      operations:
      - method: GET
        name: getdatasource
        description: Get a data source
        call: fitness.getdatasource
        with:
          userId: rest.userId
          dataSourceId: rest.dataSourceId
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/users/{userid}/datasources/{datasourceid}/datasets/{datasetid}
      name: users-userid-datasources-datasourceid-datasets-datasetid
      description: REST surface for users-userId-dataSources-dataSourceId-datasets-datasetId.
      operations:
      - method: GET
        name: getdataset
        description: Get a dataset
        call: fitness.getdataset
        with:
          userId: rest.userId
          dataSourceId: rest.dataSourceId
          datasetId: rest.datasetId
          limit: rest.limit
          pageToken: rest.pageToken
        outputParameters:
        - type: object
          mapping: $.
      - method: PATCH
        name: patchdataset
        description: Add data points to a dataset
        call: fitness.patchdataset
        with:
          userId: rest.userId
          dataSourceId: rest.dataSourceId
          datasetId: rest.datasetId
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/users/{userid}/dataset-aggregate
      name: users-userid-dataset-aggregate
      description: REST surface for users-userId-dataset:aggregate.
      operations:
      - method: POST
        name: aggregatedataset
        description: Aggregate data
        call: fitness.aggregatedataset
        with:
          userId: rest.userId
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/users/{userid}/sessions
      name: users-userid-sessions
      description: REST surface for users-userId-sessions.
      operations:
      - method: GET
        name: listsessions
        description: List sessions
        call: fitness.listsessions
        with:
          userId: rest.userId
          startTime: rest.startTime
          endTime: rest.endTime
          pageToken: rest.pageToken
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/users/{userid}/sessions/{sessionid}
      name: users-userid-sessions-sessionid
      description: REST surface for users-userId-sessions-sessionId.
      operations:
      - method: PUT
        name: updatesession
        description: Update or insert a session
        call: fitness.updatesession
        with:
          userId: rest.userId
          sessionId: rest.sessionId
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: deletesession
        description: Delete a session
        call: fitness.deletesession
        with:
          userId: rest.userId
          sessionId: rest.sessionId
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: fitness-mcp
    port: 9090
    transport: http
    description: MCP adapter for Google Fit REST API. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: list-data-sources
      description: List data sources
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: fitness.listdatasources
      with:
        userId: tools.userId
      outputParameters:
      - type: object
        mapping: $.
    - name: create-data-source
      description: Create a data source
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: fitness.createdatasource
      with:
        userId: tools.userId
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: get-data-source
      description: Get a data source
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: fitness.getdatasource
      with:
        userId: tools.userId
        dataSourceId: tools.dataSourceId
      outputParameters:
      - type: object
        mapping: $.
    - name: get-dataset
      description: Get a dataset
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: fitness.getdataset
      with:
        userId: tools.userId
        dataSourceId: tools.dataSourceId
        datasetId: tools.datasetId
        limit: tools.limit
        pageToken: tools.pageToken
      outputParameters:
      - type: object
        mapping: $.
    - name: add-data-points-dataset
      description: Add data points to a dataset
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: fitness.patchdataset
      with:
        userId: tools.userId
        dataSourceId: tools.dataSourceId
        datasetId: tools.datasetId
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: aggregate-data
      description: Aggregate data
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: fitness.aggregatedataset
      with:
        userId: tools.userId
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: list-sessions
      description: List sessions
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: fitness.listsessions
      with:
        userId: tools.userId
        startTime: tools.startTime
        endTime: tools.endTime
        pageToken: tools.pageToken
      outputParameters:
      - type: object
        mapping: $.
    - name: update-insert-session
      description: Update or insert a session
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: fitness.updatesession
      with:
        userId: tools.userId
        sessionId: tools.sessionId
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: delete-session
      description: Delete a session
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: fitness.deletesession
      with:
        userId: tools.userId
        sessionId: tools.sessionId
      outputParameters:
      - type: object
        mapping: $.