Skip to main content
Glama
ennuiii

Azure DevOps MCP Server with PAT Authentication

by ennuiii

build_get_log_by_id

Retrieve a specific build log by ID from Azure DevOps, allowing access to detailed log content within a specified line range for targeted debugging and analysis.

Instructions

Get a specific build log by log ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
buildIdYesID of the build to get the log for
endLineNoEnding line number for the log content, defaults to the end of the log
logIdYesID of the log to retrieve
projectYesProject ID or name to get the build log for
startLineNoStarting line number for the log content, defaults to 0

Implementation Reference

  • Handler function that calls Azure DevOps Build API to retrieve specific log lines (* to endLine) for a given build and log ID.
    async ({ project, buildId, logId, startLine, endLine }) => {
      const connection = await connectionProvider();
      const buildApi = await connection.getBuildApi();
      const logLines = await buildApi.getBuildLogLines(project, buildId, logId, startLine, endLine);
    
      return {
        content: [{ type: "text", text: JSON.stringify(logLines, null, 2) }],
      };
    }
  • Input validation schema using Zod for the tool parameters.
      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"),
      logId: z.number().describe("ID of the log to retrieve"),
      startLine: z.number().optional().describe("Starting line number for the log content, defaults to 0"),
      endLine: z.number().optional().describe("Ending line number for the log content, defaults to the end of the log"),
    },
  • Registration of the 'build_get_log_by_id' tool on the MCP server via server.tool(BUILD_TOOLS.get_log_by_id, ...), where BUILD_TOOLS.get_log_by_id = 'build_get_log_by_id'.
    server.tool(
      BUILD_TOOLS.get_log_by_id,
      "Get a specific build log by log ID.",
      {
        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"),
        logId: z.number().describe("ID of the log to retrieve"),
        startLine: z.number().optional().describe("Starting line number for the log content, defaults to 0"),
        endLine: z.number().optional().describe("Ending line number for the log content, defaults to the end of the log"),
      },
      async ({ project, buildId, logId, startLine, endLine }) => {
        const connection = await connectionProvider();
        const buildApi = await connection.getBuildApi();
        const logLines = await buildApi.getBuildLogLines(project, buildId, logId, startLine, endLine);
    
        return {
          content: [{ type: "text", text: JSON.stringify(logLines, null, 2) }],
        };
      }
    );
  • Constant mapping in BUILD_TOOLS object linking internal key 'get_log_by_id' to the actual tool name 'build_get_log_by_id'.
    get_log_by_id: "build_get_log_by_id",
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's a read operation ('Get'), implying non-destructive behavior, but doesn't cover aspects like authentication needs, rate limits, error handling, or response format, leaving significant gaps for a mutation-free tool.

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, clear sentence with no wasted words, making it highly concise and front-loaded. It efficiently conveys the core purpose without unnecessary elaboration.

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 no annotations and no output schema, the description is incomplete for a tool with 5 parameters. It lacks details on behavioral traits, error cases, or return values, making it insufficient for full contextual understanding despite the clear purpose.

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 parameters are well-documented in the schema. The description adds no additional semantic context beyond implying retrieval by 'log ID', which aligns with the schema. Baseline score of 3 is appropriate as the schema handles parameter documentation effectively.

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 ('Get') and resource ('specific build log by log ID'), making the purpose understandable. However, it doesn't differentiate from sibling 'build_get_log' (which appears to fetch logs without specifying a log ID), missing full distinction for a score of 5.

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 is provided on when to use this tool versus alternatives like 'build_get_log' or other build-related tools. The description lacks context, prerequisites, or exclusions, offering minimal usage direction.

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