Skip to main content
Glama

keynote_get_presentation_info

Retrieve metadata for an open presentation, including slide count, master slide names, and file path. Use this to identify available master slides before redesigning slides.

Instructions

Get metadata for an open presentation: slide count, available master slide names, and file path. Call this first to understand what masters are available before redesigning.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
doc_indexNoDocument index (0-based). Defaults to 0 (frontmost).

Implementation Reference

  • The actual JXA (JavaScript for Automation) handler that executes 'get_presentation_info'. It retrieves the document, enumerates master slides, and returns name, slideCount, masterSlides, filePath, and modified status.
    case 'get_presentation_info': {
      var doc = getDoc(app, payload.doc_index);
      var masters = [];
      var ms = safeCall(function() { return doc.masterSlides(); }, []);
      for (var i = 0; i < ms.length; i++) {
        masters.push(safeCall(function() { return ms[i].name(); }, 'Unnamed'));
      }
      return {
        name:        safeCall(function() { return doc.name(); }, 'Untitled'),
        slideCount:  safeCall(function() { return doc.slides.length; }, 0),
        masterSlides: masters,
        filePath:    safeCall(function() { return doc.file.posixPath(); }, ''),
        modified:    safeCall(function() { return doc.modified(); }, false)
      };
    }
  • Tool definition/schema for 'keynote_get_presentation_info', declaring the input schema with an optional doc_index field.
    {
      name: 'keynote_get_presentation_info',
      description: 'Get metadata for an open presentation: slide count, available master slide names, and file path. Call this first to understand what masters are available before redesigning.',
      inputSchema: {
        type: 'object',
        properties: {
          doc_index: ELEMENT_FIELDS.doc_index,
        },
      },
    },
  • src/index.ts:95-100 (registration)
    Registration in the MCP server handler: maps the tool name 'keynote_get_presentation_info' to bridge.execute('get_presentation_info', ...) with optional doc_index.
    case 'keynote_get_presentation_info': {
      const result = await bridge.execute('get_presentation_info', {
        doc_index: optionalNumber(args.doc_index),
      });
      return jsonResult(result);
    }
  • KeynoteBridge.execute() method that spawns osascript with the JXA script, passing the operation name and payload via environment variables.
    export class KeynoteBridge {
      async execute<T>(
        operation: string,
        payload: Record<string, unknown>,
        options?: { timeoutMs?: number },
      ): Promise<T> {
        const { stdout, stderr, exitCode } = await this.runJxa(
          operation,
          payload,
          options?.timeoutMs,
        );
        return parseJxaEnvelope<T>(stdout, stderr, exitCode, 'Keynote');
      }
    
      private runJxa(
        operation: string,
        payload: Record<string, unknown>,
        timeoutMs = 120_000,
      ): Promise<{ stdout: string; stderr: string; exitCode: number | null }> {
        return new Promise((resolve, reject) => {
          const child = spawn('osascript', ['-l', 'JavaScript'], {
            env: {
              ...process.env,
              KEYNOTE_OPERATION: operation,
              KEYNOTE_PAYLOAD: JSON.stringify(payload ?? {}),
            },
          });
    
          let stdout = '';
          let stderr = '';
          let settled = false;
Behavior4/5

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

No annotations are provided, so the description carries full burden. It accurately describes the read-only metadata (slide count, master names, file path) and implies the presentation must be open. While it lacks explicit safety notes, it is not misleading and covers key behavioral aspects.

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, concise sentence (20 words) that front-loads the return items and ends with a usage hint. Every element is meaningful with no redundancy.

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

Completeness4/5

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

For a simple tool with one optional parameter and no output schema, the description adequately explains what it returns and when to use it. It could mention that doc_index defaults to frontmost, but that is covered in the schema.

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?

Schema description coverage is 100% (doc_index fully described in schema). The description adds no additional parameter details beyond what the schema provides, so the baseline of 3 is appropriate.

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

Purpose5/5

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

The description clearly states the verb 'Get' and the resource 'metadata for an open presentation', specifying three concrete data items (slide count, master names, file path). This differentiates it from sibling tools that focus on slide or element actions.

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

Usage Guidelines4/5

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

The description explicitly says 'Call this first to understand what masters are available before redesigning', providing clear context for when to use. It does not mention when not to use or alternatives, but the guidance is direct and actionable.

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/tszaks/keynote-mcp'

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