Skip to main content

At a glance

  • Availability: Enabled by default.
  • Auth: OAuth 2.0.
  • Connection: A user authorizes the connection in the provider’s consent screen.
  • Scopes: https://www.googleapis.com/auth/documents.readonly, https://www.googleapis.com/auth/documents, https://www.googleapis.com/auth/docs, https://www.googleapis.com/auth/drive.readonly.

Credentials

Set these per environment. See Connect an integration. With a managed OAuth app, Connect works without these variables; set them to use your own OAuth app instead.
VariableRequiredDescription
GOOGLE_CLIENT_IDYesGoogle OAuth Client ID Docs.
GOOGLE_CLIENT_SECRETYesGoogle OAuth Client Secret Docs.

Setup

Google Docs Integration Setup ## Prerequisites - A Google Cloud Platform account - A Google Cloud project ## Step 1: Create OAuth 2.0 Credentials 1. Go to the Google Cloud Console 2. Select or create a project 3. Navigate to APIs & Services > Credentials 4. Click Create Credentials > OAuth client ID 5. Select Web application as the application type 6. Add your authorized redirect URIs: - For development: http://localhost:3000/api/auth/docs-google/callback - For production: https://yourdomain.com/api/auth/docs-google/callback 7. Click Create and copy your Client ID and Client Secret ## Step 2: Enable Required APIs Enable the following APIs in your Google Cloud project: 1. Google Docs API 2. Google Drive API ## Step 3: Configure Environment Variables Add the following to your .env file: bash GOOGLE_CLIENT_ID=your_client_id_here GOOGLE_CLIENT_SECRET=your_client_secret_here ## Step 4: Test the Integration 1. Start your development server 2. Navigate to /api/auth/docs-google to initiate OAuth flow 3. Grant permissions when prompted 4. You should be redirected back to your application ## OAuth Scopes This integration requests the following scopes: - https://www.googleapis.com/auth/documents.readonly - Read access to Google Docs - https://www.googleapis.com/auth/documents - Full access to create and edit Google Docs - https://www.googleapis.com/auth/docs - Manage Google Docs files in Drive (create, edit, delete) - https://www.googleapis.com/auth/drive.readonly - Read access to list documents from Drive ## Security Notes - Keep your Client Secret secure and never commit it to version control - Use environment variables for all sensitive credentials - Consider implementing proper user session management in production - The default implementation uses an in-memory token store - replace with a persistent store for production use ## Available AI Tools Once configured, you can use these AI tools: - list-documents - List recent Google Docs from your Drive - get-document - Retrieve document content and structure - create-document - Create new documents with formatted content - update-document - Modify existing documents with batch updates - search-documents - Search for documents by name or content ## Need Help? Refer to the Google Docs API documentation for detailed information about API capabilities and limits.

Tools

ToolAccessDescription
List DocumentsReadList recent Google Docs documents from Drive
Get DocumentReadGet document content and metadata
Create DocumentWriteCreate a new document with optional initial content
Update DocumentWriteUpdate document content using batch requests
Search DocumentsReadSearch for documents by query string

Example prompts

  • Read a Google Docs document and provide a concise summary of its contents, key points, and main themes.
  • Create a new Google Docs document with a well-formatted report including headings, bullet points, and structured content.
  • Update an existing Google Docs document with new content, formatting changes, or corrections.