Skip to main content
Glama

list_projects

Retrieve TeamCity projects with filtering and pagination options to manage CI/CD workflows and build configurations.

Instructions

List TeamCity projects (supports pagination)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
locatorNoOptional locator to filter projects
parentProjectIdNoFilter by parent project ID
pageSizeNoItems per page (default 100)
maxPagesNoMax pages to fetch (when all=true)
allNoFetch all pages up to maxPages
fieldsNoOptional fields selector for server-side projection

Implementation Reference

  • Core handler function that implements project listing logic: builds TeamCity locator from params, calls API, transforms response, computes pagination metadata. Matches tool usage patterns with locator building and pagination.
    async listProjects(params: ProjectListParams = {}): Promise<ProjectListResult> { const { name, archived, parentProjectId, includeHierarchy = false, limit = 100, offset = 0, } = params; // Build TeamCity locator string const locator = this.buildLocator({ name, archived, parentProjectId, offset, limit, }); try { // Call TeamCity API const response = await this.client.modules.projects.getAllProjects( locator, this.buildFieldsString(includeHierarchy) ); // Extract data from AxiosResponse const projectsData = response.data; // Transform response to our format const projects = this.transformProjects(projectsData, includeHierarchy); // Build metadata const metadata = { count: projects.length, offset, limit, hasMore: this.hasMoreResults(projectsData, limit), totalCount: projectsData.count, }; return { projects, metadata }; } catch (error) { throw this.handleApiError(error); } }
  • Type definitions for tool input (ProjectListParams) and output (ProjectListResult), used directly by the handler for validation and structure.
    export interface ProjectListParams { /** Filter by project name (supports wildcards) */ name?: string; /** Filter by archived status */ archived?: boolean; /** Filter by parent project ID */ parentProjectId?: string; /** Include hierarchy information */ includeHierarchy?: boolean; /** Pagination: number of results to return */ limit?: number; /** Pagination: offset for results */ offset?: number; } /** * Result of a project list operation */ export interface ProjectListResult { /** List of projects matching the criteria */ projects: ProjectInfo[]; /** Metadata about the result set */ metadata: { /** Number of projects in this response */ count: number; /** Offset used for this query */ offset: number; /** Limit used for this query */ limit: number; /** Whether more results are available */ hasMore: boolean; /** Total count of matching projects (if available) */ totalCount?: number; }; }
  • Adapter mapping that exposes listProjects method on the unified client interface, bridging to the underlying API.
    listProjects: (locator) => api.listProjects(locator),
  • Low-level API wrapper that calls TeamCity's getAllProjects endpoint with optional locator, returns raw response data.
    async listProjects(locator?: string) { const response = await this.projects.getAllProjects(locator); return response.data;

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Daghis/teamcity-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server