Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ interface:
display_name: "Google Drive"
short_description: "One entrypoint for Drive, Docs, Sheets, and Slides"
brand_color: "#0F9D58"
default_prompt: "Use $google-drive to find the right Drive file, then summarize a Doc, update a Sheet, or edit a Slides deck through the unified Google Drive workflow."
default_prompt: "Use $google-drive to find the right Drive file, then summarize a Doc, update a Sheet, or edit a Slides deck through the unified Google Drive workflow, including refreshing linked charts or replacing static chart content from an existing connected source such as Google Sheets."
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Use these patterns as copy-and-fill templates. Do not invent raw `batch_update`

- Each request object must set exactly one request type key.
- Use live `objectId` values from `get_slide`.
- Classify the target as a text box, shape, line or connector, or image before choosing a request family.
- Keep batches small.
- Re-fetch a thumbnail after every batch.
- Prefer exact field masks. Do not use guessed field names.
Expand Down Expand Up @@ -104,6 +105,180 @@ Use this when a specific text box should be preserved structurally but its conte

Use this for geometry adjustments when the object already exists and only its position or scale is wrong.

## Update a shape fill and border

```json
[
{
"updateShapeProperties": {
"objectId": "shape-card-1",
"shapeProperties": {
"shapeBackgroundFill": {
"solidFill": {
"color": {
"rgbColor": {
"red": 0.92,
"green": 0.97,
"blue": 0.92
}
}
}
},
"outline": {
"outlineFill": {
"solidFill": {
"color": {
"rgbColor": {
"red": 0.18,
"green": 0.62,
"blue": 0.25
}
}
}
},
"weight": {
"magnitude": 19050,
"unit": "EMU"
}
}
},
"fields": "shapeBackgroundFill.solidFill.color,outline.outlineFill.solidFill.color,outline.weight"
}
}
]
```

Use this for accent bars, card fills, and border color or weight changes when the target is an existing shape.

## Update a line or connector stroke

```json
[
{
"updateLineProperties": {
"objectId": "line-arrow-1",
"lineProperties": {
"lineFill": {
"solidFill": {
"color": {
"rgbColor": {
"red": 0.84,
"green": 0.18,
"blue": 0.16
}
}
}
},
"weight": {
"magnitude": 19050,
"unit": "EMU"
},
"dashStyle": "SOLID",
"endArrow": "FILL_ARROW"
},
"fields": "lineFill.solidFill.color,weight,dashStyle,endArrow"
}
}
]
```

Use this when the arrow or connector is a line object, not a filled shape.

## Restyle an existing arrow shape

```json
[
{
"updateShapeProperties": {
"objectId": "shape-arrow-1",
"shapeProperties": {
"shapeBackgroundFill": {
"solidFill": {
"color": {
"rgbColor": {
"red": 0.20,
"green": 0.62,
"blue": 0.24
}
}
}
},
"outline": {
"propertyState": "NOT_RENDERED"
}
},
"fields": "shapeBackgroundFill.solidFill.color,outline.propertyState"
}
}
]
```

Use this when the arrow is a filled shape object and only its color or outline treatment should change.

## Delete and recreate a stale arrow or broken shape

```json
[
{
"deleteObject": {
"objectId": "shape-arrow-old"
}
},
{
"createShape": {
"objectId": "shape-arrow-new",
"shapeType": "DOWN_ARROW",
"elementProperties": {
"pageObjectId": "slide-1",
"size": {
"width": {
"magnitude": 260000,
"unit": "EMU"
},
"height": {
"magnitude": 260000,
"unit": "EMU"
}
},
"transform": {
"scaleX": 1,
"scaleY": 1,
"translateX": 720000,
"translateY": 1320000,
"unit": "EMU",
"shearX": 0,
"shearY": 0
}
}
}
},
{
"updateShapeProperties": {
"objectId": "shape-arrow-new",
"shapeProperties": {
"shapeBackgroundFill": {
"solidFill": {
"color": {
"rgbColor": {
"red": 0.84,
"green": 0.18,
"blue": 0.16
}
}
}
},
"outline": {
"propertyState": "NOT_RENDERED"
}
},
"fields": "shapeBackgroundFill.solidFill.color,outline.propertyState"
}
}
]
```

Use this when the existing arrow or decorative shape is the wrong type, badly malformed, or too brittle to patch safely in place.

## Create a new rectangle placeholder

```json
Expand Down Expand Up @@ -161,6 +336,10 @@ Use this immediately after `createShape` for text boxes.

- Wrong request key count: one object containing both `insertText` and `deleteObject`
- Guessed IDs instead of IDs from `get_slide`
- Updating the main headline value text and forgetting the smaller target or benchmark text box nearby
- Treating an arrow or accent bar as “uneditable” without first checking whether it is a shape or a line
- Using `updateShapeProperties` on a connector or `updateLineProperties` on a filled shape
- Stringified JSON instead of structured objects
- Giant batches mixing duplication, deletion, movement, and copy changes all at once
- Calling a visual edit complete because the text changed while the non-text styling stayed stale
- Verifying only the API response and not the next thumbnail
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Chart Refresh And Replacement Workflows

Use this guidance when the user asks to refresh, update, replace, or repair a chart in Google Slides.

## 1. Read chart slides structurally, not text-only

- Do not rely on `get_presentation_text` alone for chart workflows. Text-only deck reads can drop chart-only page elements and hide the object you need to act on.
- Start with `get_presentation` for deck-wide context and `get_slide` for the target slide before any write.
- Use `get_slide_thumbnail` when the request depends on whether the visual chart itself changed.

## 2. Distinguish linked charts from static content

- Look for a linked chart element first. The target slide may expose a chart-bearing page element with linked chart metadata such as a source workbook reference, chart ID, or source spreadsheet ID.
- If the slide has a linked chart, treat it as refreshable in place.
- If the slide only has an image, generic shape, or other static content and no linked chart metadata, do not pretend it can be refreshed in place. That is a chart replacement workflow, not a linked-chart refresh.

## 3. Reuse existing source charts before creating new ones

- If the user provided or implied a connected source, such as a Google Sheet, inspect that source for existing charts before creating any temporary charts.
- When the source already contains named or obviously matching charts, reuse those existing charts as the source graphics.
- Only create a new source chart when no suitable source chart exists or when the user explicitly asked for a new chart design.
- Do not turn a Slides static-content replacement task into a source-chart authoring task unless the missing source chart forces that extra step.

## 4. For linked charts, stay in Slides and use raw batch updates

- When the slide already contains a linked chart, use raw `batch_update` with the chart refresh request on the live chart object ID.
- Refresh the chart object first, then make any nearby title or annotation edits as separate text changes if needed.
- After the write, verify that the chart-bearing slide changed, not just the text around it.

## 5. For shape placeholders, replace the placeholder with a chart graphic

- If the slide contains an obvious chart placeholder shape, replace that placeholder with the chart graphic rather than leaving the placeholder underneath or beside the new chart.
- Preserve the intended chart-area footprint so the surrounding layout stays intact.
- If the user does not require persistent linking, prefer a non-linked chart insertion path when it keeps the visible result simpler.
- If the slide also contains helper text that only exists to label the placeholder area, remove or rewrite that text as part of the replacement so the slide no longer looks like a fixture.

## 6. For static chart content, replace the image in place

- If the chart area is static chart content, preserve the approximate position and size of the existing image.
- Replace the old chart image rather than stacking a second chart on top of it.
- If the image is clearly stale or explicitly marked as replaceable static content, do not report success until the old graphic is gone and the new one occupies the intended area.

## 7. If no source chart exists, be explicit about the extra step

- If the slide lacks a linked chart and the connected source lacks a suitable source chart, say that the source chart must be created or identified before the Slides replacement can be completed.
- If you create a new source chart because none existed, say so explicitly instead of describing the result as if the existing chart was merely refreshed.

## 8. Verification standard

- A chart refresh or replacement is only complete when the chart slide was re-read after the write and the visual result was checked with a thumbnail when the image itself matters.
- Do not claim success just because the write call succeeded or because adjacent chart labels changed.
- When thumbnail responses already include inline image content, inspect that directly instead of downloading the `contentUrl` just to look at the same slide.
- Verify both of these things before declaring success:
- the chart graphic itself now matches the intended source chart
- obsolete placeholder or instructional text is no longer visible unless the user asked to keep it
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Deck Scope Verification

Use this guidance whenever the task reads, edits, migrates, translates, or structurally updates more than one slide.

## 1. Build the authoritative slide checklist first

- Use `get_presentation` or `get_presentation_text` to capture every slide in scope in order before the first write.
- Record the ordered slide numbers, slide object IDs, and a short title or role for each slide.
- Do not infer coverage from object ID numbering. Google Slides IDs can skip values, and a missing numeric pattern does not mean the slide is absent.
- If a deck read is truncated or incomplete, re-read narrower spans until the full in-scope checklist is explicit.

## 2. Edit in bounded spans

- Work in one explicit slide or one small contiguous span at a time.
- State the first and last slide in the current span before writing.
- Do not start the next span until the current span has been verified.

## 3. Verify every span before advancing

- Re-read the edited slide or edited span immediately after the write.
- Confirm the intended change landed on the last slide in the span, not just the first one. This catches skipped middle or trailing slides.
- If a slide in scope is still unchanged, untranslated, unmigrated, or structurally stale, fix it before moving on.
- When the task depends on visual structure, pair the post-write read with thumbnails.

## 4. Reconcile the deck before calling it done

- Compare the final deck state against the checklist from step 1.
- Confirm that no slide in scope was skipped, duplicated, or left in a mixed old/new state.
- For transformed-copy workflows, confirm the source deck stayed unchanged and the copied deck contains the full requested coverage.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Sheets Chart Replacement

Use this reference when a Google Slides workflow needs to replace a screenshot, placeholder image, or stale chart graphic with a chart sourced from an existing Google Sheets workbook.

## Use When

- The user names both a spreadsheet and a presentation.
- The source chart already exists in Google Sheets and should be reused.
- The slide currently contains a screenshot, placeholder image, or other static chart content in the chart area.
- The user may also want a few narrow data edits before generating the refreshed chart graphic.

## Workflow

1. Ground both artifacts first.
- Search for the spreadsheet and presentation when the user gives titles instead of URLs.
- Read spreadsheet metadata to confirm the target chart titles and `chartId` values before writing.
- Read the presentation and target slides to capture slide numbers, titles, object IDs, and current chart-area elements.

2. Keep spreadsheet edits narrow when they are part of the request.
- Prefer exact cell updates on existing rows instead of table rewrites.
- Avoid KPI, headline summary, or rollup cells unless the user explicitly asks to change them.
- Do not add rows, remove rows, or create temporary charts unless the named chart is missing.
- Read back the changed ranges before touching Slides.

3. Capture the placeholder footprint from the live slide.
- Use `get_slide` to find the current screenshot, image, or placeholder object in the chart area.
- Reuse that element's size and transform as the starting footprint for the replacement chart.
- Use `get_slide_thumbnail` to check whether any separate instructional or placeholder text near the chart area also needs removal.

4. Replace the placeholder with the existing Sheets chart.
- Prefer `createSheetsChart` with the existing `spreadsheetId` and `chartId` from the workbook.
- Use `linkingMode: NOT_LINKED_IMAGE` when the user only needs a refreshed graphic and does not need the slide to stay linked to Sheets.
- Use `linkingMode: LINKED` only when the user explicitly wants ongoing chart linkage.
- Delete the obsolete screenshot or placeholder image once the replacement target is grounded.
- Preserve slide order, titles, nearby copy, and unrelated page elements.

5. Clean up chart-area residue.
- Remove separate placeholder or instructional text objects associated with the chart area when they are clearly obsolete.
- Do not delete slide titles, KPI summary content, or other non-chart text unless the user asked for that change.

6. Verify slide by slide.
- After each replacement, fetch a fresh thumbnail and refreshed slide structure.
- Expect Google Slides to normalize inserted chart size or aspect slightly; judge success by approximate footprint and visual cleanliness, not exact raw transform equality.
- Confirm the new chart object exists and the old placeholder image is gone before moving on.

7. Report exact outcomes.
- Exact spreadsheet ranges changed.
- Old and new values for each edited data cell.
- Slide numbers updated.
- Replacement success per chart.
- Whether any placeholder text remained.

## Failure Policy

- If the named chart is missing, then and only then consider creating a replacement chart.
- If the replacement introduces a layout problem, switch to the visual-iteration loop and adjust only the affected slide.
Loading