Zum Inhalt
Für Agenten

drive_file_content

Read File (text/Markdown body)

Markdown Tools als JSON

Beschreibung

Returns the inline body of a text-family file (Markdown, plain text, log, csv, or any text/* MIME) as a UTF-8 string. Byte cap: 256 KB — larger files are truncated and truncated: true is set on the response.

This is the same content path the in-app Quick-Look preview uses, minus the redcarpet HTML render. For images, PDFs, or anything binary → returns error: unsupported_kind and a hint to use drive_file_get's download URL.

Zugriff

Zugriffsprofil: gated. Module: files. Die Freigabe im Profil ersetzt keine Account-, Workspace- oder Rollenberechtigung.

Parameter

Name Typ Pflicht Beschreibung
account_id string Ja
file_id string Ja
max_bytes integer Nein Optional byte cap smaller than the default 256 KB.

Eingabeschema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "account_id": {
      "type": "string"
    },
    "file_id": {
      "type": "string"
    },
    "max_bytes": {
      "type": "integer",
      "minimum": 1,
      "description": "Optional byte cap smaller than the default 256 KB."
    }
  },
  "required": [
    "account_id",
    "file_id"
  ],
  "type": "object"
}

Ausgabeschema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "content_type": {
      "type": [
        "string",
        "null"
      ]
    },
    "byte_size": {
      "type": "integer"
    },
    "sync_version": {
      "type": "integer"
    },
    "content": {
      "type": "string"
    },
    "truncated": {
      "type": "boolean"
    }
  },
  "required": [
    "id",
    "name",
    "content_type",
    "byte_size",
    "sync_version",
    "content",
    "truncated"
  ],
  "type": "object"
}
Seiten