get_task_details
Retrieve detailed information about specific Octopus Deploy server tasks using their unique ID. Monitor deployment progress, health checks, and system maintenance operations to track task status and execution details.
Instructions
Get detailed information 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
| Name | Required | Description | Default |
|---|---|---|---|
| spaceName | Yes | ||
| taskId | Yes |
Implementation Reference
- src/tools/getTaskDetails.ts:34-56 (handler)The core handler function for the 'get_task_details' tool. It validates the taskId, creates an Octopus Deploy client from environment configuration, retrieves the SpaceServerTaskRepository, fetches the task details, and returns the response as JSON-formatted text content.async (args) => { const { spaceName, taskId } = args as GetTaskDetailsParams; 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.getDetails(taskId); return { content: [ { type: "text", text: JSON.stringify(response), }, ], }; } );
- src/tools/getTaskDetails.ts:8-11 (schema)TypeScript interface defining the expected input parameters for the get_task_details tool: spaceName and taskId strings.export interface GetTaskDetailsParams { spaceName: string; taskId: string; }
- src/tools/getTaskDetails.ts:25-57 (registration)Registers the 'get_task_details' tool on the MCP server, specifying the tool name, description, Zod input schema, UI options, and handler function.export function registerGetTaskDetailsTool(server: McpServer) { server.tool( 'get_task_details', `Get detailed information for a specific server task by its ID. ${tasksDescription}`, { spaceName: z.string(), taskId: z.string() }, { title: 'Get detailed information for a specific server task by its ID', readOnlyHint: true, }, async (args) => { const { spaceName, taskId } = args as GetTaskDetailsParams; 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.getDetails(taskId); return { content: [ { type: "text", text: JSON.stringify(response), }, ], }; } ); }
- src/tools/getTaskDetails.ts:59-63 (registration)Self-registers the tool in the global TOOL_REGISTRY, providing metadata (toolset 'tasks', read-only) and the registration function for use by registerTools in src/tools/index.ts.registerToolDefinition({ toolName: "get_task_details", config: { toolset: "tasks", readOnly: true }, registerFn: registerGetTaskDetailsTool, });
- src/tools/getTaskDetails.ts:13-23 (helper)Helper function to fetch task details given a pre-initialized Client and parameters. Duplicates logic from handler but assumes client is provided.export async function getTaskDetails(client: Client, params: GetTaskDetailsParams) { const { spaceName, taskId } = params; if (!taskId) { throw new Error("Task ID is required"); } const serverTaskRepository = new SpaceServerTaskRepository(client, spaceName); const response = await serverTaskRepository.getDetails(taskId); return response; }