# Google Docs Connector

## Links

- Product page URL: https://www.agentpmt.com/marketplace/google-docs-connector
- Product markdown URL: https://www.agentpmt.com/marketplace/google-docs-connector?format=agent-md
- Product JSON URL: https://www.agentpmt.com/marketplace/google-docs-connector?format=agent-json

## Overview

- Product ID: 6962fd6f4cf4309309cac7b0
- Vendor: Apoth3osis
- Type: connector
- Unit type: request
- Price: 500 credits
- Categories: Content Management & Publishing, Team Collaboration & Workspaces, Document Processing & OCR
- Generated at: 2026-05-30T20:18:09.430Z

### Page Description

Comprehensive Google Docs management tool enabling AI agents to create edit format and share documents through OAuth authentication. Supports rich text formatting with bold italic underline strikethrough and custom fonts paragraph styling with alignment spacing and indentation table creation and manipulation image insertion from URLs headers footers and page breaks named ranges for bookmarking document export to multiple formats including PDF DOCX HTML and EPUB sharing and permission management and natural language document creation. Perfect for document automation report generation collaborative editing template creation and content management workflows.

### Agent Description

Google Docs: create, edit, format documents. Tables, images, headers, page breaks. Export to PDF/DOCX/HTML. Share and manage permissions.

## Details

### Details

Comprehensive Google Docs management tool enabling AI agents to create edit format and share documents through OAuth authentication. Supports rich text formatting with bold italic underline strikethrough and custom fonts paragraph styling with alignment spacing and indentation table creation and manipulation image insertion from URLs headers footers and page breaks named ranges for bookmarking document export to multiple formats including PDF DOCX HTML and EPUB sharing and permission management and natural language document creation. Perfect for document automation report generation collaborative editing template creation and content management workflows.

### Actions

- `create_document` (5 credits): Create a new Google Doc.
- `get_document` (5 credits): Retrieve a document's full content, text, word count, and structure.
- `search_documents` (5 credits): Search for Google Docs by name. Returns documents sorted by most recently modified. Omit query to list recent documents.
- `batch_update` (5 credits): Execute raw Google Docs API batch update requests for advanced operations not covered by other actions.
- `insert_text` (5 credits): Insert text at a specific character position in a document.
- `replace_text` (5 credits): Find and replace all occurrences of text in a document.
- `format_text` (5 credits): Apply text and/or paragraph styling to a character range in a document.
- `insert_image` (5 credits): Insert an inline image from a publicly accessible URL.
- `create_table` (5 credits): Insert a table into a document, optionally populated with data. If table_data is provided, dimensions are inferred from it.
- `insert_page_break` (5 credits): Insert a page break at a specific position.
- `insert_section_break` (5 credits): Insert a section break at a specific position.
- `create_header` (5 credits): Add a header to the document.
- `create_footer` (5 credits): Add a footer to the document.
- `update_style` (5 credits): Alias for format_text. Apply text and/or paragraph styling to a character range.
- `create_named_range` (5 credits): Create a named range (bookmark) spanning a character range in the document.
- `export_document` (5 credits): Export a document to another format. Text formats (txt, html) return content directly; binary formats return base64-encoded content.
- `share_document` (5 credits): Set sharing permissions on a document via Google Drive.
- `get_permissions` (5 credits): List the current sharing permissions on a document.
- `quick_create` (5 credits): Create a document from a natural language description. If the text contains 'titled "..."' or 'called "..."', the title is extracted automatically.

### Use Cases

document automation, report generation, template creation, collaborative editing, content management, proposal writing, meeting agenda creation, contract generation, documentation workflows, batch document processing

### Workflows Using This Tool

#### GitHub Dev Announcements

Generate user-facing development update announcements from recent GitHub commits across one or more repositories. The user supplies a list of repos on the first run (wildcards like `org/*` allowed); the workflow stores them in a Google Sheet so subsequent runs need no input. For each run, the agent fetches commits since the last run (or last 7 days on first run), categorizes them into New Features / Updates / Bug Fixes, applies a security filter to strip internal paths, endpoints, secrets, and vulnerability details, drafts the announcement in a Google Doc, polishes the writing with a quality check tool, and logs the run (date, repos, commit count, doc URL, status) back in the sheet. Designed as a starting template — users can remix it to add their own follow-up steps such as posting to Slack or emailing subscribers.

- Page URL: https://www.agentpmt.com/agent-workflow-skills/github-dev-announcements
- Markdown URL: https://www.agentpmt.com/agent-workflow-skills/github-dev-announcements?format=agent-md
- Published: 2026-04-30T17:43:08.504Z

#### Gluten-Free Dinner Recipes to Kroger Cart

Generates 5 gluten-free dinner recipes, saves all recipes with full instructions to a Google Doc, extracts and deduplicates the combined ingredient list, then searches Kroger for all ingredients in a single batch using the gluten-free allergen filter and adds everything to your cart. Notifies you when complete with a link to the Google Doc and confirmation that your cart is ready.

- Page URL: https://www.agentpmt.com/agent-workflow-skills/gluten-free-dinner-recipes-to-kroger-cart
- Markdown URL: https://www.agentpmt.com/agent-workflow-skills/gluten-free-dinner-recipes-to-kroger-cart?format=agent-md
- Published: 2026-03-04T00:10:45.589Z

#### Kroger Grocery Auto-Order from Google Doc

Reads your Google Doc named grocery list, searches Kroger for each item to find the best-priced match, adds them to your Kroger cart, checks off completed items in the Google Doc, then sends you a notification that your order is ready.

- Page URL: https://www.agentpmt.com/agent-workflow-skills/kroger-grocery-auto-order-from-google-doc
- Markdown URL: https://www.agentpmt.com/agent-workflow-skills/kroger-grocery-auto-order-from-google-doc?format=agent-md
- Published: 2026-02-23T02:15:24.258Z

#### Rental Property Cash Flow Analyzer

Analyzes rental property investment viability by calculating mortgage payments, computing net operating income and cash-on-cash returns, projecting cash flows, generating return visualizations, creating a comprehensive investment analysis report, and delivering it to the investor. Essential for real estate investors evaluating rental property acquisitions.

- Page URL: https://www.agentpmt.com/agent-workflow-skills/rental-property-cash-flow-analyzer
- Markdown URL: https://www.agentpmt.com/agent-workflow-skills/rental-property-cash-flow-analyzer?format=agent-md
- Published: 2026-02-18T16:43:43.406Z

### Related Content

#### Claude Transcript - Allergen Friendly Grocery Shopping With AI

- Type: video
- Page URL: https://www.agentpmt.com/videos/claude-transcript-allergen-friendly-grocery-shopping-with-ai
- Markdown URL: Not available for this content type
Full Claude Code transcript showing an AI agent executing the Gluten-Free Dinner Recipes to Kroger Cart workflow -- generating recipes, saving to Google Docs, searching Kroger, and adding 41 items to the cart.

#### AI Grocery Shopping is HERE -- Gluten-Free Recipes to Kroger Cart in Minutes

- Type: video
- Page URL: https://www.agentpmt.com/videos/ai-grocery-shopping-is-here-gluten-free-recipes-to-kroger-cart-in-minutes
- Markdown URL: Not available for this content type
Watch an AI agent generate 5 gluten-free dinner recipes, save them to Google Docs, search Kroger for all ingredients, and add 41 items to a Kroger cart -- all autonomously using AgentPMT workflow skills.

## Integration Details

### DynamicMCP

- Setup page URL: https://www.agentpmt.com/dynamic-mcp
- Claude setup guide: https://www.agentpmt.com/dynamic-mcp?platform=claude#videos
- ChatGPT setup guide: https://www.agentpmt.com/dynamic-mcp?platform=chatgpt#videos
- Cursor setup guide: https://www.agentpmt.com/dynamic-mcp?platform=cursor#videos
- Windsurf setup guide: https://www.agentpmt.com/dynamic-mcp?platform=windsurf#videos

Use the local router for command-based MCP clients. It forwards requests to `https://api.agentpmt.com/mcp` and does not execute tools locally.

```bash
npm install -g @agentpmt/mcp-router
agentpmt-setup
```

### REST API

The live page renders cURL, Python, JavaScript, and Node.js examples. Logged-in users see those examples prefilled with their own API and budget credentials.

- Purchase endpoint: https://api.agentpmt.com/products/purchase
- Authorization format: `Bearer <base64(apiKey:budgetKey)>`

```bash
curl -X POST "https://api.agentpmt.com/products/purchase" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eW91ci1hcGkta2V5LWhlcmU6eW91ci1idWRnZXQta2V5LWhlcmU=" \
  -d '{
    "product_id": "6962fd6f4cf4309309cac7b0",
    "parameters": {
      "action": "create_document",
      "title": "example_title"
    }
  }'
```

### Autonomous Agents

Autonomous agents can access this tool through AgentAddress credit balances or direct x402 payments. Use the Autonomous Agent API reference for endpoint shapes after choosing the access pattern below.

- Autonomous Agent API reference URL: https://www.agentpmt.com/docs/api-reference/autonomous-agents
- Autonomous Agent API reference markdown URL: https://www.agentpmt.com/docs/api-reference/autonomous-agents?format=agent-md
- Credit-Based Access Using AgentAddress: https://www.agentpmt.com/docs/autonomous-agents/credit-based-tool-usage-with-agentaddress
- AgentAddress is preferred for persistent file access, stored platform state, and maximum tool use ability across repeated calls.
- Direct x402 is for independent one-off tool calls that do not require shared files or stored platform state.
- Direct x402 public payments: USDC on Base, Arbitrum, Optimism, Polygon, and Avalanche.

### Schema

#### Credentials

These runtime credentials should be provided under `parameters._credentials` when required.

- Google OAuth (`google_oauth`, oauth_token, required)
  Help: Connect your Google account.
  Connection ID: 69616abea90ed54743f01957

#### Parameters

- Schema type: actions

```json
{
  "actions": {
    "create_document": {
      "description": "Create a new Google Doc.",
      "properties": {
        "title": {
          "type": "string",
          "description": "Document title.",
          "required": true
        },
        "text": {
          "type": "string",
          "description": "Initial body content for the document.",
          "required": false
        }
      }
    },
    "get_document": {
      "description": "Retrieve a document's full content, text, word count, and structure.",
      "properties": {
        "document_id": {
          "type": "string",
          "description": "Google Docs document ID (from the document URL).",
          "required": true
        }
      }
    },
    "search_documents": {
      "description": "Search for Google Docs by name. Returns documents sorted by most recently modified. Omit query to list recent documents.",
      "properties": {
        "query": {
          "type": "string",
          "description": "Search term that matches document names (contains match).",
          "required": false
        },
        "max_results": {
          "type": "integer",
          "description": "Maximum results to return (1-100).",
          "required": false,
          "default": 20,
          "minimum": 1,
          "maximum": 100
        }
      }
    },
    "batch_update": {
      "description": "Execute raw Google Docs API batch update requests for advanced operations not covered by other actions.",
      "properties": {
        "document_id": {
          "type": "string",
          "description": "Google Docs document ID.",
          "required": true
        },
        "requests": {
          "type": "array",
          "description": "Array of raw Google Docs API request objects.",
          "required": true,
          "items": {
            "type": "object"
          }
        }
      }
    },
    "insert_text": {
      "description": "Insert text at a specific character position in a document.",
      "properties": {
        "document_id": {
          "type": "string",
          "description": "Google Docs document ID.",
          "required": true
        },
        "text": {
          "type": "string",
          "description": "Text content to insert.",
          "required": true
        },
        "location": {
          "type": "integer",
          "description": "1-based character index for insertion. Defaults to 1 (beginning of document).",
          "required": false,
          "minimum": 1
        }
      }
    },
    "replace_text": {
      "description": "Find and replace all occurrences of text in a document.",
      "properties": {
        "document_id": {
          "type": "string",
          "description": "Google Docs document ID.",
          "required": true
        },
        "search_text": {
          "type": "string",
          "description": "Text to search for.",
          "required": true
        },
        "replace_with": {
          "type": "string",
          "description": "Replacement text.",
          "required": true
        },
        "match_case": {
          "type": "boolean",
          "description": "Whether to use case-sensitive search.",
          "required": false,
          "default": false
        }
      }
    },
    "format_text": {
      "description": "Apply text and/or paragraph styling to a character range in a document.",
      "properties": {
        "document_id": {
          "type": "string",
          "description": "Google Docs document ID.",
          "required": true
        },
        "range_start": {
          "type": "integer",
          "description": "Start index of the range to format (1-based).",
          "required": true,
          "minimum": 1
        },
        "range_end": {
          "type": "integer",
          "description": "End index of the range to format (1-based).",
          "required": true,
          "minimum": 1
        },
        "text_style": {
          "type": "object",
          "description": "Text styling options.",
          "required": true,
          "properties": {
            "bold": {
              "type": "boolean",
              "description": "Apply bold formatting.",
              "required": false
            },
            "italic": {
              "type": "boolean",
              "description": "Apply italic formatting.",
              "required": false
            },
            "underline": {
              "type": "boolean",
              "description": "Apply underline formatting.",
              "required": false
            },
            "strikethrough": {
              "type": "boolean",
              "description": "Apply strikethrough formatting.",
              "required": false
            },
            "font_family": {
              "type": "string",
              "description": "Font family name (e.g., 'Arial', 'Times New Roman').",
              "required": false
            },
            "font_size": {
              "type": "object",
              "description": "Font size with magnitude and unit.",
              "required": false,
              "properties": {
                "magnitude": {
                  "type": "number",
                  "description": "Size value.",
                  "required": true
                },
                "unit": {
                  "type": "string",
                  "description": "Size unit (typically 'PT').",
                  "required": true
                }
              }
            },
            "foreground_color": {
              "type": "object",
              "description": "Text color as RGB values (0-1).",
              "required": false
            },
            "background_color": {
              "type": "object",
              "description": "Text highlight color as RGB values (0-1).",
              "required": false
            },
            "link": {
              "type": "string",
              "description": "URL to create a hyperlink.",
              "required": false
            }
          }
        },
        "paragraph_style": {
          "type": "object",
          "description": "Paragraph styling options.",
          "required": false,
          "properties": {
            "alignment": {
              "type": "string",
              "description": "Text alignment.",
              "required": false,
              "enum": [
                "START",
                "CENTER",
                "END",
                "JUSTIFIED"
              ]
            },
            "line_spacing": {
              "type": "number",
              "description": "Line spacing (100=single, 150=1.5x, 200=double).",
              "required": false
            },
            "indent_start": {
              "type": "object",
              "description": "Left indent with magnitude and unit.",
              "required": false
            },
            "indent_end": {
              "type": "object",
              "description": "Right indent with magnitude and unit.",
              "required": false
            },
            "indent_first_line": {
              "type": "object",
              "description": "First line indent with magnitude and unit.",
              "required": false
            }
          }
        }
      }
    },
    "insert_image": {
      "description": "Insert an inline image from a publicly accessible URL.",
      "properties": {
        "document_id": {
          "type": "string",
          "description": "Google Docs document ID.",
          "required": true
        },
        "image_url": {
          "type": "string",
          "description": "Publicly accessible URL of the image to insert.",
          "required": true
        },
        "location": {
          "type": "integer",
          "description": "1-based character index for insertion. Defaults to 1.",
          "required": false,
          "minimum": 1
        },
        "width": {
          "type": "integer",
          "description": "Image width in pixels.",
          "required": false,
          "minimum": 1
        },
        "height": {
          "type": "integer",
          "description": "Image height in pixels.",
          "required": false,
          "minimum": 1
        }
      }
    },
    "create_table": {
      "description": "Insert a table into a document, optionally populated with data. If table_data is provided, dimensions are inferred from it.",
      "properties": {
        "document_id": {
          "type": "string",
          "description": "Google Docs document ID.",
          "required": true
        },
        "rows": {
          "type": "integer",
          "description": "Number of table rows (1-100). Not needed if table_data is provided.",
          "required": false,
          "minimum": 1,
          "maximum": 100
        },
        "columns": {
          "type": "integer",
          "description": "Number of table columns (1-20). Not needed if table_data is provided.",
          "required": false,
          "minimum": 1,
          "maximum": 20
        },
        "table_data": {
          "type": "array",
          "description": "2D array of strings representing table cell data.",
          "required": false,
          "items": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "location": {
          "type": "integer",
          "description": "1-based character index for table insertion. Defaults to 1.",
          "required": false,
          "minimum": 1
        }
      }
    },
    "insert_page_break": {
      "description": "Insert a page break at a specific position.",
      "properties": {
        "document_id": {
          "type": "string",
          "description": "Google Docs document ID.",
          "required": true
        },
        "location": {
          "type": "integer",
          "description": "1-based character index for the page break. Defaults to 1.",
          "required": false,
          "minimum": 1
        }
      }
    },
    "insert_section_break": {
      "description": "Insert a section break at a specific position.",
      "properties": {
        "document_id": {
          "type": "string",
          "description": "Google Docs document ID.",
          "required": true
        },
        "location": {
          "type": "integer",
          "description": "1-based character index for the section break. Defaults to 1.",
          "required": false,
          "minimum": 1
        }
      }
    },
    "create_header": {
      "description": "Add a header to the document.",
      "properties": {
        "document_id": {
          "type": "string",
          "description": "Google Docs document ID.",
          "required": true
        },
        "header_type": {
          "type": "string",
          "description": "Header type to create.",
          "required": false,
          "default": "DEFAULT",
          "enum": [
            "DEFAULT",
            "FIRST_PAGE",
            "EVEN_PAGE",
            "ODD_PAGE"
          ]
        },
        "text": {
          "type": "string",
          "description": "Header text content.",
          "required": false
        }
      }
    },
    "create_footer": {
      "description": "Add a footer to the document.",
      "properties": {
        "document_id": {
          "type": "string",
          "description": "Google Docs document ID.",
          "required": true
        },
        "footer_type": {
          "type": "string",
          "description": "Footer type to create.",
          "required": false,
          "default": "DEFAULT",
          "enum": [
            "DEFAULT",
            "FIRST_PAGE",
            "EVEN_PAGE",
            "ODD_PAGE"
          ]
        }
      }
    },
    "update_style": {
      "description": "Alias for format_text. Apply text and/or paragraph styling to a character range.",
      "properties": {
        "document_id": {
          "type": "string",
          "description": "Google Docs document ID.",
          "required": true
        },
        "range_start": {
          "type": "integer",
          "description": "Start index of the range to format (1-based).",
          "required": true,
          "minimum": 1
        },
        "range_end": {
          "type": "integer",
          "description": "End index of the range to format (1-based).",
          "required": true,
          "minimum": 1
        },
        "text_style": {
          "type": "object",
          "description": "Text styling options (bold, italic, underline, strikethrough, font_family, font_size, foreground_color, background_color, link).",
          "required": true
        },
        "paragraph_style": {
          "type": "object",
          "description": "Paragraph styling options (alignment, line_spacing, indents).",
          "required": false
        }
      }
    },
    "create_named_range": {
      "description": "Create a named range (bookmark) spanning a character range in the document.",
      "properties": {
        "document_id": {
          "type": "string",
          "description": "Google Docs document ID.",
          "required": true
        },
        "range_name": {
          "type": "string",
          "description": "Name for the named range/bookmark.",
          "required": true
        },
        "range_start": {
          "type": "integer",
          "description": "Start index of the range (1-based).",
          "required": true,
          "minimum": 1
        },
        "range_end": {
          "type": "integer",
          "description": "End index of the range (1-based).",
          "required": true,
          "minimum": 1
        }
      }
    },
    "export_document": {
      "description": "Export a document to another format. Text formats (txt, html) return content directly; binary formats return base64-encoded content.",
      "properties": {
        "document_id": {
          "type": "string",
          "description": "Google Docs document ID.",
          "required": true
        },
        "export_format": {
          "type": "string",
          "description": "Target export format.",
          "required": true,
          "enum": [
            "pdf",
            "docx",
            "odt",
            "rtf",
            "txt",
            "html",
            "epub",
            "zip"
          ]
        }
      }
    },
    "share_document": {
      "description": "Set sharing permissions on a document via Google Drive.",
      "properties": {
        "document_id": {
          "type": "string",
          "description": "Google Docs document ID.",
          "required": true
        },
        "share_with": {
          "type": "array",
          "description": "List of permission objects defining who to share with.",
          "required": true,
          "items": {
            "type": "object",
            "properties": {
              "email": {
                "type": "string",
                "description": "Email address (for user or group permissions).",
                "required": false
              },
              "role": {
                "type": "string",
                "description": "Permission level.",
                "required": true,
                "enum": [
                  "reader",
                  "writer",
                  "commenter"
                ]
              },
              "permission_type": {
                "type": "string",
                "description": "Permission type.",
                "required": true,
                "enum": [
                  "user",
                  "group",
                  "domain",
                  "anyone"
                ]
              },
              "domain": {
                "type": "string",
                "description": "Domain for domain-wide sharing.",
                "required": false
              }
            }
          }
        },
        "send_notification": {
          "type": "boolean",
          "description": "Send email notification when sharing.",
          "required": false,
          "default": true
        },
        "email_message": {
          "type": "string",
          "description": "Custom message for the sharing notification email.",
          "required": false
        }
      }
    },
    "get_permissions": {
      "description": "List the current sharing permissions on a document.",
      "properties": {
        "document_id": {
          "type": "string",
          "description": "Google Docs document ID.",
          "required": true
        }
      }
    },
    "quick_create": {
      "description": "Create a document from a natural language description. If the text contains 'titled \"...\"' or 'called \"...\"', the title is extracted automatically.",
      "properties": {
        "text": {
          "type": "string",
          "description": "Natural language description or content for the document.",
          "required": true
        },
        "title": {
          "type": "string",
          "description": "Document title. If omitted, may be extracted from the text description.",
          "required": false
        }
      }
    }
  },
  "properties": {
    "action": {
      "type": "string",
      "description": "Action to perform on Google Docs",
      "required": true,
      "enum": [
        "get_instructions",
        "create_document",
        "get_document",
        "search_documents",
        "batch_update",
        "insert_text",
        "replace_text",
        "format_text",
        "insert_image",
        "create_table",
        "insert_page_break",
        "insert_section_break",
        "create_header",
        "create_footer",
        "update_style",
        "create_named_range",
        "export_document",
        "share_document",
        "get_permissions",
        "quick_create"
      ]
    },
    "document_id": {
      "type": "string",
      "description": "Google Docs document ID (found in the document URL)",
      "required": false
    },
    "title": {
      "type": "string",
      "description": "Document title for creation",
      "required": false
    },
    "query": {
      "type": "string",
      "description": "Search query for search_documents. Matches against document name (contains match).",
      "required": false
    },
    "max_results": {
      "type": "integer",
      "description": "Maximum results for search_documents (1-100, default 20)",
      "default": 20,
      "minimum": 1,
      "maximum": 100,
      "required": false
    },
    "text": {
      "type": "string",
      "description": "Text content for operations (insertion, initial content, or natural language description for quick_create)",
      "required": false
    },
    "location": {
      "type": "integer",
      "description": "Character index for insertions (1-based, defaults to beginning of document)",
      "minimum": 1,
      "required": false
    },
    "range_start": {
      "type": "integer",
      "description": "Start index of range for formatting or named ranges",
      "minimum": 1,
      "required": false
    },
    "range_end": {
      "type": "integer",
      "description": "End index of range for formatting or named ranges",
      "minimum": 1,
      "required": false
    },
    "search_text": {
      "type": "string",
      "description": "Text to search for in replace operations",
      "required": false
    },
    "replace_with": {
      "type": "string",
      "description": "Replacement text for replace operations",
      "required": false
    },
    "match_case": {
      "type": "boolean",
      "description": "Whether to use case-sensitive search in replace operations",
      "default": false,
      "required": false
    },
    "requests": {
      "type": "array",
      "description": "Array of raw Google Docs API batch update requests for advanced operations",
      "items": {
        "type": "object"
      },
      "required": false
    },
    "text_style": {
      "type": "object",
      "description": "Text styling options: bold, italic, underline, strikethrough, font_family, font_size (with magnitude and unit), foreground_color, background_color, link",
      "required": false
    },
    "paragraph_style": {
      "type": "object",
      "description": "Paragraph styling: alignment (START/CENTER/END/JUSTIFIED), line_spacing (100=single, 150=1.5x, 200=double), indent_start, indent_end, indent_first_line",
      "required": false
    },
    "rows": {
      "type": "integer",
      "description": "Number of rows for table creation",
      "minimum": 1,
      "maximum": 100,
      "required": false
    },
    "columns": {
      "type": "integer",
      "description": "Number of columns for table creation",
      "minimum": 1,
      "maximum": 20,
      "required": false
    },
    "table_data": {
      "type": "array",
      "description": "2D array of strings representing table cell data",
      "items": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "required": false
    },
    "image_url": {
      "type": "string",
      "description": "URL of image to insert (must be publicly accessible)",
      "required": false
    },
    "width": {
      "type": "integer",
      "description": "Image width in pixels",
      "minimum": 1,
      "required": false
    },
    "height": {
      "type": "integer",
      "description": "Image height in pixels",
      "minimum": 1,
      "required": false
    },
    "header_type": {
      "type": "string",
      "description": "Header type to create",
      "default": "DEFAULT",
      "enum": [
        "DEFAULT",
        "FIRST_PAGE",
        "EVEN_PAGE",
        "ODD_PAGE"
      ],
      "required": false
    },
    "footer_type": {
      "type": "string",
      "description": "Footer type to create",
      "default": "DEFAULT",
      "enum": [
        "DEFAULT",
        "FIRST_PAGE",
        "EVEN_PAGE",
        "ODD_PAGE"
      ],
      "required": false
    },
    "range_name": {
      "type": "string",
      "description": "Name for the named range/bookmark",
      "required": false
    },
    "export_format": {
      "type": "string",
      "description": "Export format for document",
      "enum": [
        "pdf",
        "docx",
        "odt",
        "rtf",
        "txt",
        "html",
        "epub",
        "zip"
      ],
      "required": false
    },
    "share_with": {
      "type": "array",
      "description": "List of permission objects. Each has: email (string), role (reader/writer/commenter), permission_type (user/group/domain/anyone), domain (optional).",
      "items": {
        "type": "object"
      },
      "required": false
    },
    "send_notification": {
      "type": "boolean",
      "description": "Send email notification when sharing",
      "default": true,
      "required": false
    },
    "email_message": {
      "type": "string",
      "description": "Custom message for sharing notification email",
      "required": false
    }
  }
}
```

### Usage Instructions

# Google Docs Connector

Create, edit, format, and share Google Docs programmatically. Search for documents, insert text and images, build tables, apply formatting, export to multiple formats, and manage sharing permissions.

## Actions

### create_document
Create a new Google Doc.

**Required:** `title`
**Optional:** `text` (initial body content)

```json
{"action": "create_document", "title": "Meeting Notes", "text": "Agenda:\n1. Review\n2. Planning"}
```

### get_document
Retrieve a document's full content, text, word count, and structure.

**Required:** `document_id`

```json
{"action": "get_document", "document_id": "1a2b3c4d5e"}
```

### search_documents
Search for Google Docs by name. Returns documents sorted by most recently modified. Omit `query` to list recent documents.

**Optional:** `query` (name contains match), `max_results` (1-100, default 20)

```json
{"action": "search_documents", "query": "Q1 report", "max_results": 5}
```

### insert_text
Insert text at a specific character position in a document.

**Required:** `document_id`, `text`
**Optional:** `location` (1-based character index; default: 1)

```json
{"action": "insert_text", "document_id": "1a2b3c4d5e", "text": "New paragraph\n", "location": 1}
```

### replace_text
Find and replace all occurrences of text in a document.

**Required:** `document_id`, `search_text`, `replace_with`
**Optional:** `match_case` (default: false)

```json
{"action": "replace_text", "document_id": "1a2b3c4d5e", "search_text": "draft", "replace_with": "final", "match_case": true}
```

### format_text
Apply text and/or paragraph styling to a character range.

**Required:** `document_id`, `range_start`, `range_end`, `text_style`
**Optional:** `paragraph_style`

`text_style` options: `bold`, `italic`, `underline`, `strikethrough` (booleans), `font_family` (string), `font_size` (object with `magnitude` and `unit`), `foreground_color`, `background_color` (RGB objects with values 0-1), `link` (URL string)

`paragraph_style` options: `alignment` (START, CENTER, END, JUSTIFIED), `line_spacing` (100=single, 150=1.5x, 200=double), `indent_start`, `indent_end`, `indent_first_line` (objects with `magnitude` and `unit`)

```json
{"action": "format_text", "document_id": "1a2b3c4d5e", "range_start": 1, "range_end": 15, "text_style": {"bold": true, "font_size": {"magnitude": 18, "unit": "PT"}}, "paragraph_style": {"alignment": "CENTER"}}
```

### update_style
Alias for `format_text`. Accepts the same parameters.

```json
{"action": "update_style", "document_id": "1a2b3c4d5e", "range_start": 1, "range_end": 10, "text_style": {"italic": true}}
```

### insert_image
Insert an inline image from a publicly accessible URL.

**Required:** `document_id`, `image_url`
**Optional:** `location` (1-based index; default: 1), `width` (pixels), `height` (pixels)

```json
{"action": "insert_image", "document_id": "1a2b3c4d5e", "image_url": "https://example.com/logo.png", "width": 200, "height": 100, "location": 1}
```

### create_table
Insert a table into a document. If `table_data` is provided, dimensions are inferred from it and cells are populated.

**Required:** `document_id`
**Optional:** `rows` (1-100), `columns` (1-20), `table_data` (2D array of strings), `location` (1-based index; default: 1)

```json
{"action": "create_table", "document_id": "1a2b3c4d5e", "table_data": [["Name", "Role"], ["Alice", "Engineer"], ["Bob", "Designer"]]}
```

```json
{"action": "create_table", "document_id": "1a2b3c4d5e", "rows": 3, "columns": 4, "location": 1}
```

### insert_page_break
Insert a page break at a specific position.

**Required:** `document_id`
**Optional:** `location` (1-based index; default: 1)

```json
{"action": "insert_page_break", "document_id": "1a2b3c4d5e", "location": 50}
```

### insert_section_break
Insert a section break at a specific position.

**Required:** `document_id`
**Optional:** `location` (1-based index; default: 1)

```json
{"action": "insert_section_break", "document_id": "1a2b3c4d5e", "location": 100}
```

### create_header
Add a header to the document.

**Required:** `document_id`
**Optional:** `header_type` (DEFAULT, FIRST_PAGE, EVEN_PAGE, ODD_PAGE; default: DEFAULT), `text` (header content)

```json
{"action": "create_header", "document_id": "1a2b3c4d5e", "header_type": "DEFAULT", "text": "Company Report"}
```

### create_footer
Add a footer to the document.

**Required:** `document_id`
**Optional:** `footer_type` (DEFAULT, FIRST_PAGE, EVEN_PAGE, ODD_PAGE; default: DEFAULT)

```json
{"action": "create_footer", "document_id": "1a2b3c4d5e", "footer_type": "DEFAULT"}
```

### create_named_range
Create a named range (bookmark) spanning a character range in the document.

**Required:** `document_id`, `range_name`, `range_start`, `range_end`

```json
{"action": "create_named_range", "document_id": "1a2b3c4d5e", "range_name": "introduction", "range_start": 1, "range_end": 50}
```

### export_document
Export a document to another format. Text formats (txt, html) return content directly; binary formats (pdf, docx, etc.) return base64-encoded content.

**Required:** `document_id`, `export_format`

Supported formats: `pdf`, `docx`, `odt`, `rtf`, `txt`, `html`, `epub`, `zip`

```json
{"action": "export_document", "document_id": "1a2b3c4d5e", "export_format": "pdf"}
```

### share_document
Set sharing permissions on a document.

**Required:** `document_id`, `share_with` (array of permission objects)

Each permission object: `email` (for user/group), `role` (reader, writer, commenter), `type` (user, group, domain, anyone), `domain` (for domain-wide sharing)

**Optional:** `send_notification` (default: true), `email_message` (custom notification text)

```json
{"action": "share_document", "document_id": "1a2b3c4d5e", "share_with": [{"email": "colleague@example.com", "role": "writer", "type": "user"}], "send_notification": true, "email_message": "Please review this document."}
```

### get_permissions
List the current sharing permissions on a document.

**Required:** `document_id`

```json
{"action": "get_permissions", "document_id": "1a2b3c4d5e"}
```

### batch_update
Execute raw Google Docs API batch update requests for advanced operations not covered by other actions.

**Required:** `document_id`, `requests` (array of Google Docs API request objects)

```json
{"action": "batch_update", "document_id": "1a2b3c4d5e", "requests": [{"insertText": {"location": {"index": 1}, "text": "Hello World\n"}}]}
```

### quick_create
Create a document from a natural language description. If the description contains a phrase like `titled "..."` or `called "..."`, the title is extracted automatically.

**Required:** `text` (description or content)
**Optional:** `title`

```json
{"action": "quick_create", "text": "Create a project plan titled \"Q2 Launch Plan\" with sections for goals, timeline, and team assignments."}
```

## Common Workflows

**Create and populate a document:**
1. `create_document` with title and initial text
2. `insert_text` to add more content at specific positions
3. `format_text` to style headings, bold key terms, etc.
4. `share_document` to distribute

**Build a report with a table:**
1. `create_document` with the report title
2. `insert_text` for the report body
3. `create_table` with `table_data` for structured data
4. `export_document` as PDF for distribution

**Find and update a document:**
1. `search_documents` to locate the document by name
2. `get_document` to read current content
3. `replace_text` or `insert_text` to make changes
4. `format_text` to adjust styling

## Important Notes
- The `document_id` is the alphanumeric string found in the Google Docs URL between `/d/` and `/edit`.
- Character indices are 1-based. Use `get_document` to inspect the document structure and find the correct indices for insertions and formatting.
- When using `format_text`, you must provide at least `text_style`. The `paragraph_style` is optional and applied to the same range.
- The `update_style` action is identical to `format_text`.
- For `create_table` with `table_data`, the number of rows and columns is inferred from the data array. You do not need to specify `rows` or `columns` separately.
- Export formats `txt` and `html` return plain text content. All other formats return base64-encoded binary data.
- Sharing uses Google Drive permissions. The `anyone` type makes the document publicly accessible with the specified role.

### Frequently Asked Questions

#### How do I connect this tool to an external agent?

- Page URL: https://www.agentpmt.com/faq
- Markdown URL: https://www.agentpmt.com/faq?format=agent-md

You can install the local MCP server by opening a terminal and running:

```
npm install -g @agentpmt/mcp-router
agentpmt-setup
```

This will connect you to local agents like Claude Code, Windsurf, Grok Build, Cursor, etc.

Alternatively you can connect to the hosted version with this config block, no installation required:

```
{
  "mcpServers": {
    "agentpmt": {
      "type": "streamable-http",
      "url": "https://api.agentpmt.com/mcp",
      "headers": {
        "Authorization": "Bearer <AGENTPMT_BEARER_TOKEN>",
        "x-instance-metadata": "{\"client\":\"generic-mcp\",\"platform\":\"remote\"}"
      }
    }
  }
}
```

[View MCP Connection Instructions](/docs/mcp-reference/connection) for more details.

#### How does an external agent use this tool?

- Page URL: https://www.agentpmt.com/faq
- Markdown URL: https://www.agentpmt.com/faq?format=agent-md

After the external agent is connected to an Agent Group that can use this tool, paste this prompt into the agent:

> Call the AgentPMT-Tool-Search-and-Execution tool with action 'get\_schema' and tool\_id 6962fd6f4cf4309309cac7b0 ("Google Docs Connector"). Then call the same tool with action 'call\_tool', tool\_id 6962fd6f4cf4309309cac7b0, and the parameters needed for my request.

The agent should fetch the tool schema first, collect the required parameters for your request, and then call the tool through AgentPMT.

### Dependencies

This product has no public dependency products.