所有工具

gdrive_read_file

Google Drive · macOS · Windows

效果: 读取. 状态: 受限可用.

“受限可用”表示工具可能取决于版本、平台、权限、账户或配置,并不表示它在所有安装中都已启用。

macOS

用途

从同步的 Google Drive 文件夹中读取文本文件(.txt、.md、.csv、.json、代码文件等)。注意:原生 Google 文档、表格和幻灯片会同步为 .gdoc/.gsheet 指针,而不是真实文件;请从 Drive 导出它们,或改为读取 Office/PDF 副本。自动检测 UTF-8,并回退到 Latin-1/CP1252。Google Drive 以外的文件请使用 file_read。

必填输入

输入名称会严格保持工具要求的形式。下方可展开的架构中保留英文规范技术定义。

权限与确认

架构未声明明确的确认参数。这并不代表可以未经许可操作;请检查效果并取得授权。

英文规范技术架构macOS
{
  "properties": {
    "encoding": {
      "description": "'auto' (default), 'utf8', 'latin1', 'cp1252', 'ascii', 'utf16'",
      "type": "string"
    },
    "max_bytes": {
      "description": "Max bytes (default 1MB, cap 10MB)",
      "type": "integer"
    },
    "offset": {
      "description": "Start byte offset (default 0)",
      "type": "integer"
    },
    "path": {
      "description": "Absolute path to the file",
      "type": "string"
    }
  },
  "required": [
    "path"
  ],
  "type": "object"
}

文档示例

gdrive_read_file 的文档示例。请勿执行此示例。所示参数属于虚构数据集;在实际调用前,请解析真实标识符并获得授权。

{
  "path": "/Users/demo/Library/CloudStorage/[email protected]/My Drive/Documents/meeting-notes.txt"
}

Windows

用途

从 Google Drive 读取文本文件。以文本形式返回内容。

必填输入

输入名称会严格保持工具要求的形式。下方可展开的架构中保留英文规范技术定义。

权限与确认

架构未声明明确的确认参数。这并不代表可以未经许可操作;请检查效果并取得授权。

英文规范技术架构Windows
{
  "properties": {
    "path": {
      "description": "File path (relative to Google Drive root or absolute)",
      "type": "string"
    }
  },
  "required": [
    "path"
  ],
  "type": "object"
}

文档示例

gdrive_read_file 的文档示例。请勿执行此示例。所示参数属于虚构数据集;在实际调用前,请解析真实标识符并获得授权。

{
  "path": "Documents/meeting-notes.txt"
}