Skip to main content
Glama

get_subtask

Retrieve detailed subtask information, including parent task relationships, progress status, and implementation specifics, for precise work planning and scope assessment. Use an absolute working directory path and unique subtask ID as inputs.

Instructions

Examine subtask details with comprehensive context including parent task relationships, progress status, and implementation specifics. Essential for detailed work planning, progress assessment, and understanding the complete scope of granular work items.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe unique identifier of the subtask to retrieve
workingDirectoryYesThe full absolute path to the working directory where data is stored. MUST be an absolute path, never relative. Windows: "C:\Users\username\project" or "D:\projects\my-app". Unix/Linux/macOS: "/home/username/project" or "/Users/username/project". Do NOT use: ".", "..", "~", "./folder", "../folder" or any relative paths. Ensure the path exists and is accessible before calling this tool. NOTE: When server is started with --claude flag, this parameter is ignored and a global user directory is used instead.

Implementation Reference

  • Core handler function implementing the get_subtask tool logic: input validation, subtask retrieval from storage, enrichment with parent task and project details, formatted response with status and timestamps.
    handler: async ({ id }: { id: string }) => { try { // Validate input if (!id || id.trim().length === 0) { return { content: [{ type: 'text' as const, text: 'Error: Subtask ID is required.' }], isError: true }; } const subtask = await storage.getSubtask(id.trim()); if (!subtask) { return { content: [{ type: 'text' as const, text: `Error: Subtask with ID "${id}" not found. Use list_subtasks to see all available subtasks.` }], isError: true }; } // Get task and project information const task = await storage.getTask(subtask.taskId); const project = await storage.getProject(subtask.projectId); const taskName = task ? task.name : 'Unknown Task'; const projectName = project ? project.name : 'Unknown Project'; const status = subtask.completed ? '✅ Completed' : '⏳ Pending'; return { content: [{ type: 'text' as const, text: `**${subtask.name}** (ID: ${subtask.id}) **Task:** ${taskName} **Project:** ${projectName} **Status:** ${status} **Details:** ${subtask.details} **Created:** ${new Date(subtask.createdAt).toLocaleString()} **Last Updated:** ${new Date(subtask.updatedAt).toLocaleString()} Use update_subtask to modify this subtask or mark it as completed.` }] }; } catch (error) { return { content: [{ type: 'text' as const, text: `Error retrieving subtask: ${error instanceof Error ? error.message : 'Unknown error'}` }], isError: true }; } }
  • Input schema definition for the tool, requiring a string 'id' parameter.
    inputSchema: { id: z.string() },
  • src/server.ts:646-668 (registration)
    MCP server.tool registration for 'get_subtask', defining MCP input schema (workingDirectory + id), description, and wrapper handler that creates storage instance and invokes the tool's handler.
    server.tool( 'get_subtask', 'Examine subtask details with comprehensive context including parent task relationships, progress status, and implementation specifics. Essential for detailed work planning, progress assessment, and understanding the complete scope of granular work items.', { workingDirectory: z.string().describe(getWorkingDirectoryDescription(config)), id: z.string().describe('The unique identifier of the subtask to retrieve') }, async ({ workingDirectory, id }: { workingDirectory: string; id: string }) => { try { const storage = await createStorage(workingDirectory, config); const tool = createGetSubtaskTool(storage); return await tool.handler({ id }); } catch (error) { return { content: [{ type: 'text' as const, text: `Error: ${error instanceof Error ? error.message : 'Unknown error'}` }], isError: true }; } } );
  • Storage layer helper method to retrieve a subtask by ID from file-based data (legacy/deprecated but used by the tool).
    async getSubtask(id: string): Promise<Subtask | null> { if (!this.data.subtasks) return null; return this.data.subtasks.find(s => s.id === id) || null; }

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/Pimzino/agentic-tools-mcp'

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