Skip to main content
Glama

download_build_artifact

Download a specific build artifact from TeamCity CI/CD server with configurable encoding options for integration into workflows.

Instructions

Download a single artifact with optional streaming output

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
buildIdYesBuild ID
artifactPathYesArtifact path or name
encodingNoResponse encoding: 'base64' (default), 'text', or 'stream'base64
maxSizeNoMaximum artifact size (bytes) allowed before aborting
outputPathNoOptional absolute path to write streamed content; defaults to a temp file when streaming

Implementation Reference

  • Core handler function that performs the actual download of the build artifact from TeamCity API by constructing the artifact content URL and making an Axios GET request.
    async downloadBuildArtifact<T = ArrayBuffer>(
      buildId: string,
      artifactPath: string,
      options?: RawAxiosRequestConfig
    ): Promise<AxiosResponse<T>> {
      const normalizedPath = artifactPath
        .split('/')
        .map((segment) => encodeURIComponent(segment))
        .join('/');
      const requestOptions = {
        ...(options ?? {}),
        responseType: (options?.responseType ??
          'arraybuffer') as RawAxiosRequestConfig['responseType'],
      } as RawAxiosRequestConfig<T>;
    
      return this.axiosInstance.get<T>(
        `/app/rest/builds/id:${buildId}/artifacts/content/${normalizedPath}`,
        requestOptions
      );
    }
  • Type/schema defining the tool name 'download_build_artifact' and its expected arguments.
    interface ArtifactDownloadHandle {
      tool: 'download_build_artifact';
      args: {
        buildId: string;
        artifactPath: string;
        encoding?: 'stream';
        maxSize?: number;
      };
    }
  • Usage of the download_build_artifact tool handle to defer large artifact downloads in build results.
    artifactData.downloadHandle = {
      tool: 'download_build_artifact',
      args: {
        buildId,
        artifactPath,
        encoding: 'stream',
        ...(options.maxArtifactSize ? { maxSize: options.maxArtifactSize } : {}),
      },
    };
  • Adapter method wrapping the downloadBuildArtifact for use in TeamCity client managers.
    downloadArtifactContent: <T = ArrayBuffer>(
      buildId: string,
      artifactPath: string,
      requestOptions?: RawAxiosRequestConfig
    ) => api.downloadBuildArtifact<T>(buildId, artifactPath, requestOptions),
Behavior2/5

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

With no annotations, the description carries full burden but lacks critical behavioral details. It mentions 'optional streaming output' but doesn't explain how streaming works, file handling, or error conditions (e.g., what happens if maxSize is exceeded). No information on permissions, rate limits, or side effects.

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?

Extremely concise and front-loaded in a single sentence that captures the core purpose. Every word earns its place with no redundancy or fluff.

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 5 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what the tool returns (e.g., file content, success status), error handling, or important behavioral aspects like streaming mechanics. The context signals indicate complexity that the description doesn't address.

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 the schema fully documents all 5 parameters. The description adds minimal value beyond the schema by hinting at 'optional streaming output', which relates to the 'encoding' parameter but doesn't provide additional semantics. Baseline 3 is appropriate when 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 action ('download') and resource ('a single artifact'), distinguishing it from sibling 'download_build_artifacts' (plural). However, it doesn't specify the source (e.g., from a CI/CD system) or fully differentiate from other build-related tools like 'fetch_build_log'.

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?

No guidance on when to use this tool versus alternatives like 'download_build_artifacts' (for multiple artifacts) or 'fetch_build_log' (for logs). The optional streaming output is mentioned but without context on when to choose it over default encoding.

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