Slide Operations

Your AI assistant uses these tools to work with individual slides — adding new ones, inspecting what's on them, making copies, and removing slides you don't need.

A slide is a single page in a presentation. Each slide has a background color and contains elements like text, shapes, lines, and images. When you ask your assistant to modify specific slides, it uses these tools behind the scenes. For creating multiple slides at once, it uses slide_bulk_create instead.

Adding a Slide

When you ask for a new slide in a specific position (“add a blank slide after slide 2”), your assistant uses slide_create. It creates a single slide with an optional layout and returns the placeholder elements created by that layout (title, body, etc.), which can then be styled or filled with content.

Parameters

ParameterTypeRequiredDescription
deckIdstringYesThe ID of the slide deck
layoutIdstringNoLayout ID from deck_get. Omit to use the deck's default layout. An unknown id is rejected with a list of the deck's valid ids
afterSlideNumbernumberNoInsert after this slide number (1-based). Use 0 for the beginning. Omit to add at the end.
backgroundColorstringNoSlide background color (hex, e.g., '#FFFFFF'). Overrides layout default.

What It Returns

  • slideId — the new slide's ID
  • layoutName — name of the layout applied
  • elements — placeholder elements created by the layout (with elementId, type, and role)
  • canvas { width, height } in pixels

Example

// Layout ids come from deck_get on this deck.
// Omit layoutId to use the deck's default layout.
slide_create({
  deckId: "deck_abc123",
  layoutId: "layout-Qc9Wb3Xn",
  afterSlideNumber: 2,
  backgroundColor: "#1C2833"
})

// Response:
// {
//   slideId: "slide_xyz789",
//   slideIndex: 2,
//   layoutName: "Title and Content",
//   elements: [
//     { elementId: "elem_001", type: "text", role: "title" },
//     { elementId: "elem_002", type: "text", role: "body" }
//   ],
//   canvas: { width: 1280, height: 720 }
// }

Inspecting Slide Contents

When your assistant needs to see what's on specific slides before making changes, it calls slide_get. This returns every element on the requested slides — text content, positions, sizes, colors, fonts, images, and more. It's a read-only operation that supports up to 20 slides per request.

Parameters

ParameterTypeRequiredDescription
deckIdstringYesThe ID of the slide deck
slideIdsstring[]No*Array of slide IDs to retrieve
slideNumbersnumber[]No*Array of slide numbers (1-based) to retrieve

* At least one of slideIds or slideNumbers must be provided. You can provide both to combine results.

What It Returns

For every element on the requested slides, the response includes:

  • Position and size — x, y coordinates and width, height in pixels
  • Text content — the actual text and formatting (fontSize, color, fontFamily, alignment)
  • Shape styling — fill color, stroke color/width/style, shape type
  • Role — semantic role (title, subtitle, body, footer) if assigned
  • Image details — URL, dimensions, and alt text for image elements
  • Line properties — start/end anchors and arrow heads/tails for line elements

Example

// Get slides by number (1-based)
slide_get({
  deckId: "deck_abc123",
  slideNumbers: [1, 2]
})

// Response includes full element details:
//
// ## 2 Slide(s) Retrieved
//
// ### Slide 1 (`slide_001`)
// Layout: Title Slide | Background: #1C2833 | 3 elements
//
//   1. `elem_a` text [title]
//      Position: (80, 200) | Size: 1120 × 100
//      Text: "Q4 Business Review"
//      Style: 44pt #FFFFFF Inter center
//
//   2. `elem_b` text [subtitle]
//      Position: (80, 320) | Size: 1120 × 60
//      Text: "January 2026"
//      Style: 24pt #AAB7B8 Inter center
//
// ### Slide 2 (`slide_002`)
// Layout: Title and Content | Background: #1C2833 | 2 elements
// ...
// Or get slides by ID
slide_get({
  deckId: "deck_abc123",
  slideIds: ["slide_001", "slide_003"]
})

Updating a Slide Background

When you ask to change a slide's background after it exists — “make slide 2 dark”, “give the title slide a gradient” — your assistant uses slide_update. It sets a solid color, a gradient, or both. A gradient renders over the color, so setting only backgroundColor clears any existing gradient — that's how a gradient slide becomes a solid-color one.

A slide doesn't have to own a background. When it owns none it inherits its layout's, and failing that the master's, so recoloring the master recolors every slide that hasn't chosen its own. Passing backgroundColor: null puts a slide back on that chain, and slide_get reports the effective background with backgroundInherited saying whether the slide owns it.

// Switch a slide to a solid dark background
slide_update({
  deckId: "deck_abc123",
  slideId: "slide_xyz789",
  backgroundColor: "#0E1116"
})

// Or apply a gradient (renders over the color)
slide_update({
  deckId: "deck_abc123",
  slideId: "slide_xyz789",
  backgroundGradient: {
    type: "linear",
    angle: 90,
    stops: [
      { position: 0, color: "#50BEBE" },
      { position: 100, color: "#0099CB" }
    ]
  }
})

// Or drop the slide's own background so it inherits the layout's, then the master's
slide_update({
  deckId: "deck_abc123",
  slideId: "slide_xyz789",
  backgroundColor: null
})

// Response:
// {
//   slideId: "slide_xyz789",
//   slideIndex: 2,
//   backgroundColor: "#0E1116",
//   backgroundGradient: null,
//   backgroundInherited: false
// }

Duplicating a Slide

When you say “copy slide 3” or “make a variation of this slide,” your assistant uses slide_duplicate. It creates a complete copy of the slide and all its elements at the specified position. The response includes a mapping of old element IDs to new ones, so the assistant can update specific elements in the copy without affecting the original.

Parameters

ParameterTypeRequiredDescription
deckIdstringYesThe ID of the slide deck
slideIdstringNo*The ID of the slide to duplicate
slideNumbernumberNo*The slide number to duplicate (1-based)
afterSlideNumbernumberNoWhere to insert the copy: 0 = beginning, N = after slide N, -1 = end. Omit to insert right after the source slide.

* At least one of slideId or slideNumber must be provided.

What It Returns

  • newSlideId — the duplicated slide's ID
  • newSlideNumber — position of the new slide (1-based)
  • elementsCopied — number of elements duplicated
  • elementIdMap — mapping of old element IDs to new ones, so the assistant can update specific elements in the copy
  • totalSlideCount — total slides in the deck after duplication

Example

slide_duplicate({
  deckId: "deck_abc123",
  slideNumber: 1,
  afterSlideNumber: -1    // -1 = end of deck
})

// Response:
// {
//   newSlideId: "slide_new456",
//   newSlideNumber: 9,
//   sourceSlideNumber: 1,
//   elementsCopied: 3,
//   elementIdMap: [
//     { oldElementId: "elem_a", newElementId: "elem_d", type: "text" },
//     { oldElementId: "elem_b", newElementId: "elem_e", type: "text" },
//     { oldElementId: "elem_c", newElementId: "elem_f", type: "shape" }
//   ],
//   totalSlideCount: 9
// }

Deleting a Slide

When you ask to remove a slide, your assistant uses slide_delete. This permanently deletes the slide and all its elements — this action cannot be undone. A well-behaved assistant will inspect the slide contents first (using slide_get) to make sure it's deleting the right one.

Parameters

ParameterTypeRequiredDescription
deckIdstringYesThe ID of the slide deck
slideIdstringYesThe ID of the slide to delete

What It Returns

  • success — confirmation the slide was deleted
  • deletedElementCount — number of elements removed with the slide
  • remainingSlideCount — total slides remaining in the deck

Example

slide_delete({
  deckId: "deck_abc123",
  slideId: "slide_xyz789"
})

// Response:
// {
//   success: true,
//   slideId: "slide_xyz789",
//   slideIndex: 2,
//   deletedElementCount: 4,
//   remainingSlideCount: 7
// }

Screenshotting a Slide

slide_screenshot captures a slide as a PNG at the deck's canvas size, so your assistant can look at what it built rather than reasoning from coordinates. Element data alone doesn't catch text sitting on top of text, a color that fights the theme, or whitespace that ended up lopsided.

Parameters

ParameterTypeRequiredDescription
deckIdstringYesThe ID of the deck containing the slide
slideIdstringYesThe ID of the slide to screenshot

What It Returns

An image content part — a base64 PNG — plus a short status line. The call is read-only and changes nothing on the slide. It is best used after a series of edits, to check the finished result, rather than after every individual change.

Slide Numbering

When you refer to “slide 3” in conversation, your assistant maps that to the right slide behind the scenes. Here's how numbering works:

  • slideNumber — always 1-based. Slide 1 is the first slide.
  • afterSlideNumber — 1-based with special values: 0 = insert at the beginning, -1 = insert at the end.

Tip: Slide IDs are more reliable than numbers

Slide numbers change when slides are added, reordered, or deleted. Slide IDs are stable — your assistant uses them when referencing specific slides across multiple operations.

Related