Skip to main content
Glama

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
NameRequiredDescriptionDefault
filepathYesAbsolute path of the PPTX file to convert

Implementation Reference

  • 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;
  • 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), }; });
  • 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; }

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/zcaceres/markdownify-mcp'

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