View as Markdown
Google Docs icon

Google Docs ACTION

Insert Rich Link

Insert a file smart chip (rich link) to a Google Drive file into a Google Doc. The chip shows the file's live title and icon, unlike a plain hyperlink. Use it to reference another Doc, Sheet, Slides deck, Drive file or Drive folder. Only Google Drive URLs are accepted: YouTube, Calendar, Maps and other websites fail with The URL is invalid, and Error fetching chip data means the file doesn't exist or this account can't open it. Get a document's URL from Find Document (url). Place the chip with Placeholder (replace text such as {{spec}} that you wrote with Insert Text) or with Position; in a multi-tab document either set Tab ID (from List Tabs) or use Placeholder. Example: call with documentId=1AbC..., fileUrl=https://docs.google.com/document/d/1XyZ.../edit, placeholder={{spec}} -> returns chipsInserted, each chip's tabId and index, and the document url. See the documentation
  • Action
  • Writes data
  • OAuth
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Google Docs account once, then configure and run Insert Rich Link from your backend or agent.

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Insert Rich Link inputs
Property Type Description
documentId Document ID string
The ID of the Google Doc. This is the long string in the document's URL: https://docs.google.com/document/d/{DOCUMENT_ID}/edit. Use Find Document to resolve a document's name to its ID.
Required
fileUrl File URL string
URL of the Google Drive file or folder to link, e.g. https://docs.google.com/document/d/1XyZ.../edit, https://docs.google.com/spreadsheets/d/1XyZ.../edit, or https://drive.google.com/drive/folders/1XyZ.... A Google Doc's URL comes from Find Document (url); any other Drive file or folder URL works too. Google sets the chip's title from the file, so no title is needed.
Required
placeholder Placeholder string
Existing text to replace with the chip, matched exactly (case-sensitive). Typically a placeholder you wrote with Insert Text, such as {{owner}}, or a name already in the document. Searches every tab unless Tab ID is set. When set, Position is ignored. This is the reliable way to put a chip mid-sentence: no character index needed.
Optional
occurrence Occurrence string
Which matches of Placeholder become chips: all (default) or first.
Optional
position Position string
Where to insert the chip when no Placeholder is given: end to append to the end of the tab (default), beginning, or a numeric character index (e.g. 12) from Get Document. The chip joins the paragraph at that point, so to start a new line insert a newline with Insert Text first.
Optional
tabId Tab ID string
For a multi-tab document, the ID of the tab to insert into (e.g. t.0); get IDs from List Tabs, or use the ID returned by Create Tab. Required when the document has more than one tab and the chip is placed by Position: the tool will not guess, so a chip never lands in the first tab by accident. With Placeholder, omit it to search every tab.
Optional
suggestMode Suggest Changes boolean
Make the change as a suggestion (Google Docs Suggesting mode) that the document's editors can accept or reject, instead of editing the document directly. The response's suggestionIds lists the suggestions the change created or extended - an edit next to an existing suggestion can join it rather than create a new one. Pass the IDs to Resolve Suggestions, or use List Suggestions to see every open suggestion. While a suggestion is open, the document text this returns shows the suggested and the original text side by side. Set true to propose the edit, or leave false (default) to edit directly.
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
google_docs-insert-rich-link
Version
0.1.0
App
Google Docs
Authentication
OAuth
Read-only
No
Destructive
No
Open world
Yes