KosmoKrator

productivity

Google Slides Lua API for KosmoKrator Agents

Agent-facing Lua documentation and function reference for the Google Slides KosmoKrator integration.

7 functions 5 read 2 write Manual OAuth token auth

Lua Namespace

Agents call this integration through app.integrations.google_slides.*. Use lua_read_doc("integrations.google-slides") inside KosmoKrator to discover the same reference at runtime.

Agent-Facing Lua Docs

This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.

Google Slides — Lua API Reference

list_presentations

List Google Slides presentations from the user’s Drive.

Parameters

NameTypeRequiredDescription
pageSizeintegernoMax presentations per page (default: 20, max: 100)
pageTokenstringnoToken for the next page of results

Example

local result = app.integrations.google-slides.list_presentations({
  pageSize = 10
})

for _, file in ipairs(result.files) do
  print(file.name .. " (" .. file.id .. ")")
end

get_presentation

Get full details of a specific presentation.

Parameters

NameTypeRequiredDescription
idstringyesThe presentation ID

Example

local result = app.integrations.google-slides.get_presentation({
  id = "PRESENTATION_ID"
})

print("Title: " .. result.title)
print("Slides: " .. #result.slides)

create_presentation

Create a new, blank Google Slides presentation.

Parameters

NameTypeRequiredDescription
titlestringyesTitle for the new presentation

Example

local result = app.integrations.google-slides.create_presentation({
  title = "Q1 Review"
})

print("Created: " .. result.presentationId)

list_slides

List all slides in a presentation.

Parameters

NameTypeRequiredDescription
idstringyesThe presentation ID
pageSizeintegernoMax slides per page
pageTokenstringnoToken for the next page of results

Example

local result = app.integrations.google-slides.list_slides({
  id = "PRESENTATION_ID"
})

for _, slide in ipairs(result.slides) do
  print("Slide: " .. slide.objectId)
end

get_slide

Get details of a specific slide in a presentation.

Parameters

NameTypeRequiredDescription
idstringyesThe presentation ID
pagestringyesThe slide (page) object ID
objectIdFieldstringnoField to use for object ID resolution

Example

local result = app.integrations.google-slides.get_slide({
  id = "PRESENTATION_ID",
  page = "SLIDE_OBJECT_ID"
})

print("Slide has " .. #result.pageElements .. " elements")

create_slide

Add a new slide to an existing presentation. Optionally add text boxes and shapes.

Parameters

NameTypeRequiredDescription
idstringyesThe presentation ID
pageObjectIdstringnoCustom object ID for the new slide
createObjectbooleannoWhether to create the slide object (default: true)
elementsarraynoElements to add to the slide (see below)

Element Structure

Each element in the elements array is an object with:

FieldTypeDescription
typestring"text" or "shape"
shapestringShape type (e.g., "RECTANGLE"). Used when type is "shape".
textstringText content for the element
styleobjectSize, transform, and font properties

Example

local result = app.integrations.google-slides.create_slide({
  id = "PRESENTATION_ID",
  elements = {
    {
      type = "text",
      text = "Welcome to the presentation!"
    },
    {
      type = "shape",
      shape = "RECTANGLE",
      text = "Key Finding"
    }
  }
})

print("Slide created")

get_current_user

Get the authenticated Google user’s profile information.

Parameters

None.

Example

local result = app.integrations.google-slides.get_current_user({})
print("User: " .. result.user.displayName)
print("Email: " .. result.user.emailAddress)

Multi-Account Usage

If you have multiple Google accounts configured, use account-specific namespaces:

-- Default account (always works)
app.integrations.google-slides.list_presentations({})

-- Explicit default (portable across setups)
app.integrations.google-slides.default.list_presentations({})

-- Named accounts
app.integrations.google-slides.work.list_presentations({})
app.integrations.google-slides.personal.list_presentations({})

All functions are identical across accounts — only the credentials differ.

Raw agent markdown
# Google Slides — Lua API Reference

## list_presentations

List Google Slides presentations from the user's Drive.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `pageSize` | integer | no | Max presentations per page (default: 20, max: 100) |
| `pageToken` | string | no | Token for the next page of results |

### Example

```lua
local result = app.integrations.google-slides.list_presentations({
  pageSize = 10
})

for _, file in ipairs(result.files) do
  print(file.name .. " (" .. file.id .. ")")
end
```

---

## get_presentation

Get full details of a specific presentation.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The presentation ID |

### Example

```lua
local result = app.integrations.google-slides.get_presentation({
  id = "PRESENTATION_ID"
})

print("Title: " .. result.title)
print("Slides: " .. #result.slides)
```

---

## create_presentation

Create a new, blank Google Slides presentation.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `title` | string | yes | Title for the new presentation |

### Example

```lua
local result = app.integrations.google-slides.create_presentation({
  title = "Q1 Review"
})

print("Created: " .. result.presentationId)
```

---

## list_slides

List all slides in a presentation.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The presentation ID |
| `pageSize` | integer | no | Max slides per page |
| `pageToken` | string | no | Token for the next page of results |

### Example

```lua
local result = app.integrations.google-slides.list_slides({
  id = "PRESENTATION_ID"
})

for _, slide in ipairs(result.slides) do
  print("Slide: " .. slide.objectId)
end
```

---

## get_slide

Get details of a specific slide in a presentation.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The presentation ID |
| `page` | string | yes | The slide (page) object ID |
| `objectIdField` | string | no | Field to use for object ID resolution |

### Example

```lua
local result = app.integrations.google-slides.get_slide({
  id = "PRESENTATION_ID",
  page = "SLIDE_OBJECT_ID"
})

print("Slide has " .. #result.pageElements .. " elements")
```

---

## create_slide

Add a new slide to an existing presentation. Optionally add text boxes and shapes.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The presentation ID |
| `pageObjectId` | string | no | Custom object ID for the new slide |
| `createObject` | boolean | no | Whether to create the slide object (default: true) |
| `elements` | array | no | Elements to add to the slide (see below) |

### Element Structure

Each element in the `elements` array is an object with:

| Field | Type | Description |
|-------|------|-------------|
| `type` | string | `"text"` or `"shape"` |
| `shape` | string | Shape type (e.g., `"RECTANGLE"`). Used when `type` is `"shape"`. |
| `text` | string | Text content for the element |
| `style` | object | Size, transform, and font properties |

### Example

```lua
local result = app.integrations.google-slides.create_slide({
  id = "PRESENTATION_ID",
  elements = {
    {
      type = "text",
      text = "Welcome to the presentation!"
    },
    {
      type = "shape",
      shape = "RECTANGLE",
      text = "Key Finding"
    }
  }
})

print("Slide created")
```

---

## get_current_user

Get the authenticated Google user's profile information.

### Parameters

None.

### Example

```lua
local result = app.integrations.google-slides.get_current_user({})
print("User: " .. result.user.displayName)
print("Email: " .. result.user.emailAddress)
```

---

## Multi-Account Usage

If you have multiple Google accounts configured, use account-specific namespaces:

```lua
-- Default account (always works)
app.integrations.google-slides.list_presentations({})

-- Explicit default (portable across setups)
app.integrations.google-slides.default.list_presentations({})

-- Named accounts
app.integrations.google-slides.work.list_presentations({})
app.integrations.google-slides.personal.list_presentations({})
```

All functions are identical across accounts — only the credentials differ.

Metadata-Derived Lua Example

local result = app.integrations.google_slides.gslides_list_presentations({
  pageSize = 1,
  pageToken = "example_pageToken"
})
print(result)

Functions

gslides_list_presentations

List Google Slides presentations from the user's Drive. Returns presentation IDs, titles, and metadata.

Operation
Read read
Full name
google-slides.gslides_list_presentations
ParameterTypeRequiredDescription
pageSize integer no Maximum number of presentations to return per page (default: 20, max: 100).
pageToken string no Token for the next page of results from a previous response.

gslides_get_presentation

Get full details of a specific Google Slides presentation, including all slides, page elements, and layout information.

Operation
Read read
Full name
google-slides.gslides_get_presentation
ParameterTypeRequiredDescription
id string yes The presentation ID (found in the Google Slides URL or from list_presentations).

gslides_create_presentation

Create a new, blank Google Slides presentation with a given title.

Operation
Write write
Full name
google-slides.gslides_create_presentation
ParameterTypeRequiredDescription
title string yes The title for the new presentation.

gslides_list_slides

List all slides in a Google Slides presentation. Returns slide object IDs and thumbnails.

Operation
Read read
Full name
google-slides.gslides_list_slides
ParameterTypeRequiredDescription
id string yes The presentation ID.
pageSize integer no Maximum number of slides to return per page.
pageToken string no Token for the next page of results from a previous response.

gslides_get_slide

Get details of a specific slide (page) in a Google Slides presentation, including all page elements and their properties.

Operation
Read read
Full name
google-slides.gslides_get_slide
ParameterTypeRequiredDescription
id string yes The presentation ID.
page string yes The slide (page) object ID.
objectIdField string no The field to use for resolving object IDs in the response.

gslides_create_slide

Add a new slide to an existing Google Slides presentation. Optionally add text boxes and shapes to the new slide.

Operation
Write write
Full name
google-slides.gslides_create_slide
ParameterTypeRequiredDescription
id string yes The presentation ID.
pageObjectId string no Optional custom object ID for the new slide. If omitted, Google will generate one.
createObject boolean no Whether to create the slide object (default: true).
elements array no Optional array of elements to add to the new slide. Each element has: type ("text" or "shape"), shape (shape type like "RECTANGLE"), text (content string), and style (object with size, transform, font properties).

gslides_get_current_user

Get the authenticated Google user's profile information (display name, email, photo).

Operation
Read read
Full name
google-slides.gslides_get_current_user
ParameterTypeRequiredDescription
No parameters.