工具:get_spreadsheet
返回指定电子表格的内容。返回指定电子表格 ID 的标题、工作表名称、网格属性和其他元数据。如果请求,还会返回完整网格数据。对应于 REST API 中的 spreadsheets.get:https://developers.google.com/workspace/sheets/api/reference/rest/v4/spreadsheets/get
以下示例演示了如何使用 curl 调用 get_spreadsheet MCP 工具。
| Curl 请求 |
|---|
curl --location 'https://sheetsmcp.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "get_spreadsheet", "arguments": { // provide these details according to the tool MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
输入架构
GetContentRequest
| JSON 表示法 |
|---|
{ "spreadsheetId": string, "includeGridData": boolean } |
| 字段 | |
|---|---|
spreadsheetId |
必需。要请求的电子表格的 ID。 |
includeGridData |
如果应返回网格数据,则为 True。 |
输出架构
表示 JSON 对象。
一个无序的键值对映射,旨在完美捕获 JSON 对象的语义。这样一来,便可将任何任意 JSON 载荷解析为 ProtoJSON 格式的消息字段。
这遵循了 RFC 8259 中有关可互操作 JSON 的准则:值得注意的是,此类型无法表示较大的 Int64 值或 NaN/Infinity 数字,因为 JSON 格式通常不支持其数字类型中的这些值。
如果您不打算将任意 JSON 解析到消息中,则应首选自定义类型的消息,而不是使用此类型。
结构体
| JSON 表示法 |
|---|
{ "fields": { string: value, ... } } |
| 字段 | |
|---|---|
fields |
无序的动态类型值映射。 包含一系列 |
FieldsEntry
| JSON 表示法 |
|---|
{ "key": string, "value": value } |
| 字段 | |
|---|---|
key |
|
value |
|
值
| JSON 表示法 |
|---|
{ "nullValue": null, "numberValue": number, "stringValue": string, "boolValue": boolean, "structValue": { object }, "listValue": array } |
| 字段 | |
|---|---|
联合字段 kind。值的类型。kind 只能是下列其中一项: |
|
nullValue |
表示 JSON |
numberValue |
表示 JSON 数字。不得为 |
stringValue |
表示 JSON 字符串。 |
boolValue |
表示 JSON 布尔值(JSON 中的 |
structValue |
表示 JSON 对象。 |
listValue |
表示 JSON 数组。 |
ListValue
| JSON 表示法 |
|---|
{ "values": [ value ] } |
| 字段 | |
|---|---|
values[] |
动态类型值的重复字段。 |
NullValue
表示 JSON null。
NullValue 是一个标记,使用仅包含一个值的枚举来表示 Value 类型联合的 null 值。
如果类型为 NullValue 的字段的值不是 0,则视为无效。大多数 ProtoJSON 序列化程序都会发出一个 Value,并将 null_value 设置为 JSON null,无论整数值是多少,因此都会往返于 0 值。
| 枚举 | |
|---|---|
NULL_VALUE |
Null 值。 |
工具注释
破坏性提示:❌ | 等幂性提示:✅ | 只读提示:✅ | 开放世界提示:✅