Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
LOG_LEVELNoLogging level: error, warn, info or debug. Logs go to stderr, and secrets are always redacted.info
GOOGLE_CLIENT_IDYesOAuth client ID of your Desktop app client.
GOOGLE_TOKEN_PATHNoWhere OAuth tokens are stored. ~ is expanded, and relative paths resolve against the working directory, so prefer absolute paths.~/.config/google-docs-mcp/tokens.json
GOOGLE_DRIVE_SCOPENoDrive permission level. drive gives full Drive access and is needed to list, search, copy and trash all your existing Docs. drive.file is least privilege: Drive operations only see files created or opened by this app.drive
GOOGLE_REDIRECT_URINoLoopback address where the one-time sign-in redirect is received. It must be http:// on 127.0.0.1, localhost or [::1], with an explicit port.http://127.0.0.1:53682/oauth2callback
GOOGLE_CLIENT_SECRETYesOAuth client secret of that client.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
prompts
{
  "listChanged": true
}
resources
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
get_auth_statusA

Check whether this server is signed in to Google and holds the permissions required for Google Docs and Google Drive. Use it when another tool fails with NOT_AUTHENTICATED or AUTH_EXPIRED, or after the user finishes signing in via authenticate. Never returns tokens.

authenticateA

Start the Google OAuth sign-in. Returns an authUrl that the user must open in a browser on the computer running this server to approve access to Google Docs and Drive; the server receives the result automatically on a local loopback address. Show the URL to the user, wait for them to confirm they approved access, then call get_auth_status. If already signed in, nothing happens unless force is true.

sign_outA

Sign out: revoke this server’s Google access and delete the locally stored OAuth tokens. After this, every Google Docs tool fails until authenticate is called again. Only use it when the user explicitly asks to sign out or switch accounts.

create_documentA

Create a new, empty Google Docs document with the given title in the user’s Google Drive. Returns the new documentId, title and URL. To add content afterwards use append_text.

get_documentA

Read a Google Doc: returns its title, URL, plain-text content and (by default) a structure outline listing every top-level paragraph and table with exact startIndex/endIndex, heading style and alignment. Also returns bodyEndIndex (valid insertion indexes are 1..bodyEndIndex-1). Use this before index-based edits such as insert_text, delete_text or format_text. Long documents are truncated to maxTextLength characters.

list_documentsA

List Google Docs the user can access in Google Drive, most recently modified first. Optionally filter by text contained in the document name (search). Returns documentId, name, URL, createdTime and modifiedTime, plus nextPageToken for pagination. To search inside document content use search_documents.

delete_documentA

Delete a Google Doc by moving it to the user’s Google Drive trash. It is NOT permanently deleted and can be restored from the Drive trash for 30 days. Only Google Docs files are accepted. Only call this when the user clearly asked to delete this specific document; if it is ambiguous which document is meant, ask the user first.

copy_documentA

Create a copy of an existing Google Doc with a new title (content and formatting are copied). Returns the new document’s ID and URL. Useful for templates or making a backup before large edits.

append_textA

Append text to the end of a Google Doc’s body. No indexes are needed, so prefer this over insert_text whenever content should go at the end. By default the text starts in a new paragraph (a paragraph break is added first if the last paragraph is not empty); set startNewParagraph=false to continue the last paragraph instead. Use "\n" inside text to create further paragraphs. Returns insertedLength and the index range of the appended text (textStartIndex/textEndIndex), which can be passed to format_text or set_paragraph_style. Carriage returns become "\n" and control characters Google Docs cannot store are removed.

insert_textA

Insert text at a specific index of a Google Doc. Get the index from get_document (the structure outline’s startIndex/endIndex) or find_text; the body starts at index 1 and the largest valid index is bodyEndIndex-1. To insert at the start of a paragraph use its startIndex. The inserted text takes the style of the neighbouring text, and "\n" creates new paragraphs. Inserting shifts every later index by insertedLength, so when making several index-based edits work from the end of the document backwards or re-read it with get_document. To add text at the end use append_text; to change existing wording use replace_text.

replace_textA

Replace ALL occurrences of searchText throughout the entire Google Doc with replacementText, in one operation. An empty replacementText DELETES every occurrence. Matching is plain text (no regular expressions) and case-insensitive unless matchCase is true, so a short search such as "an" may also match inside other words. If the search text is short or could match more than intended, preview the matches with find_text first, and use insert_text/delete_text for a single occurrence. Returns occurrencesChanged (0 means nothing matched and the document is unchanged). Indexes after each changed occurrence shift when the lengths differ. No index is needed.

delete_textA

DESTRUCTIVE: delete the content in the index range [startIndex, endIndex) of a Google Doc (endIndex is exclusive). Get the indexes from get_document or find_text immediately before calling. Strongly recommended: pass expectedText with the exact text currently in that range (including any "\n" paragraph breaks); if it does not match, nothing is deleted and the current text is returned, which protects against stale indexes. The document’s final newline cannot be deleted (the maximum endIndex is bodyEndIndex-1). Deleting a paragraph break merges the two paragraphs; tables can only be deleted as a whole, although the text inside a cell can be deleted. Every later index shifts back by deletedLength. Deleted content can only be recovered from the Google Docs version history. To delete every occurrence of a phrase use replace_text with an empty replacementText.

format_textA

Apply character formatting to the text in the index range [startIndex, endIndex) of a Google Doc (endIndex is exclusive): bold, italic, underline, strikethrough, fontSize (points), fontFamily (e.g. "Arial", "Roboto") and foregroundColor/backgroundColor (hex such as #1A73E8). Only the properties you pass are changed; all other formatting is kept. Pass false to remove bold, italic, underline or strikethrough. At least one property is required. Get indexes from get_document or find_text (append_text and insert_text also return the range of the new text). Does not change text or indexes.

set_paragraph_styleA

Set the named paragraph style — NORMAL_TEXT, TITLE, SUBTITLE or HEADING_1 to HEADING_6 — of every paragraph that overlaps the index range [startIndex, endIndex). Whole paragraphs are restyled even if the range covers only part of one, so a range inside a single line changes just that line’s paragraph. Use it to turn a line into a heading or back into normal text. Get paragraph startIndex/endIndex from get_document’s structure outline or find_text. Does not change text or indexes.

set_alignmentA

Set the horizontal alignment of every paragraph that overlaps the index range [startIndex, endIndex): START (left in left-to-right text), CENTER, END (right in left-to-right text) or JUSTIFIED. Whole paragraphs are aligned even if the range covers only part of one. Get paragraph indexes from get_document’s structure outline or find_text. Does not change text or indexes.

insert_page_breakA

Insert a page break at an index of a Google Doc, so the content after it starts on a new page. The index must be inside an existing body paragraph (not inside a table, header, footer or footnote); to break before a paragraph use its startIndex from get_document or find_text. Inserting shifts every later index, so re-read the document with get_document before further index-based edits.

insert_tableA

Insert an empty table with the given number of rows and columns at an index of a Google Doc. Google inserts a paragraph break before the table, so the table starts at index + 1 (returned as tableStartIndex). The index must be inside an existing paragraph — not at a table’s start and not inside a footnote; to add a table at the end use bodyEndIndex-1 from get_document. Every cell starts with an empty paragraph: call get_document afterwards to get exact cell indexes, then fill cells with insert_text starting from the LAST cell so earlier indexes stay valid. Inserting shifts every later index.

insert_linkA

Turn the existing text in the index range [startIndex, endIndex) of a Google Doc into a hyperlink to url (http, https and mailto links only). The text itself is not changed and any link already on it is replaced. To link new text, first add it with insert_text or append_text (both return the new text’s range), then link that range. Get indexes from get_document or find_text. Does not change indexes.

create_bulleted_listA

Turn every paragraph that overlaps the index range [startIndex, endIndex) of a Google Doc into a list item: listType "bulleted" (default), "numbered" (1., a., i.) or "checkbox". Consecutive paragraphs become one list; to build a list from new content, append or insert the items as separate lines ("\n"-separated) first, then call this with their range. Leading tab characters in the paragraphs are converted into nesting levels and removed, which shifts later indexes; otherwise indexes are unchanged. Get paragraph indexes from get_document’s structure outline.

search_documentsA

Search the user’s Google Drive for Google Docs by name and/or content. Only Google Docs the user can access and that are not in the trash are returned (other file types are never included).

  • searchIn "name": case-insensitive match on the document name. Drive matches words that start with the query ("Prop" finds "FYP Proposal"), so a fragment from the middle of a word may not match. Results sorted by most recently modified.

  • searchIn "content": Google Drive full-text search of document content. It is word/prefix based (not exact substring or phrase matching), also matches document names, and may lag behind very recent edits because Drive indexes content asynchronously. Results are ordered by relevance.

  • searchIn "both" (default): name OR full-text match, ordered by relevance. Returns documentId, name, URL, createdTime and modifiedTime for each match, plus nextPageToken for pagination. To locate text inside one specific document use find_text; to list recent documents use list_documents.

find_textA

Find every occurrence of a literal phrase in a Google Doc (including text inside table cells) and return the exact startIndex/endIndex of each match, its paragraph style, whether it is in a table, and a short context snippet. Use this to get exact indexes for index-based tools such as format_text, delete_text, insert_link or insert_text. Matching is literal (no wildcards or regular expressions), case-insensitive unless matchCase is true, and a match cannot span paragraphs or include the paragraph’s line break. Indexes are only valid until the document is edited: when applying several edits, work from the last occurrence backwards.

Prompts

Interactive templates invoked by user choice

NameDescription
summarize_documentRead a Google Doc and summarize it in the chat (the document is not modified). Optionally focus on a specific aspect.
rewrite_documentRewrite or edit a Google Doc in place according to instructions, preserving everything the instructions do not ask to change.
format_documentImprove the formatting of a Google Doc (headings, lists, emphasis, alignment) without changing its wording. Optionally follow a style guide.
create_meeting_notesCreate a new, well-structured Google Doc with meeting notes (details, attendees, discussion, decisions, action items) from the provided information.

Resources

Contextual data attached and managed by the client

NameDescription

No resources