這是 MCP 伺服器,提供與 Google 試算表互動的工具。
Model Context Protocol (MCP) 伺服器可做為代理伺服器,在外部服務與大型語言模型 (LLM) 或 AI 應用程式之間傳遞脈絡、資料或功能。MCP 伺服器會將 AI 應用程式連線至資料庫和 Web 服務等外部系統,並將系統回覆內容轉換成 AI 應用程式可理解的格式。
MCP 工具
MCP 工具是 MCP 伺服器向 LLM 或 AI 應用程式公開的函式或可執行功能,可在現實世界中執行動作。
工具
sheetsmcp.googleapis.com MCP 伺服器提供下列工具:
| MCP 工具 | |
|---|---|
get_values |
從試算表傳回一系列值。對應 REST API 中的 spreadsheets.values.get:https://developers.google.com/workspace/sheets/api/reference/rest/v4/spreadsheets.values/get |
get_spreadsheet |
傳回指定試算表的內容。傳回指定試算表 ID 的標題、工作表名稱、格線屬性和其他中繼資料。如果要求,也會傳回完整格線資料。對應 REST API 中的 spreadsheets.get:https://developers.google.com/workspace/sheets/api/reference/rest/v4/spreadsheets/get |
update_spreadsheet |
對試算表套用一或多項更新。 對應於 REST API 中的 spreadsheets.batchUpdate:https://developers.google.com/workspace/sheets/api/reference/rest/v4/spreadsheets/batchUpdate 可能的更新包括:
|
update_values |
在試算表範圍中設定值。對應 REST API 中的 spreadsheets.values.update:https://developers.google.com/workspace/sheets/api/reference/rest/v4/spreadsheets.values/update |
update_formulas |
在試算表範圍中設定公式。對應 REST API 中的 spreadsheets.values.update:https://developers.google.com/workspace/sheets/api/reference/rest/v4/spreadsheets.values/update |
insert_dimension |
在工作表的特定索引處插入列或欄。對應於 spreadsheets.batchUpdate REST API 中的 InsertDimensionRequest:https://developers.google.com/workspace/sheets/api/reference/rest/v4/spreadsheets/request |
取得 MCP 工具規格
如要取得 MCP 伺服器中所有工具的 MCP 工具規格,請使用 tools/list 方法。下列範例說明如何使用 curl 列出 MCP 伺服器中目前可用的所有工具及其規格。
| Curl 要求 |
|---|
curl --location 'https://sheetsmcp.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/list", "jsonrpc": "2.0", "id": 1 }' |