list_agents
Retrieve and filter build agents from TeamCity with pagination support, enabling efficient management of CI/CD infrastructure.
Instructions
List build agents (supports pagination)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| all | No | Fetch all pages up to maxPages | |
| fields | No | Optional fields selector for server-side projection | |
| locator | No | Optional agent locator to filter | |
| maxPages | No | Max pages to fetch (when all=true) | |
| pageSize | No | Items per page (default 100) |
Implementation Reference
- src/api-client.ts:521-524 (handler)The handler function that executes the logic to list all TeamCity agents by calling the underlying AgentApi.getAllAgents() and returning the data.async listAgents() { const response = await this.agents.getAllAgents(); return response.data; }
- src/teamcity/client-adapter.ts:163-170 (registration)Registration of the listAgents method in the TeamCityClientAdapter interface implementation, delegating to the API client's listAgents.) => api.downloadBuildLog<T>(buildId, requestOptions), getBuildStatistics: (buildId, fields) => api.getBuildStatistics(buildId, fields), listChangesForBuild: (buildId, fields) => api.listChangesForBuild(buildId, fields), listSnapshotDependencies: (buildId) => api.listSnapshotDependencies(buildId), listVcsRoots: (projectId) => api.listVcsRoots(projectId), listAgents: () => api.listAgents(), listAgentPools: () => api.listAgentPools(), baseUrl: resolvedApiConfig.baseUrl,
- src/teamcity/types/client.ts:164-164 (schema)Type definition (schema) for the listAgents method in the TeamCityClientAdapter interface.listAgents: () => Promise<unknown>;