MCP Reference: docsmcp.googleapis.com

這是 MCP 伺服器,提供與 Google 文件互動的工具。

Model Context Protocol (MCP) 伺服器可做為代理伺服器,在外部服務與大型語言模型 (LLM) 或 AI 應用程式之間傳輸脈絡、資料或功能。MCP 伺服器可將 AI 應用程式連結至資料庫和 Web 服務等外部系統,並將系統回覆轉換成 AI 應用程式可理解的格式。

MCP 工具

MCP 工具是 MCP 伺服器向 LLM 或 AI 應用程式公開的函式或可執行功能,可在現實世界中執行動作。

工具

docsmcp.googleapis.com MCP 伺服器提供下列工具:

MCP 工具
read_doc

這項工具會根據文件 ID 擷取 Google 文件的 JSON 表示法。

JSON 表示法包含文字和文件結構資訊。

對應於 REST API 中的 documents.get

update_doc

使用批次更新要求更新文件。這個端點會接受 documents.batchUpdate 要求 (以 JSON 格式)。

對應於 REST API 中的 documents.batchUpdate

可能的更新包括:

  • replaceAllText:取代指定文字的所有例項。
  • insertText:在指定位置插入文字。
  • updateTextStyle:更新指定範圍的文字樣式。
  • createParagraphBullets:為段落建立項目符號。
  • deleteParagraphBullets:從段落中刪除項目符號。
  • createNamedRange:建立已命名範圍。
  • deleteNamedRange:刪除指定範圍。
  • updateParagraphStyle:更新指定範圍的段落樣式。
  • deleteContentRange:從文件中刪除內容。
  • insertInlineImage:在指定位置插入內嵌圖片。
  • insertTable:在指定位置插入表格。
  • insertTableRow:在表格中插入空白列。
  • insertTableColumn:在資料表中插入空白資料欄。
  • deleteTableRow:從資料表刪除資料列。
  • deleteTableColumn:從資料表刪除資料欄。
  • insertPageBreak:在指定位置插入分頁符號。
  • deletePositionedObject:從文件中刪除已定位的物件。
  • updateTableColumnProperties:更新資料表中資料欄的屬性。
  • updateTableCellStyle:更新表格儲存格的樣式。
  • updateTableRowStyle:更新資料表中的資料列樣式。
  • replaceImage:取代文件中的圖片。
  • updateDocumentStyle:更新文件的樣式。
  • insertInlineSheetsChart:在指定位置插入內嵌的 Google 試算表圖表。
  • mergeTableCells:合併表格中的儲存格。
  • unmergeTableCells:取消合併表格中的儲存格。
  • refreshSheetsChart:重新整理 Google 試算表圖表。
  • createHeader:建立標題。
  • createFooter:建立頁尾。
  • createFootnote:建立註腳。
  • replaceNamedRangeContent:取代指定範圍中的內容。
  • updateEmbeddedObject:更新內嵌物件的屬性。
  • updateSectionStyle:更新指定範圍的區段樣式。
  • insertSectionBreak:在指定位置插入分節符號。
  • deleteHeader:從文件中刪除標題。
  • deleteFooter:從文件中刪除頁尾。
  • pinTableHeaderRows:更新表格中固定的標題列數。
  • addDocumentTab:新增文件分頁。
  • deleteTab:刪除文件分頁。
  • updateDocumentTabProperties:更新文件分頁的屬性。
  • insertPerson:插入提及對象。
  • updateNamedStyle:更新具名樣式。
  • insertRichLink:插入複合式連結。
  • insertDate:插入日期。
  • insertComment:在文件中插入 CommentThread。
  • addCommentReply:在 CommentThread 或 SuggestionThread 中新增回覆。
  • updateCommentPost:更新 CommentThread 或 SuggestionThread 的現有貼文 (主貼文或回覆)。
  • deleteComment:刪除 CommentThread。
  • deleteCommentReply:從 CommentThread 或 SuggestionThread 刪除回覆貼文。
  • acceptSuggestion:接受建議。
  • rejectSuggestion:拒絕建議。
  • deleteSuggestion:刪除建議。

取得 MCP 工具規格

如要取得 MCP 伺服器中所有工具的 MCP 工具規格,請使用 tools/list 方法。下列範例說明如何使用 curl 列出 MCP 伺服器中目前可用的所有工具及其規格。

Curl 要求
curl --location 'https://docsmcp.googleapis.com/mcp' \
--header 'content-type: application/json' \
--header 'accept: application/json, text/event-stream' \
--data '{
    "method": "tools/list",
    "jsonrpc": "2.0",
    "id": 1
}'