get_task_raw
Retrieve detailed raw information for a specific server task using its ID and space name to inspect task execution details and diagnose deployment issues.
Instructions
Get raw details for a specific server task by its ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spaceName | Yes | ||
| taskId | Yes |
Implementation Reference
- src/tools/getTaskRaw.ts:33-54 (handler)The core handler function for the 'get_task_raw' tool. It validates inputs, creates an Octopus Deploy client from environment config, retrieves raw task details via SpaceServerTaskRepository.getRaw(taskId), and returns the response as 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, }, ], }; }
- src/tools/getTaskRaw.ts:7-10 (schema)TypeScript interface defining the input parameters for the get_task_raw tool: spaceName and taskId.export interface GetTaskRawParams { spaceName: string; taskId: string; }
- src/tools/getTaskRaw.ts:24-56 (registration)Registers the 'get_task_raw' tool on the MCP server using server.tool(), including Zod schema for inputs {spaceName: z.string(), taskId: z.string()}, description, metadata, and the handler function.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, }, ], }; } ); }
- src/tools/getTaskRaw.ts:58-62 (registration)Self-registers the get_task_raw tool into the global TOOL_REGISTRY, specifying its toolset ('tasks') and read-only nature, linking to the registerGetTaskRawTool function.registerToolDefinition({ toolName: "get_task_raw", config: { toolset: "tasks", readOnly: true }, registerFn: registerGetTaskRawTool, });
- src/tools/getTaskRaw.ts:12-22 (helper)Helper function to retrieve raw task details given a pre-configured Client and params. Duplicates logic similar to the main handler but requires client to be passed.export async function getTaskRaw(client: Client, params: GetTaskRawParams) { const { spaceName, taskId } = params; if (!taskId) { throw new Error("Task ID is required"); } const serverTaskRepository = new SpaceServerTaskRepository(client, spaceName); const response = await serverTaskRepository.getRaw(taskId); return response; }