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;
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions pagination support but doesn't explain how pagination works (e.g., cursor-based vs offset-based), what the default behavior is, or what format the results return. For a list operation with 6 parameters, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise - a single sentence that communicates the core purpose and one key feature (pagination support). There's no wasted language, and the most important information is front-loaded. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 6 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what a 'locator' is, how filtering works, what fields can be selected, or what the return format looks like. The mention of pagination is helpful but insufficient given the tool's complexity and lack of structured documentation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all parameters are documented in the schema. The description adds minimal value beyond the schema - it mentions pagination support which relates to 'pageSize', 'maxPages', and 'all' parameters, but doesn't provide additional context about how these interact. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('TeamCity projects'), making the purpose unambiguous. It also mentions pagination support, which adds useful context. However, it doesn't explicitly differentiate from sibling tools like 'list_project_hierarchy' or 'get_project', which could cause confusion about when to use each.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'list_project_hierarchy' or 'get_project'. It mentions pagination support but doesn't explain when pagination is needed or how it relates to the 'all' parameter. No exclusions or prerequisites are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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