Skip to main content
Glama
OctopusDeploy

Octopus Deploy MCP Server

Official

get_task_by_id

Read-only

Retrieve details for a specific Octopus Deploy server task using its unique ID to monitor deployment, health check, or maintenance operation status and progress.

Instructions

Get details for a specific server task by its ID. Tasks represent background operations in Octopus Deploy, such as deployments, health checks, and system maintenance. Each task has a unique ID and can be monitored for status and progress.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spaceNameYes
taskIdYes

Implementation Reference

  • The core handler function for the 'get_task_by_id' tool. It extracts parameters, validates taskId, creates an Octopus Deploy client, fetches the task using SpaceServerTaskRepository.getById, and returns the JSON response as MCP content.
    async (args) => {
      const { spaceName, taskId } = args as GetTaskByIdParams;
      
      if (!taskId) {
        throw new Error("Task ID is required");
      }
    
      const configuration = getClientConfigurationFromEnvironment();
      const client = await Client.create(configuration);
      const serverTaskRepository = new SpaceServerTaskRepository(client, spaceName);
      
      const response = await serverTaskRepository.getById(taskId);
      
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(response),
          },
        ],
      };
    }
  • TypeScript interface defining the input parameters for the get_task_by_id tool (spaceName and taskId), used for type casting in the handler.
    export interface GetTaskByIdParams {
      spaceName: string;
      taskId: string;
    }
  • Registers the 'get_task_by_id' tool on the MCP server using server.tool, including name, description, Zod input schema, properties, and handler function.
    export function registerGetTaskByIdTool(server: McpServer) {
      server.tool(
        'get_task_by_id',
        `Get details for a specific server task by its ID. ${tasksDescription}`,
        { spaceName: z.string(), taskId: z.string() },
        {
          title: 'Get details for a specific server task by its ID',
          readOnlyHint: true,
        },
        async (args) => {
          const { spaceName, taskId } = args as GetTaskByIdParams;
          
          if (!taskId) {
            throw new Error("Task ID is required");
          }
    
          const configuration = getClientConfigurationFromEnvironment();
          const client = await Client.create(configuration);
          const serverTaskRepository = new SpaceServerTaskRepository(client, spaceName);
          
          const response = await serverTaskRepository.getById(taskId);
          
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(response),
              },
            ],
          };
        }
      );
    }
  • Self-registration of the tool into the TOOL_REGISTRY, specifying tool name, config (toolset 'tasks', read-only), and the registration function.
    registerToolDefinition({
      toolName: "get_task_by_id",
      config: { toolset: "tasks", readOnly: true },
      registerFn: registerGetTaskByIdTool,
    });
  • Helper function to get a task by ID using a provided client, reusable logic similar to the handler but without MCP wrapper or client creation.
    export async function getTaskById(client: Client, params: GetTaskByIdParams) {
      const { spaceName, taskId } = params;
      
      if (!taskId) {
        throw new Error("Task ID is required");
      }
    
      const serverTaskRepository = new SpaceServerTaskRepository(client, spaceName);
      const response = await serverTaskRepository.getById(taskId);
      return response;
    }
Behavior3/5

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

Annotations already declare readOnlyHint=true, indicating a safe read operation. The description adds behavioral context by mentioning that tasks can be monitored for status and progress, which is useful beyond annotations. However, it does not disclose rate limits, authentication needs, or error behaviors, leaving some gaps.

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

Conciseness4/5

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

The description is appropriately sized with three sentences that are front-loaded with the core purpose. Each sentence adds value: the first states the action, the second explains tasks, and the third adds monitoring context. There is no wasted text, though it could be slightly more concise.

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

Completeness3/5

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

Given no output schema and 0% schema description coverage, the description provides basic purpose and context but lacks details on return values, error handling, or parameter formats. It is adequate for a simple read tool with annotations, but incomplete for full agent understanding without additional structured data.

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 0%, so the schema provides no parameter descriptions. The description mentions 'by its ID' which relates to the 'taskId' parameter, but does not explain 'spaceName' or provide format details. It adds minimal semantic value, compensating slightly but not fully for the coverage gap.

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

Purpose5/5

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

The description clearly states the tool's purpose with a specific verb ('Get details') and resource ('specific server task by its ID'), distinguishing it from siblings like 'get_task_details' and 'get_task_raw' by specifying it retrieves details for a task identified by ID. It further elaborates on what tasks represent in Octopus Deploy, adding context.

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

Usage Guidelines3/5

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

The description implies usage when needing details for a specific task by ID, but does not explicitly state when to use this tool versus alternatives like 'get_task_details' or 'get_task_raw'. It provides some context about tasks but lacks explicit guidance on exclusions or prerequisites.

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/OctopusDeploy/mcp-server'

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