TeamCity · Capability

TeamCity REST API — Builds

TeamCity REST API — Builds. 9 operations. Lead operation: Get All Builds. Self-contained Naftiko capability covering one Teamcity business surface.

Run with Naftiko TeamcityBuilds

What You Can Do

GET
Getallbuilds — Get All Builds
/v1/builds
GET
Getbuild — Get Build
/v1/builds/{buildlocator}
GET
Getbuildartifacts — Get Build Artifacts
/v1/builds/{buildlocator}/artifacts
POST
Cancelbuild — Cancel Build
/v1/builds/{buildlocator}/cancel
GET
Getbuildproblems — Get Build Problem Occurrences
/v1/builds/{buildlocator}/problemoccurrences
GET
Getbuildstatistics — Get Build Statistics
/v1/builds/{buildlocator}/statistics
GET
Getbuildtags — Get Build Tags
/v1/builds/{buildlocator}/tags
PUT
Setbuildtags — Set Build Tags
/v1/builds/{buildlocator}/tags
GET
Getbuildtests — Get Build Test Occurrences
/v1/builds/{buildlocator}/testoccurrences

MCP Tools

get-all-builds

Get All Builds

read-only idempotent
get-build

Get Build

read-only idempotent
get-build-artifacts

Get Build Artifacts

read-only idempotent
cancel-build

Cancel Build

get-build-problem-occurrences

Get Build Problem Occurrences

read-only idempotent
get-build-statistics

Get Build Statistics

read-only idempotent
get-build-tags

Get Build Tags

read-only idempotent
set-build-tags

Set Build Tags

idempotent
get-build-test-occurrences

Get Build Test Occurrences

read-only idempotent

Capability Spec

rest-builds.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: TeamCity REST API — Builds
  description: 'TeamCity REST API — Builds. 9 operations. Lead operation: Get All Builds. Self-contained Naftiko capability
    covering one Teamcity business surface.'
  tags:
  - Teamcity
  - Builds
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    TEAMCITY_API_KEY: TEAMCITY_API_KEY
capability:
  consumes:
  - type: http
    namespace: rest-builds
    baseUri: https://{server}/app/rest
    description: TeamCity REST API — Builds business capability. Self-contained, no shared references.
    resources:
    - name: builds
      path: /builds
      operations:
      - name: getallbuilds
        method: GET
        description: Get All Builds
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: builds-buildLocator
      path: /builds/{buildLocator}
      operations:
      - name: getbuild
        method: GET
        description: Get Build
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: buildLocator
          in: path
          type: string
          description: Build locator string
          required: true
    - name: builds-buildLocator-artifacts
      path: /builds/{buildLocator}/artifacts
      operations:
      - name: getbuildartifacts
        method: GET
        description: Get Build Artifacts
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: buildLocator
          in: path
          type: string
          required: true
    - name: builds-buildLocator-cancel
      path: /builds/{buildLocator}/cancel
      operations:
      - name: cancelbuild
        method: POST
        description: Cancel Build
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: buildLocator
          in: path
          type: string
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: builds-buildLocator-problemOccurrences
      path: /builds/{buildLocator}/problemOccurrences
      operations:
      - name: getbuildproblems
        method: GET
        description: Get Build Problem Occurrences
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: buildLocator
          in: path
          type: string
          required: true
    - name: builds-buildLocator-statistics
      path: /builds/{buildLocator}/statistics
      operations:
      - name: getbuildstatistics
        method: GET
        description: Get Build Statistics
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: buildLocator
          in: path
          type: string
          required: true
    - name: builds-buildLocator-tags
      path: /builds/{buildLocator}/tags
      operations:
      - name: getbuildtags
        method: GET
        description: Get Build Tags
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: buildLocator
          in: path
          type: string
          required: true
      - name: setbuildtags
        method: PUT
        description: Set Build Tags
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: buildLocator
          in: path
          type: string
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: builds-buildLocator-testOccurrences
      path: /builds/{buildLocator}/testOccurrences
      operations:
      - name: getbuildtests
        method: GET
        description: Get Build Test Occurrences
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: buildLocator
          in: path
          type: string
          required: true
    authentication:
      type: bearer
      token: '{{env.TEAMCITY_API_KEY}}'
  exposes:
  - type: rest
    namespace: rest-builds-rest
    port: 8080
    description: REST adapter for TeamCity REST API — Builds. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/builds
      name: builds
      description: REST surface for builds.
      operations:
      - method: GET
        name: getallbuilds
        description: Get All Builds
        call: rest-builds.getallbuilds
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/builds/{buildlocator}
      name: builds-buildlocator
      description: REST surface for builds-buildLocator.
      operations:
      - method: GET
        name: getbuild
        description: Get Build
        call: rest-builds.getbuild
        with:
          buildLocator: rest.buildLocator
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/builds/{buildlocator}/artifacts
      name: builds-buildlocator-artifacts
      description: REST surface for builds-buildLocator-artifacts.
      operations:
      - method: GET
        name: getbuildartifacts
        description: Get Build Artifacts
        call: rest-builds.getbuildartifacts
        with:
          buildLocator: rest.buildLocator
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/builds/{buildlocator}/cancel
      name: builds-buildlocator-cancel
      description: REST surface for builds-buildLocator-cancel.
      operations:
      - method: POST
        name: cancelbuild
        description: Cancel Build
        call: rest-builds.cancelbuild
        with:
          buildLocator: rest.buildLocator
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/builds/{buildlocator}/problemoccurrences
      name: builds-buildlocator-problemoccurrences
      description: REST surface for builds-buildLocator-problemOccurrences.
      operations:
      - method: GET
        name: getbuildproblems
        description: Get Build Problem Occurrences
        call: rest-builds.getbuildproblems
        with:
          buildLocator: rest.buildLocator
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/builds/{buildlocator}/statistics
      name: builds-buildlocator-statistics
      description: REST surface for builds-buildLocator-statistics.
      operations:
      - method: GET
        name: getbuildstatistics
        description: Get Build Statistics
        call: rest-builds.getbuildstatistics
        with:
          buildLocator: rest.buildLocator
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/builds/{buildlocator}/tags
      name: builds-buildlocator-tags
      description: REST surface for builds-buildLocator-tags.
      operations:
      - method: GET
        name: getbuildtags
        description: Get Build Tags
        call: rest-builds.getbuildtags
        with:
          buildLocator: rest.buildLocator
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: setbuildtags
        description: Set Build Tags
        call: rest-builds.setbuildtags
        with:
          buildLocator: rest.buildLocator
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/builds/{buildlocator}/testoccurrences
      name: builds-buildlocator-testoccurrences
      description: REST surface for builds-buildLocator-testOccurrences.
      operations:
      - method: GET
        name: getbuildtests
        description: Get Build Test Occurrences
        call: rest-builds.getbuildtests
        with:
          buildLocator: rest.buildLocator
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: rest-builds-mcp
    port: 9090
    transport: http
    description: MCP adapter for TeamCity REST API — Builds. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: get-all-builds
      description: Get All Builds
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-builds.getallbuilds
      outputParameters:
      - type: object
        mapping: $.
    - name: get-build
      description: Get Build
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-builds.getbuild
      with:
        buildLocator: tools.buildLocator
      outputParameters:
      - type: object
        mapping: $.
    - name: get-build-artifacts
      description: Get Build Artifacts
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-builds.getbuildartifacts
      with:
        buildLocator: tools.buildLocator
      outputParameters:
      - type: object
        mapping: $.
    - name: cancel-build
      description: Cancel Build
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: rest-builds.cancelbuild
      with:
        buildLocator: tools.buildLocator
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: get-build-problem-occurrences
      description: Get Build Problem Occurrences
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-builds.getbuildproblems
      with:
        buildLocator: tools.buildLocator
      outputParameters:
      - type: object
        mapping: $.
    - name: get-build-statistics
      description: Get Build Statistics
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-builds.getbuildstatistics
      with:
        buildLocator: tools.buildLocator
      outputParameters:
      - type: object
        mapping: $.
    - name: get-build-tags
      description: Get Build Tags
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-builds.getbuildtags
      with:
        buildLocator: tools.buildLocator
      outputParameters:
      - type: object
        mapping: $.
    - name: set-build-tags
      description: Set Build Tags
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: rest-builds.setbuildtags
      with:
        buildLocator: tools.buildLocator
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: get-build-test-occurrences
      description: Get Build Test Occurrences
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-builds.getbuildtests
      with:
        buildLocator: tools.buildLocator
      outputParameters:
      - type: object
        mapping: $.