diff --git a/apps/sim/tools/google_slides/add_image.ts b/apps/sim/tools/google_slides/add_image.ts index b8f257d21a..5a72a711b6 100644 --- a/apps/sim/tools/google_slides/add_image.ts +++ b/apps/sim/tools/google_slides/add_image.ts @@ -200,6 +200,24 @@ export const addImageTool: ToolConfig = { metadata: { type: 'json', description: 'Operation metadata including presentation ID and image URL', + properties: { + presentationId: { + type: 'string', + description: 'The presentation ID', + }, + pageObjectId: { + type: 'string', + description: 'The page object ID where the image was inserted', + }, + imageUrl: { + type: 'string', + description: 'The source image URL', + }, + url: { + type: 'string', + description: 'URL to open the presentation', + }, + }, }, }, } diff --git a/apps/sim/tools/google_slides/add_slide.ts b/apps/sim/tools/google_slides/add_slide.ts index 1f44d84ce4..7b0b8b852c 100644 --- a/apps/sim/tools/google_slides/add_slide.ts +++ b/apps/sim/tools/google_slides/add_slide.ts @@ -186,6 +186,25 @@ export const addSlideTool: ToolConfig = { metadata: { type: 'json', description: 'Operation metadata including presentation ID, layout, and URL', + properties: { + presentationId: { + type: 'string', + description: 'The presentation ID', + }, + layout: { + type: 'string', + description: 'The layout used for the new slide', + }, + insertionIndex: { + type: 'number', + description: 'The zero-based index where the slide was inserted', + optional: true, + }, + url: { + type: 'string', + description: 'URL to open the presentation', + }, + }, }, }, } diff --git a/apps/sim/tools/google_slides/create.ts b/apps/sim/tools/google_slides/create.ts index ff44c5393a..f64b083296 100644 --- a/apps/sim/tools/google_slides/create.ts +++ b/apps/sim/tools/google_slides/create.ts @@ -153,6 +153,24 @@ export const createTool: ToolConfig metadata: { type: 'json', description: 'Operation metadata including presentation ID and page object ID', + properties: { + presentationId: { + type: 'string', + description: 'The presentation ID', + }, + pageObjectId: { + type: 'string', + description: 'The page object ID where the shape was created', + }, + url: { + type: 'string', + description: 'URL to open the presentation', + }, + }, }, }, } diff --git a/apps/sim/tools/google_slides/create_table.ts b/apps/sim/tools/google_slides/create_table.ts index b219158869..e3d41dc59a 100644 --- a/apps/sim/tools/google_slides/create_table.ts +++ b/apps/sim/tools/google_slides/create_table.ts @@ -222,6 +222,20 @@ export const createTableTool: ToolConfig metadata: { type: 'json', description: 'Operation metadata including presentation ID and page object ID', + properties: { + presentationId: { + type: 'string', + description: 'The presentation ID', + }, + pageObjectId: { + type: 'string', + description: 'The page object ID where the table was created', + }, + url: { + type: 'string', + description: 'URL to open the presentation', + }, + }, }, }, } diff --git a/apps/sim/tools/google_slides/delete_object.ts b/apps/sim/tools/google_slides/delete_object.ts index 3e784b3aa5..05a6203319 100644 --- a/apps/sim/tools/google_slides/delete_object.ts +++ b/apps/sim/tools/google_slides/delete_object.ts @@ -126,6 +126,16 @@ export const deleteObjectTool: ToolConfig = { metadata: { type: 'json', description: 'Operation metadata including presentation ID and URL', + properties: { + presentationId: { + type: 'string', + description: 'The presentation ID', + }, + url: { + type: 'string', + description: 'URL to open the presentation', + }, + }, }, }, } diff --git a/apps/sim/tools/google_slides/get_thumbnail.ts b/apps/sim/tools/google_slides/get_thumbnail.ts index 0dedc15975..c1c5f7e4f3 100644 --- a/apps/sim/tools/google_slides/get_thumbnail.ts +++ b/apps/sim/tools/google_slides/get_thumbnail.ts @@ -167,6 +167,24 @@ export const getThumbnailTool: ToolConfig = metadata: { type: 'json', description: 'Operation metadata including presentation ID and URL', + properties: { + presentationId: { + type: 'string', + description: 'The presentation ID', + }, + url: { + type: 'string', + description: 'URL to open the presentation', + }, + }, }, }, } diff --git a/apps/sim/tools/google_slides/read.ts b/apps/sim/tools/google_slides/read.ts index 85accfac91..636a54bbaf 100644 --- a/apps/sim/tools/google_slides/read.ts +++ b/apps/sim/tools/google_slides/read.ts @@ -79,6 +79,39 @@ export const readTool: ToolConfig res.json()) - const slideIndex = params.slideIndex || 0 + const metadata = { + presentationId, + title: presentationData.title || 'Updated Presentation', + mimeType: 'application/vnd.google-apps.presentation', + url: `https://docs.google.com/presentation/d/${presentationId}/edit`, + } + + const slideIndex = + typeof params.slideIndex === 'string' + ? Number.parseInt(params.slideIndex, 10) + : (params.slideIndex ?? 0) const slide = presentationData.slides?.[slideIndex] + if (Number.isNaN(slideIndex) || slideIndex < 0) { + return { + success: false, + error: 'Slide index must be a non-negative number', + output: { + updatedContent: false, + metadata, + }, + } + } + if (!slide) { - throw new Error(`Slide at index ${slideIndex} not found`) + return { + success: false, + error: `Slide at index ${slideIndex} not found`, + output: { + updatedContent: false, + metadata, + }, + } } // Create requests to add content to the slide @@ -153,15 +181,14 @@ export const writeTool: ToolConfig