TeamCity · Capability

TeamCity REST API — Agents

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

Run with Naftiko TeamcityAgents

What You Can Do

GET
Getallagents — Get All Agents
/v1/agents
GET
Getagent — Get Agent
/v1/agents/{agentlocator}
GET
Getagentauthorizedstatus — Get Agent Authorized Status
/v1/agents/{agentlocator}/authorized
PUT
Setagentauthorizedstatus — Set Agent Authorized Status
/v1/agents/{agentlocator}/authorized
GET
Getagentenabledstatus — Get Agent Enabled Status
/v1/agents/{agentlocator}/enabled
PUT
Setagentenabledstatus — Set Agent Enabled Status
/v1/agents/{agentlocator}/enabled

MCP Tools

get-all-agents

Get All Agents

read-only idempotent
get-agent

Get Agent

read-only idempotent
get-agent-authorized-status

Get Agent Authorized Status

read-only idempotent
set-agent-authorized-status

Set Agent Authorized Status

idempotent
get-agent-enabled-status

Get Agent Enabled Status

read-only idempotent
set-agent-enabled-status

Set Agent Enabled Status

idempotent

Capability Spec

rest-agents.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: TeamCity REST API — Agents
  description: 'TeamCity REST API — Agents. 6 operations. Lead operation: Get All Agents. Self-contained Naftiko capability
    covering one Teamcity business surface.'
  tags:
  - Teamcity
  - Agents
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    TEAMCITY_API_KEY: TEAMCITY_API_KEY
capability:
  consumes:
  - type: http
    namespace: rest-agents
    baseUri: https://{server}/app/rest
    description: TeamCity REST API — Agents business capability. Self-contained, no shared references.
    resources:
    - name: agents
      path: /agents
      operations:
      - name: getallagents
        method: GET
        description: Get All Agents
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: agents-agentLocator
      path: /agents/{agentLocator}
      operations:
      - name: getagent
        method: GET
        description: Get Agent
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: agentLocator
          in: path
          type: string
          description: Agent locator string
          required: true
    - name: agents-agentLocator-authorized
      path: /agents/{agentLocator}/authorized
      operations:
      - name: getagentauthorizedstatus
        method: GET
        description: Get Agent Authorized Status
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: agentLocator
          in: path
          type: string
          required: true
      - name: setagentauthorizedstatus
        method: PUT
        description: Set Agent Authorized Status
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: agentLocator
          in: path
          type: string
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: agents-agentLocator-enabled
      path: /agents/{agentLocator}/enabled
      operations:
      - name: getagentenabledstatus
        method: GET
        description: Get Agent Enabled Status
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: agentLocator
          in: path
          type: string
          required: true
      - name: setagentenabledstatus
        method: PUT
        description: Set Agent Enabled Status
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: agentLocator
          in: path
          type: string
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    authentication:
      type: bearer
      token: '{{env.TEAMCITY_API_KEY}}'
  exposes:
  - type: rest
    namespace: rest-agents-rest
    port: 8080
    description: REST adapter for TeamCity REST API — Agents. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/agents
      name: agents
      description: REST surface for agents.
      operations:
      - method: GET
        name: getallagents
        description: Get All Agents
        call: rest-agents.getallagents
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/agents/{agentlocator}
      name: agents-agentlocator
      description: REST surface for agents-agentLocator.
      operations:
      - method: GET
        name: getagent
        description: Get Agent
        call: rest-agents.getagent
        with:
          agentLocator: rest.agentLocator
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/agents/{agentlocator}/authorized
      name: agents-agentlocator-authorized
      description: REST surface for agents-agentLocator-authorized.
      operations:
      - method: GET
        name: getagentauthorizedstatus
        description: Get Agent Authorized Status
        call: rest-agents.getagentauthorizedstatus
        with:
          agentLocator: rest.agentLocator
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: setagentauthorizedstatus
        description: Set Agent Authorized Status
        call: rest-agents.setagentauthorizedstatus
        with:
          agentLocator: rest.agentLocator
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/agents/{agentlocator}/enabled
      name: agents-agentlocator-enabled
      description: REST surface for agents-agentLocator-enabled.
      operations:
      - method: GET
        name: getagentenabledstatus
        description: Get Agent Enabled Status
        call: rest-agents.getagentenabledstatus
        with:
          agentLocator: rest.agentLocator
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: setagentenabledstatus
        description: Set Agent Enabled Status
        call: rest-agents.setagentenabledstatus
        with:
          agentLocator: rest.agentLocator
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: rest-agents-mcp
    port: 9090
    transport: http
    description: MCP adapter for TeamCity REST API — Agents. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: get-all-agents
      description: Get All Agents
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-agents.getallagents
      outputParameters:
      - type: object
        mapping: $.
    - name: get-agent
      description: Get Agent
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-agents.getagent
      with:
        agentLocator: tools.agentLocator
      outputParameters:
      - type: object
        mapping: $.
    - name: get-agent-authorized-status
      description: Get Agent Authorized Status
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-agents.getagentauthorizedstatus
      with:
        agentLocator: tools.agentLocator
      outputParameters:
      - type: object
        mapping: $.
    - name: set-agent-authorized-status
      description: Set Agent Authorized Status
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: rest-agents.setagentauthorizedstatus
      with:
        agentLocator: tools.agentLocator
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: get-agent-enabled-status
      description: Get Agent Enabled Status
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-agents.getagentenabledstatus
      with:
        agentLocator: tools.agentLocator
      outputParameters:
      - type: object
        mapping: $.
    - name: set-agent-enabled-status
      description: Set Agent Enabled Status
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: rest-agents.setagentenabledstatus
      with:
        agentLocator: tools.agentLocator
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.