Skip to main content
Glama

get_task

Retrieve detailed task information by inputting a unique task number formatted as three uppercase letters, a hyphen, and digits (e.g., 'CRD-1').

Instructions

Retrieves detailed information for a specific task using its unique task number (e.g., 'CRD-1').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numberYesThe unique task number identifier (e.g., 'CRD-1'). Must be in the format: three uppercase letters, a hyphen, and one or more digits.

Implementation Reference

  • The main handler function that executes the get_task tool logic: validates input, makes API call to fetch task details, processes response, handles errors.
    async execute(input: GetTaskInput): Promise<unknown> { logger.info('Executing get-task tool', input); try { // Use the injected API client to get task by number if (!this.apiClient) { throw new Error('API client not available - tool not properly initialized'); } const url = `/task/number/${input.number.toUpperCase()}`; logger.debug(`Making GET request to: ${url}`); const responseData = await this.apiClient.get<TaskApiResponse>(url) as unknown as TaskApiResponse; // If responseData is null, undefined, or an empty object, // optional chaining and fallbacks will produce an "empty task" structure. // This ensures that if the API call itself doesn't throw (e.g. 404, 500), // but returns no meaningful data, we provide a default empty structure. // Return only the specific properties requested, ensuring compact JSON return { number: responseData?.number || input.number || '', // Echo input number if API response is empty title: responseData?.title || '', description: responseData?.description || '', status: responseData?.status || '', priority: responseData?.priority || '', agent: responseData?.agent || '', agent_prompt: responseData?.agent_prompt || '', context: responseData?.context || '', instructions: responseData?.instructions || '' }; } catch (error) { const errorMessage = (error instanceof Error) ? error.message : 'An unknown error occurred'; logger.error(`Error in get-task tool: ${errorMessage}`, error instanceof Error ? error : undefined); return { isError: true, content: [{ type: "text", text: errorMessage }] }; } }
  • Zod schema defining the input for get_task tool: requires 'number' in format XXX-NNN.
    const GetTaskSchema = z.object({ // Task number (required) number: z.string() .regex(/^[A-Za-z]{3}-\d+$/, { message: "Task number must be in the format ABC-123 (e.g., CRD-1 or crd-1). Case insensitive." }) .describe("Task number identifier (e.g., 'CRD-1')"), }).strict();
  • src/index.ts:315-330 (registration)
    Instantiation of GetTaskTool with SecureApiClient dependency injection and registration to the MCP server via tool.register(server) in production mode.
    const tools: any[] = [ new StartProjectTool(secureApiClient), new GetPromptTool(secureApiClient), new GetTaskTool(secureApiClient), new GetProjectTool(secureApiClient), new UpdateTaskTool(secureApiClient), new UpdateProjectTool(secureApiClient), new ListProjectsTool(secureApiClient), new ListTasksTool(secureApiClient), new NextTaskTool(secureApiClient), ]; // Register each tool with the server tools.forEach(tool => { tool.register(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/PixdataOrg/coderide-mcp'

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