Ferrule

Google Docs

16 tools OpenAPI spec ↗

MCPREST
GETget_document/documents/:documentId

Get a Google Doc by ID. Returns full document structure including body, headers, footers, lists, and styles.

Request

Path Parameters

NameTypeRequiredDescription
documentIdstringYesThe ID of the Google Doc to retrieve.

Query Parameters

NameTypeRequiredDescription
suggestionsViewModestringNoHow to render suggestions: 'DEFAULT_FOR_CURRENT_ACCESS', 'SUGGESTIONS_INLINE', 'PREVIEW_SUGGESTIONS_ACCEPTED', or 'PREVIEW_WITHOUT_SUGGESTIONS'.
includeTabsContentbooleanNoWhether to include tab content in the response (default false).

Response

documentIdobject
titleobject
revisionIdobject
bodyobject
headersobject
footersobject
footnotesobject
listsobject
inlineObjectsobject
namedRangesobject
documentStyleobject
namedStylesobject

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-docs",
      "method": "get_document"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-docs",
    "arguments": {
      "method": "get_document",
      "params": {
        "documentId": "<documentId>"
      }
    }
  }
}
GETget_document_text/documents/:documentId/text

Get the plain text content of a Google Doc. Extracts all text from paragraphs, stripping formatting.

Request

Path Parameters

NameTypeRequiredDescription
documentIdstringYesThe ID of the Google Doc to extract text from.

Response

Returns raw JSON from the upstream API. No structured schema is available.

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-docs",
      "method": "get_document_text"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-docs",
    "arguments": {
      "method": "get_document_text",
      "params": {
        "documentId": "<documentId>"
      }
    }
  }
}
POSTcreate_document/documents

Create a new empty Google Doc with the given title. Returns the created document.

Request

Query Parameters

NameTypeRequiredDescription
titlestringNoThe title for the new document.

Response

documentIdobject
titleobject
revisionIdobject
bodyobject
headersobject
footersobject
footnotesobject
listsobject
inlineObjectsobject
namedRangesobject
documentStyleobject
namedStylesobject

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-docs",
      "method": "create_document"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-docs",
    "arguments": {
      "method": "create_document",
      "params": {}
    }
  }
}
POSTinsert_text/documents/:documentId/insert-text

Insert text at a specific index in a Google Doc. Index 1 is the beginning of the document body.

Request

Path Parameters

NameTypeRequiredDescription
documentIdstringYesThe ID of the Google Doc.

Query Parameters

NameTypeRequiredDescription
textstringNoThe text to insert.
indexnumberNoThe zero-based index to insert text at.
segmentIdstringNoThe segment ID (header, footer, or footnote ID). Omit for the document body.

Response

Returns raw JSON from the upstream API. No structured schema is available.

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-docs",
      "method": "insert_text"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-docs",
    "arguments": {
      "method": "insert_text",
      "params": {
        "documentId": "<documentId>"
      }
    }
  }
}
POSTappend_text/documents/:documentId/append-text

Append text to the end of a Google Doc. Automatically determines the correct insertion index.

Request

Path Parameters

NameTypeRequiredDescription
documentIdstringYesThe ID of the Google Doc.

Query Parameters

NameTypeRequiredDescription
textstringNoThe text to append.

Response

Returns raw JSON from the upstream API. No structured schema is available.

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-docs",
      "method": "append_text"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-docs",
    "arguments": {
      "method": "append_text",
      "params": {
        "documentId": "<documentId>"
      }
    }
  }
}
POSTdelete_content/documents/:documentId/delete-content

Delete content within a range in a Google Doc. Specify start and end indices.

Request

Path Parameters

NameTypeRequiredDescription
documentIdstringYesThe ID of the Google Doc.

Query Parameters

NameTypeRequiredDescription
startIndexnumberNoThe start index of the range to delete.
endIndexnumberNoThe end index of the range to delete.
segmentIdstringNoThe segment ID (header, footer, or footnote ID). Omit for the document body.

Response

Returns raw JSON from the upstream API. No structured schema is available.

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-docs",
      "method": "delete_content"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-docs",
    "arguments": {
      "method": "delete_content",
      "params": {
        "documentId": "<documentId>"
      }
    }
  }
}
POSTreplace_all_text/documents/:documentId/replace-all-text

Find and replace all occurrences of a text string in a Google Doc.

Request

Path Parameters

NameTypeRequiredDescription
documentIdstringYesThe ID of the Google Doc.

Query Parameters

NameTypeRequiredDescription
findTextstringNoThe text to find.
replaceTextstringNoThe replacement text.
matchCasebooleanNoWhether the search is case-sensitive (default true).

Response

Returns raw JSON from the upstream API. No structured schema is available.

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-docs",
      "method": "replace_all_text"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-docs",
    "arguments": {
      "method": "replace_all_text",
      "params": {
        "documentId": "<documentId>"
      }
    }
  }
}
POSTupdate_text_style/documents/:documentId/update-text-style

Update text formatting (bold, italic, underline, font, color, etc.) for a range within a Google Doc. Only specified properties are changed; others are left unchanged.

Request

Path Parameters

NameTypeRequiredDescription
documentIdstringYesThe ID of the Google Doc.

Query Parameters

NameTypeRequiredDescription
startIndexnumberNoThe start index of the range to format.
endIndexnumberNoThe end index of the range to format.
segmentIdstringNoThe segment ID (header, footer, or footnote ID). Omit for the document body.
boldbooleanNoSet bold formatting.
italicbooleanNoSet italic formatting.
underlinebooleanNoSet underline formatting.
strikethroughbooleanNoSet strikethrough formatting.
fontSizenumberNoFont size in points (e.g. 12).
fontFamilystringNoFont family name (e.g. 'Arial', 'Times New Roman').
foregroundColorobjectNoText foreground color as RGB values (0-1 each).
linkstringNoURL to link the text to. Pass empty string to remove link.

Response

Returns raw JSON from the upstream API. No structured schema is available.

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-docs",
      "method": "update_text_style"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-docs",
    "arguments": {
      "method": "update_text_style",
      "params": {
        "documentId": "<documentId>"
      }
    }
  }
}
POSTupdate_paragraph_style/documents/:documentId/update-paragraph-style

Update paragraph formatting (alignment, spacing, indentation, named style) for a range within a Google Doc. Only specified properties are changed.

Request

Path Parameters

NameTypeRequiredDescription
documentIdstringYesThe ID of the Google Doc.

Query Parameters

NameTypeRequiredDescription
startIndexnumberNoThe start index of the range to format.
endIndexnumberNoThe end index of the range to format.
segmentIdstringNoThe segment ID (header, footer, or footnote ID). Omit for the document body.
namedStyleTypestringNoNamed style: 'NORMAL_TEXT', 'TITLE', 'SUBTITLE', 'HEADING_1' through 'HEADING_6'.
alignmentstringNoParagraph alignment: 'START', 'CENTER', 'END', 'JUSTIFIED'.
lineSpacingnumberNoLine spacing as a percentage (e.g. 100 for single, 200 for double).
spaceAbovenumberNoSpace above the paragraph in points.
spaceBelownumberNoSpace below the paragraph in points.
indentStartnumberNoStart (left) indentation in points.
indentEndnumberNoEnd (right) indentation in points.
indentFirstLinenumberNoFirst line indentation in points.

Response

Returns raw JSON from the upstream API. No structured schema is available.

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-docs",
      "method": "update_paragraph_style"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-docs",
    "arguments": {
      "method": "update_paragraph_style",
      "params": {
        "documentId": "<documentId>"
      }
    }
  }
}
POSTmanage_bullets/documents/:documentId/manage-bullets

Add or remove bullet/numbered list formatting for paragraphs in a range.

Request

Path Parameters

NameTypeRequiredDescription
documentIdstringYesThe ID of the Google Doc.

Query Parameters

NameTypeRequiredDescription
startIndexnumberNoThe start index of the range.
endIndexnumberNoThe end index of the range.
segmentIdstringNoThe segment ID (header, footer, or footnote ID). Omit for the document body.
actionstringNoWhether to 'add' or 'remove' bullets.
bulletPresetstringNoBullet preset when adding (e.g. 'BULLET_DISC_CIRCLE_SQUARE', 'NUMBERED_DECIMAL_ALPHA_ROMAN'). Defaults to 'BULLET_DISC_CIRCLE_SQUARE'.

Response

Returns raw JSON from the upstream API. No structured schema is available.

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-docs",
      "method": "manage_bullets"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-docs",
    "arguments": {
      "method": "manage_bullets",
      "params": {
        "documentId": "<documentId>"
      }
    }
  }
}
POSTinsert_table/documents/:documentId/insert-table

Insert a table at a specific index in a Google Doc.

Request

Path Parameters

NameTypeRequiredDescription
documentIdstringYesThe ID of the Google Doc.

Query Parameters

NameTypeRequiredDescription
indexnumberNoThe index in the document to insert the table at.
rowsnumberNoThe number of rows for the new table.
columnsnumberNoThe number of columns for the new table.

Response

Returns raw JSON from the upstream API. No structured schema is available.

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-docs",
      "method": "insert_table"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-docs",
    "arguments": {
      "method": "insert_table",
      "params": {
        "documentId": "<documentId>"
      }
    }
  }
}
POSTmodify_table/documents/:documentId/modify-table

Modify a table in a Google Doc. Supports inserting/deleting rows and columns.

Request

Path Parameters

NameTypeRequiredDescription
documentIdstringYesThe ID of the Google Doc.

Query Parameters

NameTypeRequiredDescription
actionstringNoThe table modification action: 'insertRow', 'insertColumn', 'deleteRow', or 'deleteColumn'.
tableStartIndexnumberNoThe start index of the table in the document.
rowIndexnumberNoThe row index for insert/delete row operations.
columnIndexnumberNoThe column index for insert/delete column operations.
insertBelowbooleanNoFor insertRow: insert below (true) or above (false) the reference row. Default true.

Response

Returns raw JSON from the upstream API. No structured schema is available.

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-docs",
      "method": "modify_table"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-docs",
    "arguments": {
      "method": "modify_table",
      "params": {
        "documentId": "<documentId>"
      }
    }
  }
}
POSTinsert_page_break/documents/:documentId/insert-page-break

Insert a page break at a specific index in a Google Doc.

Request

Path Parameters

NameTypeRequiredDescription
documentIdstringYesThe ID of the Google Doc.

Query Parameters

NameTypeRequiredDescription
indexnumberNoThe index in the document to insert the page break at.
segmentIdstringNoThe segment ID (header, footer, or footnote ID). Omit for the document body.

Response

Returns raw JSON from the upstream API. No structured schema is available.

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-docs",
      "method": "insert_page_break"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-docs",
    "arguments": {
      "method": "insert_page_break",
      "params": {
        "documentId": "<documentId>"
      }
    }
  }
}
POSTinsert_inline_image/documents/:documentId/insert-inline-image

Insert an inline image from a URL at a specific index in a Google Doc.

Request

Path Parameters

NameTypeRequiredDescription
documentIdstringYesThe ID of the Google Doc.

Query Parameters

NameTypeRequiredDescription
indexnumberNoThe index in the document to insert the image at.
uristringNoThe URL of the image to insert.
widthnumberNoImage width in points. Omit to use the image's natural size.
heightnumberNoImage height in points. Omit to use the image's natural size.

Response

Returns raw JSON from the upstream API. No structured schema is available.

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-docs",
      "method": "insert_inline_image"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-docs",
    "arguments": {
      "method": "insert_inline_image",
      "params": {
        "documentId": "<documentId>"
      }
    }
  }
}
POSTmanage_headers_footers/documents/:documentId/manage-headers-footers

Create or delete headers and footers in a Google Doc.

Request

Path Parameters

NameTypeRequiredDescription
documentIdstringYesThe ID of the Google Doc.

Query Parameters

NameTypeRequiredDescription
actionstringNoThe action: 'createHeader', 'createFooter', 'deleteHeader', or 'deleteFooter'.
typestringNoHeader/footer type for create actions: 'DEFAULT' (default).
headerIdstringNoThe header ID to delete (required for deleteHeader).
footerIdstringNoThe footer ID to delete (required for deleteFooter).

Response

Returns raw JSON from the upstream API. No structured schema is available.

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-docs",
      "method": "manage_headers_footers"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-docs",
    "arguments": {
      "method": "manage_headers_footers",
      "params": {
        "documentId": "<documentId>"
      }
    }
  }
}
POSTbatch_update/documents/:documentId/batch-update

Send a raw batchUpdate request to the Google Docs API. Use this for complex or multi-step document modifications not covered by other tools. Accepts an array of request objects per the Google Docs API spec.

Request

Path Parameters

NameTypeRequiredDescription
documentIdstringYesThe ID of the Google Doc.

Query Parameters

NameTypeRequiredDescription
requestsarrayNoArray of request objects per the Google Docs batchUpdate API spec.

Response

Returns raw JSON from the upstream API. No structured schema is available.

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-docs",
      "method": "batch_update"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-docs",
    "arguments": {
      "method": "batch_update",
      "params": {
        "documentId": "<documentId>"
      }
    }
  }
}