Skip to main content
Glama

read_presentation

Extract text, JSON, or markdown content from PowerPoint presentations, including optional slide ranges and speaker notes for analysis and processing.

Instructions

Read and extract content from PowerPoint presentations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesPath to the PowerPoint file to read
include_notesNoWhether to include speaker notes
output_formatNoOutput format for the contenttext
slide_rangeNoRange of slides to read (optional)

Implementation Reference

  • The async run() method implementing the core tool execution logic, which validates the file path, checks existence, and returns file metadata with a note on reading limitations due to PptxGenJS.
    async run(args: { file_path: string; output_format?: string; slide_range?: { start?: number; end?: number }; include_notes?: boolean }) {
      try {
        // Parameter validation
        if (!args.file_path) {
          throw new Error("File path is required");
        }
        
        if (!fs.existsSync(args.file_path)) {
          throw new Error(`File not found: ${args.file_path}`);
        }
        
        // Note: PptxGenJS doesn't support reading existing PowerPoint files
        // This is a limitation of the library - it's primarily for creation, not reading
        // For reading PPT files, we'd need a different library like 'officegen' or 'node-pptx'
        
        const fileStats = fs.statSync(args.file_path);
        const fileName = path.basename(args.file_path);
        const fileSize = (fileStats.size / 1024).toFixed(2); // KB
        
        return {
          content: [{
            type: "text",
            text: `⚠️ **Read Operation Not Fully Supported**\n\n` +
                  `Unfortunately, PptxGenJS doesn't support reading existing PowerPoint files. ` +
                  `This is a current limitation of the library.\n\n` +
                  `**File Information:**\n` +
                  `📄 **Name:** ${fileName}\n` +
                  `📁 **Path:** ${args.file_path}\n` +
                  `📊 **Size:** ${fileSize} KB\n` +
                  `📅 **Modified:** ${fileStats.mtime.toLocaleString()}\n\n` +
                  `**Alternative approaches:**\n` +
                  `• Use Microsoft PowerPoint to view the content\n` +
                  `• Convert to PDF and use PDF reading tools\n` +
                  `• Use online PowerPoint viewers\n` +
                  `• Consider using a different library like 'mammoth' for basic text extraction\n\n` +
                  `**Requested format:** ${args.output_format || 'text'}\n` +
                  `**Include notes:** ${args.include_notes ? 'Yes' : 'No'}`
          }]
        };
        
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: `❌ **Failed to read presentation:** ${error instanceof Error ? error.message : String(error)}`
          }],
          isError: true
        };
      }
    }
  • JSON schema defining the input parameters for the read_presentation tool, including file_path (required), output_format, slide_range, and include_notes.
    parameters: {
      type: "object",
      properties: {
        file_path: {
          type: "string",
          description: "Path to the PowerPoint file to read"
        },
        output_format: {
          type: "string",
          description: "Output format for the content",
          enum: ["text", "json", "markdown"],
          default: "text"
        },
        slide_range: {
          type: "object",
          description: "Range of slides to read (optional)",
          properties: {
            start: { type: "number", description: "Start slide number (1-based)" },
            end: { type: "number", description: "End slide number (1-based)" }
          }
        },
        include_notes: {
          type: "boolean",
          description: "Whether to include speaker notes",
          default: false
        }
      },
      required: ["file_path"]
    },
  • src/index.ts:32-36 (registration)
    Registration of the read_presentation tool in the ListToolsRequestSchema handler, exposing name, description, and input schema.
    {
      name: pptReader.name,
      description: pptReader.description,
      inputSchema: pptReader.parameters
    },
  • src/index.ts:63-64 (registration)
    Registration in the CallToolRequestSchema switch statement, dispatching tool calls to pptReader.run().
    case "read_presentation":
      return await pptReader.run(request.params.arguments as any || {});
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool reads and extracts content, implying a read-only operation, but doesn't address critical aspects like error handling (e.g., invalid file paths), performance expectations, or whether it modifies the original file. This leaves significant gaps in understanding the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without unnecessary words. It's front-loaded with the core purpose ('read and extract content'), making it easy to grasp quickly. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (4 parameters, nested objects) and lack of annotations or output schema, the description is minimally adequate but incomplete. It covers the basic purpose but fails to address behavioral traits, usage context, or output details, leaving the agent to rely heavily on the schema for operational understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, meaning all parameters are well-documented in the schema itself. The description adds no additional semantic context beyond what's already in the schema (e.g., it doesn't explain how 'output_format' affects readability or why 'slide_range' is optional). This meets the baseline for high schema coverage but doesn't enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('read and extract content') and resource ('PowerPoint presentations'), making the tool's purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'analyze_presentation' or 'edit_presentation', which might have overlapping functionality with content extraction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'analyze_presentation' or 'create_presentation'. There's no mention of prerequisites, such as file accessibility, or when this tool is preferred over others for content extraction tasks.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/guangxiangdebizi/PPT-MCP'

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