Skip to main content
Glama
OctopusDeploy

Octopus Deploy MCP Server

Official

get_task_raw

Retrieve detailed raw information for a specific Octopus Deploy server task using its unique ID and space name to inspect task execution and diagnose deployment issues.

Instructions

Get raw details for a specific server task by its ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spaceNameYes
taskIdYes

Implementation Reference

  • The core handler function for the 'get_task_raw' tool that creates an Octopus Deploy client from environment config, fetches raw task details from the specified space and task ID, and returns it as MCP text content.
    async (args) => {
      const { spaceName, taskId } = args as GetTaskRawParams;
      
      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.getRaw(taskId);
      
      return {
        content: [
          {
            type: "text",
            text: response,
          },
        ],
      };
    }
  • TypeScript interface defining the input parameters for the get_task_raw tool: spaceName and taskId.
    export interface GetTaskRawParams {
      spaceName: string;
      taskId: string;
    }
  • Registers the 'get_task_raw' tool on the MCP server using server.tool(), defining name, description, Zod input schema, tool properties, and handler.
    export function registerGetTaskRawTool(server: McpServer) {
      server.tool(
        'get_task_raw',
        'Get raw details for a specific server task by its ID',
        { spaceName: z.string(), taskId: z.string() },
        {
          title: 'Get raw details for a specific server task by its ID',
          readOnlyHint: true,
        },
        async (args) => {
          const { spaceName, taskId } = args as GetTaskRawParams;
          
          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.getRaw(taskId);
          
          return {
            content: [
              {
                type: "text",
                text: response,
              },
            ],
          };
        }
      );
    }
  • Self-registers the tool definition in the global TOOL_REGISTRY, enabling conditional registration via src/tools/index.ts based on toolset config.
    registerToolDefinition({
      toolName: "get_task_raw",
      config: { toolset: "tasks", readOnly: true },
      registerFn: registerGetTaskRawTool,
    });

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