Skip to main content
Glama

export_task_status

Export task status reports from TaskFlow MCP to files in markdown, JSON, or HTML formats for documentation and tracking purposes.

Instructions

Export the current status of all tasks in a request to a file.

This tool saves the current state of tasks, subtasks, dependencies, and notes to a file for reference.

You can specify:

  • 'format': 'markdown', 'json', or 'html'

  • 'outputPath': Full path to save the file, or just a directory path

  • 'filename': Optional custom filename (auto-generated if not provided)

Path handling:

  • If outputPath is a directory, filename will be auto-generated as '{project-name}_tasks.{ext}'

  • If outputPath includes filename, it will be used as-is

  • Relative paths are resolved from current working directory

  • If no path specified, saves to current working directory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestIdYes
outputPathNoDirectory or full file path where to save the export
filenameNoOptional custom filename (auto-generated if not provided)
formatNomarkdown

Implementation Reference

  • MCP tool handler that extracts arguments and delegates to TaskFlowService.exportTaskStatus method.
    async export_task_status(args: any) {
      const { requestId, outputPath, filename, format } = args ?? {};
      return service.exportTaskStatus(String(requestId), outputPath, filename, format);
    },
  • Core business logic for exporting task status: finds request, resolves file path, generates content based on format (markdown, json, html), creates directory if needed, writes file, returns path.
    public async exportTaskStatus(
      requestId: string,
      outputPath?: string,
      filename?: string,
      format: "markdown" | "json" | "html" = "markdown"
    ): Promise<{ outputPath: string; format: string }> {
      const req = this.data.requests.find((r) => r.requestId === requestId);
      if (!req) throw new Error("Request not found");
    
      const finalPath = await resolveExportPath(req, outputPath, filename, format);
      let content = "";
    
      switch (format) {
        case "markdown":
          content = generateMarkdownStatus(req);
          break;
        case "json":
          content = JSON.stringify(req, null, 2);
          break;
        case "html":
          content = generateHtmlStatus(req);
          break;
        default:
          throw new Error(`Unsupported format: ${format}`);
      }
    
      try {
        const dir = path.dirname(finalPath);
        await fs.mkdir(dir, { recursive: true });
        await fs.writeFile(finalPath, content, "utf-8");
        return { outputPath: finalPath, format };
      } catch (error: unknown) {
        console.error(`Error writing to file ${finalPath}:`, error);
        const msg = error instanceof Error ? error.message : String(error);
        throw new Error(`Failed to write to file ${finalPath}: ${msg}`);
      }
    }
  • Input schema used by the tool for parameter validation, including descriptions and default for format.
    inputSchema: {
      type: "object",
      properties: {
        requestId: { type: "string" },
        outputPath: { 
          type: "string",
          description: "Directory or full file path where to save the export"
        },
        filename: {
          type: "string",
          description: "Optional custom filename (auto-generated if not provided)"
        },
        format: {
          type: "string",
          enum: ["markdown", "json", "html"],
          default: "markdown"
        },
      },
      required: ["requestId"],
    },
  • Registration of the tool in the MCP server's listTools handler, making it discoverable.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        PLAN_TASK_TOOL,
        GET_NEXT_TASK_TOOL,
        MARK_TASK_DONE_TOOL,
        OPEN_TASK_DETAILS_TOOL,
        LIST_REQUESTS_TOOL,
        ADD_TASKS_TO_REQUEST_TOOL,
        UPDATE_TASK_TOOL,
        DELETE_TASK_TOOL,
        ADD_SUBTASKS_TOOL,
        MARK_SUBTASK_DONE_TOOL,
        UPDATE_SUBTASK_TOOL,
        DELETE_SUBTASK_TOOL,
        EXPORT_TASK_STATUS_TOOL,
        ADD_NOTE_TOOL,
        UPDATE_NOTE_TOOL,
        DELETE_NOTE_TOOL,
        ADD_DEPENDENCY_TOOL,
        GET_PROMPTS_TOOL,
        SET_PROMPTS_TOOL,
        UPDATE_PROMPTS_TOOL,
        REMOVE_PROMPTS_TOOL,
        ARCHIVE_COMPLETED_REQUESTS_TOOL,
        LIST_ARCHIVED_REQUESTS_TOOL,
        RESTORE_ARCHIVED_REQUEST_TOOL,
      ],
    }));
  • Tool specification object defining name, detailed description, and input schema, exported for use in server registration.
    export const EXPORT_TASK_STATUS_TOOL: Tool = {
      name: "export_task_status",
      description:
        "Export the current status of all tasks in a request to a file.\n\n" +
        "This tool saves the current state of tasks, subtasks, dependencies, and notes to a file for reference.\n\n" +
        "You can specify:\n" +
        "- 'format': 'markdown', 'json', or 'html'\n" +
        "- 'outputPath': Full path to save the file, or just a directory path\n" +
        "- 'filename': Optional custom filename (auto-generated if not provided)\n\n" +
        "Path handling:\n" +
        "- If outputPath is a directory, filename will be auto-generated as '{project-name}_tasks.{ext}'\n" +
        "- If outputPath includes filename, it will be used as-is\n" +
        "- Relative paths are resolved from current working directory\n" +
        "- If no path specified, saves to current working directory",
      inputSchema: {
        type: "object",
        properties: {
          requestId: { type: "string" },
          outputPath: { 
            type: "string",
            description: "Directory or full file path where to save the export"
          },
          filename: {
            type: "string",
            description: "Optional custom filename (auto-generated if not provided)"
          },
          format: {
            type: "string",
            enum: ["markdown", "json", "html"],
            default: "markdown"
          },
        },
        required: ["requestId"],
      },
    };

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/pinkpixel-dev/taskflow-mcp'

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