pptx-to-markdown
Convert PPTX files into Markdown format to simplify content sharing and readability. This tool transforms presentation slides into structured Markdown text for easy editing and integration into documents or web pages.
Instructions
Convert a PPTX file to markdown
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filepath | Yes | Absolute path of the PPTX file to convert |
Implementation Reference
- src/server.ts:72-86 (handler)Handler execution logic for the pptx-to-markdown tool: validates the filepath argument and dispatches to Markdownify.toMarkdown for conversion.case tools.PDFToMarkdownTool.name: case tools.ImageToMarkdownTool.name: case tools.AudioToMarkdownTool.name: case tools.DocxToMarkdownTool.name: case tools.XlsxToMarkdownTool.name: case tools.PptxToMarkdownTool.name: if (!validatedArgs.filepath) { throw new Error("File path is required for this tool"); } result = await Markdownify.toMarkdown({ filePath: validatedArgs.filepath, projectRoot: validatedArgs.projectRoot, uvPath: validatedArgs.uvPath || process.env.UV_PATH, }); break;
- src/tools.ts:126-139 (schema)Schema definition for the pptx-to-markdown tool, including name, description, and input schema requiring a filepath.export const PptxToMarkdownTool = ToolSchema.parse({ name: "pptx-to-markdown", description: "Convert a PPTX file to markdown", inputSchema: { type: "object", properties: { filepath: { type: "string", description: "Absolute path of the PPTX file to convert", }, }, required: ["filepath"], }, });
- src/server.ts:33-37 (registration)Tool registration via the listTools handler, which returns all tools exported from tools.ts including pptx-to-markdown.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: Object.values(tools), }; });
- src/Markdownify.ts:20-51 (helper)Core helper function that executes the external 'markitdown' tool via 'uv run' to perform the actual PPTX to markdown conversion.private static async _markitdown( filePath: string, projectRoot: string, uvPath: string, ): Promise<string> { const venvPath = path.join(projectRoot, ".venv"); const markitdownPath = path.join( venvPath, process.platform === "win32" ? "Scripts" : "bin", `markitdown${process.platform === "win32" ? ".exe" : ""}`, ); if (!fs.existsSync(markitdownPath)) { throw new Error("markitdown executable not found"); } // Expand tilde in uvPath if present const expandedUvPath = expandHome(uvPath); // Use execFile to prevent command injection const { stdout, stderr } = await execFileAsync(expandedUvPath, [ "run", markitdownPath, filePath, ]); if (stderr) { throw new Error(`Error executing command: ${stderr}`); } return stdout; }