Sonatype · Capability

Sonatype Lifecycle Public REST API — Components

Sonatype Lifecycle Public REST API — Components. 5 operations. Lead operation: Components. Self-contained Naftiko capability covering one Sonatype business surface.

Run with Naftiko SonatypeComponents

What You Can Do

POST
Getcomponentdetails — Use this method to retrieve data related to a component.
/v1/api/v2/components/details
POST
Getsuggestedremediationforcomponent — Use this method to obtain remediation suggestions for policy violations on a component basis. Remediations obtained from this method are same as those appearing on the Component Details Page in the UI.
/v1/api/v2/components/remediation/{ownertype}/{ownerid}
POST
Getcomponentversions — Use this method to retrieve all known versions of a component.
/v1/api/v2/components/versions
DELETE
Deletecomponentlabel — Use this method to un-assign a label from a component.
/v1/api/v2/components/{componenthash}/labels/{labelname}/ownertype-s/{internalownerid}
POST
Setcomponentlabel — Use this method to assign an existing label to a component.
/v1/api/v2/components/{componenthash}/labels/{labelname}/ownertype-s/{internalownerid}

MCP Tools

use-this-method-retrieve-data

Use this method to retrieve data related to a component.

read-only
use-this-method-obtain-remediation

Use this method to obtain remediation suggestions for policy violations on a component basis. Remediations obtained from this method are same as those appearing on the Component Details Page in the UI.

use-this-method-retrieve-all

Use this method to retrieve all known versions of a component.

read-only
use-this-method-un-assign

Use this method to un-assign a label from a component.

idempotent
use-this-method-assign-existing

Use this method to assign an existing label to a component.

Capability Spec

lifecycle-components.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Sonatype Lifecycle Public REST API — Components
  description: 'Sonatype Lifecycle Public REST API — Components. 5 operations. Lead operation: Components. Self-contained
    Naftiko capability covering one Sonatype business surface.'
  tags:
  - Sonatype
  - Components
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    SONATYPE_API_KEY: SONATYPE_API_KEY
capability:
  consumes:
  - type: http
    namespace: lifecycle-components
    baseUri: ''
    description: Sonatype Lifecycle Public REST API — Components business capability. Self-contained, no shared references.
    resources:
    - name: api-v2-components-details
      path: /api/v2/components/details
      operations:
      - name: getcomponentdetails
        method: POST
        description: Use this method to retrieve data related to a component.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: api-v2-components-remediation-ownerType-ownerId
      path: /api/v2/components/remediation/{ownerType}/{ownerId}
      operations:
      - name: getsuggestedremediationforcomponent
        method: POST
        description: Use this method to obtain remediation suggestions for policy violations on a component basis. Remediations
          obtained from this method are same as those appearing on the Component Details Page in the UI.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: ownerType
          in: path
          type: string
          description: 'Possible values: application, organization, repository.'
          required: true
        - name: ownerId
          in: path
          type: string
          description: 'Possible values: applicationId, organizationId or repositoryId.'
          required: true
        - name: stageId
          in: query
          type: string
          description: Enter the stageId to obtain next-non-failing and next-non-failing-with-dependencies remediation types
            in the response. Possible values are develop, build, stage
        - name: identificationSource
          in: query
          type: string
          description: Enter the identification source if you want the remediation result based on third-party scan information
            (non-Sonatype). The identification source can be obtain
        - name: scanId
          in: query
          type: string
          description: Enter the scanId (reportId) if you want the remediation result based on third-party scan information
            (non-Sonatype).
        - name: includeParentRemediation
          in: query
          type: boolean
          description: Enter true if you want to include parent remediation for transitive dependency in the response based
            on your application policy scan.
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-v2-components-versions
      path: /api/v2/components/versions
      operations:
      - name: getcomponentversions
        method: POST
        description: Use this method to retrieve all known versions of a component.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-v2-components-componentHash-labels-labelName-ownerType}s-internalOwnerId
      path: /api/v2/components/{componentHash}/labels/{labelName}/{ownerType}s/{internalOwnerId}
      operations:
      - name: deletecomponentlabel
        method: DELETE
        description: Use this method to un-assign a label from a component.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: ownerType
          in: path
          type: string
          description: 'Possible values: application or organization'
          required: true
        - name: internalOwnerId
          in: path
          type: string
          description: 'Possible values : applicationId or organizationId'
          required: true
        - name: componentHash
          in: path
          type: string
          description: Enter the SHA1 hash of the component.
          required: true
        - name: labelName
          in: path
          type: string
          description: Enter the label name to un-assign from this component.
          required: true
      - name: setcomponentlabel
        method: POST
        description: Use this method to assign an existing label to a component.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: ownerType
          in: path
          type: string
          description: 'Possible values: application or organization'
          required: true
        - name: internalOwnerId
          in: path
          type: string
          description: 'Possible values : applicationId or organizationId'
          required: true
        - name: componentHash
          in: path
          type: string
          description: Enter the SHA1 hash of the component.
          required: true
        - name: labelName
          in: path
          type: string
          description: Enter the label name to assign to this component.
          required: true
    authentication:
      type: bearer
      token: '{{env.SONATYPE_API_KEY}}'
  exposes:
  - type: rest
    namespace: lifecycle-components-rest
    port: 8080
    description: REST adapter for Sonatype Lifecycle Public REST API — Components. One Spectral-compliant resource per consumed
      operation, prefixed with /v1.
    resources:
    - path: /v1/api/v2/components/details
      name: api-v2-components-details
      description: REST surface for api-v2-components-details.
      operations:
      - method: POST
        name: getcomponentdetails
        description: Use this method to retrieve data related to a component.
        call: lifecycle-components.getcomponentdetails
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/v2/components/remediation/{ownertype}/{ownerid}
      name: api-v2-components-remediation-ownertype-ownerid
      description: REST surface for api-v2-components-remediation-ownerType-ownerId.
      operations:
      - method: POST
        name: getsuggestedremediationforcomponent
        description: Use this method to obtain remediation suggestions for policy violations on a component basis. Remediations
          obtained from this method are same as those appearing on the Component Details Page in the UI.
        call: lifecycle-components.getsuggestedremediationforcomponent
        with:
          ownerType: rest.ownerType
          ownerId: rest.ownerId
          stageId: rest.stageId
          identificationSource: rest.identificationSource
          scanId: rest.scanId
          includeParentRemediation: rest.includeParentRemediation
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/v2/components/versions
      name: api-v2-components-versions
      description: REST surface for api-v2-components-versions.
      operations:
      - method: POST
        name: getcomponentversions
        description: Use this method to retrieve all known versions of a component.
        call: lifecycle-components.getcomponentversions
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/v2/components/{componenthash}/labels/{labelname}/ownertype-s/{internalownerid}
      name: api-v2-components-componenthash-labels-labelname-ownertype-s-internalownerid
      description: REST surface for api-v2-components-componentHash-labels-labelName-ownerType}s-internalOwnerId.
      operations:
      - method: DELETE
        name: deletecomponentlabel
        description: Use this method to un-assign a label from a component.
        call: lifecycle-components.deletecomponentlabel
        with:
          ownerType: rest.ownerType
          internalOwnerId: rest.internalOwnerId
          componentHash: rest.componentHash
          labelName: rest.labelName
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: setcomponentlabel
        description: Use this method to assign an existing label to a component.
        call: lifecycle-components.setcomponentlabel
        with:
          ownerType: rest.ownerType
          internalOwnerId: rest.internalOwnerId
          componentHash: rest.componentHash
          labelName: rest.labelName
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: lifecycle-components-mcp
    port: 9090
    transport: http
    description: MCP adapter for Sonatype Lifecycle Public REST API — Components. One tool per consumed operation, routed
      inline through this capability's consumes block.
    tools:
    - name: use-this-method-retrieve-data
      description: Use this method to retrieve data related to a component.
      hints:
        readOnly: true
        destructive: false
        idempotent: false
      call: lifecycle-components.getcomponentdetails
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: use-this-method-obtain-remediation
      description: Use this method to obtain remediation suggestions for policy violations on a component basis. Remediations
        obtained from this method are same as those appearing on the Component Details Page in the UI.
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: lifecycle-components.getsuggestedremediationforcomponent
      with:
        ownerType: tools.ownerType
        ownerId: tools.ownerId
        stageId: tools.stageId
        identificationSource: tools.identificationSource
        scanId: tools.scanId
        includeParentRemediation: tools.includeParentRemediation
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: use-this-method-retrieve-all
      description: Use this method to retrieve all known versions of a component.
      hints:
        readOnly: true
        destructive: false
        idempotent: false
      call: lifecycle-components.getcomponentversions
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: use-this-method-un-assign
      description: Use this method to un-assign a label from a component.
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: lifecycle-components.deletecomponentlabel
      with:
        ownerType: tools.ownerType
        internalOwnerId: tools.internalOwnerId
        componentHash: tools.componentHash
        labelName: tools.labelName
      outputParameters:
      - type: object
        mapping: $.
    - name: use-this-method-assign-existing
      description: Use this method to assign an existing label to a component.
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: lifecycle-components.setcomponentlabel
      with:
        ownerType: tools.ownerType
        internalOwnerId: tools.internalOwnerId
        componentHash: tools.componentHash
        labelName: tools.labelName
      outputParameters:
      - type: object
        mapping: $.