Skip to main content
Glama

showTask

Retrieve detailed information about a specific task, including its dependencies and subtasks, by providing the project ID and task ID. Integrates with the MCP Task Manager Server for structured project tracking.

Instructions

Retrieves the full details of a single, specific task, including its dependencies and direct subtasks. Requires the project ID and the task ID. Returns a task object containing all details if found.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesThe unique identifier (UUID) of the project the task belongs to.
task_idYesThe unique identifier of the task to retrieve details for.

Implementation Reference

  • The async processRequest function implements the core logic of the showTask tool: logs request, fetches task via TaskService.getTaskById, returns JSON stringified task as text content, handles NotFoundError and other errors appropriately.
    const processRequest = async (args: ShowTaskArgs) => { logger.info(`[${TOOL_NAME}] Received request with args:`, args); try { // Call the service method to get the task details const task = await taskService.getTaskById(args.project_id, args.task_id); // Format the successful response logger.info(`[${TOOL_NAME}] Found task ${args.task_id} in project ${args.project_id}`); return { content: [{ type: "text" as const, text: JSON.stringify(task) // Return the full task object }] }; } catch (error: unknown) { // Handle potential errors logger.error(`[${TOOL_NAME}] Error processing request:`, error); if (error instanceof NotFoundError) { // Specific error if the project or task wasn't found // Map to InvalidParams as the provided ID(s) are invalid in this context throw new McpError(ErrorCode.InvalidParams, error.message); } else { // Generic internal error const message = error instanceof Error ? error.message : 'An unknown error occurred while retrieving the task.'; throw new McpError(ErrorCode.InternalError, message); } } };
  • Defines TOOL_NAME, TOOL_DESCRIPTION, TOOL_PARAMS Zod schema for input validation (project_id: UUID string, task_id: non-empty string), and inferred ShowTaskArgs type.
    export const TOOL_NAME = "showTask"; export const TOOL_DESCRIPTION = ` Retrieves the full details of a single, specific task, including its dependencies and direct subtasks. Requires the project ID and the task ID. Returns a task object containing all details if found. `; // Zod schema for the parameters, matching FR-004 and showTaskTool.md spec export const TOOL_PARAMS = z.object({ project_id: z.string() .uuid("The project_id must be a valid UUID.") .describe("The unique identifier (UUID) of the project the task belongs to."), // Required, UUID format task_id: z.string() // Add .uuid() if task IDs are also UUIDs, otherwise keep as string .min(1, "Task ID cannot be empty.") .describe("The unique identifier of the task to retrieve details for."), // Required, string (or UUID) }); // Define the expected type for arguments based on the Zod schema export type ShowTaskArgs = z.infer<typeof TOOL_PARAMS>;
  • Registers the showTask tool on the MCP server using server.tool() with name, description, param schema, and handler function.
    // Register the tool with the server server.tool(TOOL_NAME, TOOL_DESCRIPTION, TOOL_PARAMS.shape, processRequest);
  • Calls showTaskTool registration function during overall tool registration in index.ts, passing server and taskService instance.
    showTaskTool(server, taskService);

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/bsmi021/mcp-task-manager-server'

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