Skip to main content
Glama
ennuiii

Azure DevOps MCP Server with PAT Authentication

by ennuiii

build_get_log

Retrieve build logs from Azure DevOps by specifying the project and build ID, enabling efficient troubleshooting and monitoring of build processes with PAT authentication.

Instructions

Retrieves the logs for a specific build.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
buildIdYesID of the build to get the log for
projectYesProject ID or name to get the build log for

Implementation Reference

  • The handler function for the 'build_get_log' tool. It retrieves the build logs using the Azure DevOps Build API's getBuildLogs method for the given project and buildId, then returns the logs as JSON.
    async ({ project, buildId }) => {
      const connection = await connectionProvider();
      const buildApi = await connection.getBuildApi();
      const logs = await buildApi.getBuildLogs(project, buildId);
    
      return {
        content: [{ type: "text", text: JSON.stringify(logs, null, 2) }],
      };
    }
  • Zod schema defining the input parameters: project (string) and buildId (number) for the 'build_get_log' tool.
    {
      project: z.string().describe("Project ID or name to get the build log for"),
      buildId: z.number().describe("ID of the build to get the log for"),
    },
  • Registration of the 'build_get_log' tool via server.tool call, referencing BUILD_TOOLS.get_log which maps to 'build_get_log'.
    server.tool(
      BUILD_TOOLS.get_log,
      "Retrieves the logs for a specific build.",
      {
        project: z.string().describe("Project ID or name to get the build log for"),
        buildId: z.number().describe("ID of the build to get the log for"),
      },
      async ({ project, buildId }) => {
        const connection = await connectionProvider();
        const buildApi = await connection.getBuildApi();
        const logs = await buildApi.getBuildLogs(project, buildId);
    
        return {
          content: [{ type: "text", text: JSON.stringify(logs, null, 2) }],
        };
      }
    );
  • BUILD_TOOLS constant defining the tool name mappings, including get_log: 'build_get_log'.
    const BUILD_TOOLS = {
      get_definitions: "build_get_definitions",
      get_definition_revisions: "build_get_definition_revisions",
      get_builds: "build_get_builds",
      get_log: "build_get_log",
      get_log_by_id: "build_get_log_by_id",
      get_changes: "build_get_changes",
      run_build: "build_run_build",
      get_status: "build_get_status",
      update_build_stage: "build_update_build_stage",
    };
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 states it 'retrieves' logs, implying a read-only operation, but doesn't specify permissions needed, rate limits, pagination, log format, or error handling. This is insufficient for a tool that likely accesses system data.

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 a single, efficient sentence with no wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly.

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?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what the logs contain, their format, or potential limitations, which is critical for a retrieval tool in a build system context with many sibling tools.

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%, with clear descriptions for both parameters ('buildId' and 'project'). The description adds no additional semantic context beyond what the schema provides, such as examples or constraints, so it meets the baseline for high schema coverage.

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 ('Retrieves') and resource ('logs for a specific build'), making the purpose unambiguous. It doesn't explicitly differentiate from sibling tools like 'build_get_log_by_id' or 'build_get_status', but the specificity is adequate for understanding what it does.

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. It doesn't mention siblings like 'build_get_log_by_id' (which might have different parameters) or 'testplan_show_test_results_from_build_id' (which might serve a related purpose), leaving the agent without context for tool selection.

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

Related 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/ennuiii/DevOpsMcpPAT'

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