Skip to main content
Glama

get_task

Retrieve detailed task information, including status, complexity, and subtasks, using an ID and project root. Filter by status or tags for focused task management.

Instructions

Get detailed information about a specific task

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
complexityReportNoPath to the complexity report file (relative to project root or absolute)
fileNoPath to the tasks file relative to project root
idYesTask ID(s) to get (can be comma-separated for multiple tasks)
projectRootYesAbsolute path to the project root directory (Optional, usually from session)
statusNoFilter subtasks by status (e.g., 'pending', 'done')
tagNoTag context to operate on

Implementation Reference

  • Core handler logic for the get_task tool: parses task IDs, fetches tasks using tmCore.tasks.get(), optionally filters subtasks by status, handles errors, and formats response.
    	async (args: GetTaskArgs, { log, tmCore }: ToolContext) => {
    		const { id, status, projectRoot, tag } = args;
    
    		try {
    			log.info(
    				`Getting task details for ID: ${id}${status ? ` (filtering subtasks by status: ${status})` : ''} in root: ${projectRoot}`
    			);
    
    			// Parse and validate task IDs (validation already done by schema, this handles splitting)
    			const taskIds = parseTaskIds(id);
    			const results = await Promise.all(
    				taskIds.map((taskId) => tmCore.tasks.get(taskId, tag))
    			);
    
    			const tasks: (Task | Subtask)[] = [];
    			for (const result of results) {
    				if (!result.task) continue;
    
    				// If status filter is provided, filter subtasks (create copy to avoid mutation)
    				if (status && result.task.subtasks) {
    					const statusFilters = status
    						.split(',')
    						.map((s) => s.trim().toLowerCase());
    					const filteredSubtasks = result.task.subtasks.filter((st) =>
    						statusFilters.includes(String(st.status).toLowerCase())
    					);
    					tasks.push({ ...result.task, subtasks: filteredSubtasks });
    				} else {
    					tasks.push(result.task);
    				}
    			}
    
    			if (tasks.length === 0) {
    				log.warn(`No tasks found for ID(s): ${id}`);
    				return handleApiResult({
    					result: {
    						success: false,
    						error: {
    							message: `No tasks found for ID(s): ${id}`
    						}
    					},
    					log,
    					projectRoot
    				});
    			}
    
    			log.info(
    				`Successfully retrieved ${tasks.length} task(s) for ID(s): ${id}`
    			);
    
    			// Return single task if only one ID was requested, otherwise array
    			const responseData = taskIds.length === 1 ? tasks[0] : tasks;
    
    			return handleApiResult({
    				result: {
    					success: true,
    					data: responseData
    				},
    				log,
    				projectRoot,
    				tag
    			});
    		} catch (error: any) {
    			log.error(`Error in get-task: ${error.message}`);
    			if (error.stack) {
    				log.debug(error.stack);
    			}
    			return handleApiResult({
    				result: {
    					success: false,
    					error: {
    						message: `Failed to get task: ${error.message}`
    					}
    				},
    				log,
    				projectRoot
    			});
    		}
    	}
    )
  • Zod schema defining input parameters for get_task tool: id (required, supports comma-separated), status (optional filter), projectRoot (optional), tag (optional).
    const GetTaskSchema = z.object({
    	id: taskIdsSchema.describe(
    		'Task ID(s) to get (can be comma-separated for multiple tasks)'
    	),
    	status: z
    		.string()
    		.optional()
    		.describe("Filter subtasks by status (e.g., 'pending', 'done')"),
    	projectRoot: z
    		.string()
    		.describe(
    			'Absolute path to the project root directory (Optional, usually from session)'
    		),
    	tag: z.string().optional().describe('Tag context to operate on')
    });
  • Registration function registerGetTaskTool that adds the get_task tool to the FastMCP server with name, description, schema, and wrapped execute handler.
    export function registerGetTaskTool(server: FastMCP) {
    	server.addTool({
    		name: 'get_task',
    		description: 'Get detailed information about a specific task',
    		parameters: GetTaskSchema,
    		execute: withToolContext(
    			'get-task',
    			async (args: GetTaskArgs, { log, tmCore }: ToolContext) => {
    				const { id, status, projectRoot, tag } = args;
    
    				try {
    					log.info(
    						`Getting task details for ID: ${id}${status ? ` (filtering subtasks by status: ${status})` : ''} in root: ${projectRoot}`
    					);
    
    					// Parse and validate task IDs (validation already done by schema, this handles splitting)
    					const taskIds = parseTaskIds(id);
    					const results = await Promise.all(
    						taskIds.map((taskId) => tmCore.tasks.get(taskId, tag))
    					);
    
    					const tasks: (Task | Subtask)[] = [];
    					for (const result of results) {
    						if (!result.task) continue;
    
    						// If status filter is provided, filter subtasks (create copy to avoid mutation)
    						if (status && result.task.subtasks) {
    							const statusFilters = status
    								.split(',')
    								.map((s) => s.trim().toLowerCase());
    							const filteredSubtasks = result.task.subtasks.filter((st) =>
    								statusFilters.includes(String(st.status).toLowerCase())
    							);
    							tasks.push({ ...result.task, subtasks: filteredSubtasks });
    						} else {
    							tasks.push(result.task);
    						}
    					}
    
    					if (tasks.length === 0) {
    						log.warn(`No tasks found for ID(s): ${id}`);
    						return handleApiResult({
    							result: {
    								success: false,
    								error: {
    									message: `No tasks found for ID(s): ${id}`
    								}
    							},
    							log,
    							projectRoot
    						});
    					}
    
    					log.info(
    						`Successfully retrieved ${tasks.length} task(s) for ID(s): ${id}`
    					);
    
    					// Return single task if only one ID was requested, otherwise array
    					const responseData = taskIds.length === 1 ? tasks[0] : tasks;
    
    					return handleApiResult({
    						result: {
    							success: true,
    							data: responseData
    						},
    						log,
    						projectRoot,
    						tag
    					});
    				} catch (error: any) {
    					log.error(`Error in get-task: ${error.message}`);
    					if (error.stack) {
    						log.debug(error.stack);
    					}
    					return handleApiResult({
    						result: {
    							success: false,
    							error: {
    								message: `Failed to get task: ${error.message}`
    							}
    						},
    						log,
    						projectRoot
    					});
    				}
    			}
    		)
    	});
    }
  • Central tool registry entry mapping 'get_task' to its registration function for dynamic tool loading.
    get_task: registerGetTaskTool,
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'get detailed information' but doesn't specify what that information includes (e.g., status, dependencies, metadata), whether it's read-only (implied by 'get'), authentication needs, error handling, or rate limits. For a tool with 6 parameters and no annotation coverage, this is a significant gap in transparency.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero waste—'Get detailed information about a specific task' is front-loaded and appropriately sized for its purpose. Every word earns its place, making it highly concise and well-structured.

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

Completeness2/5

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

Given the complexity (6 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what 'detailed information' returns, how parameters like 'complexityReport' or 'status' affect the output, or error cases. For a tool with multiple inputs and no structured output documentation, more context is needed to guide effective use.

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 100%, so the schema fully documents all 6 parameters (e.g., 'id' for task IDs, 'projectRoot' for directory path). The description adds no meaning beyond what the schema provides—it doesn't clarify parameter interactions, default behaviors, or examples. Baseline 3 is appropriate when the schema does all the work.

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

Purpose3/5

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

The description 'Get detailed information about a specific task' clearly states the verb ('get') and resource ('task'), but it's vague about what 'detailed information' entails and doesn't distinguish this tool from sibling tools like 'get_tasks' (plural) or 'expand_task'. It provides a basic purpose but lacks specificity about scope or differentiation.

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

Usage Guidelines2/5

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

The description offers no guidance on when to use this tool versus alternatives. With sibling tools like 'get_tasks', 'expand_task', and 'analyze_project_complexity', there's no indication of when this single-task retrieval is preferred over batch operations or other task-related tools. Usage context is implied at best.

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

Related 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/eyaltoledano/claude-task-master'

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