MCP Tools Reference: drivemcp.googleapis.com

ツール: download_file_content

このツールを呼び出して、ドライブ ファイルのコンテンツを base64 エンコードされた文字列としてダウンロードします。

ファイルが Google ドライブのファースト パーティの MIME タイプの場合、exportMimeType フィールドは必須であり、ダウンロードしたファイルの形式を決定します。

ファイルが見つからない場合は、search_files などの他のツールを使用して、ユーザーがリクエストしているファイルを見つけてください。

ユーザーがドライブ コンテンツの自然言語表現を必要とする場合は、read_file_content ツールを使用します(read_file_content は小さく、解析しやすい必要があります)。

次のサンプルは、curl を使用して download_file_content MCP ツールを呼び出す方法を示しています。

Curl リクエスト
curl --location 'https://drivemcp.googleapis.com/mcp/v1' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'content-type: application/json' \
--header 'accept: application/json, text/event-stream' \
--data '{
  "method": "tools/call",
  "params": {
    "name": "download_file_content",
    "arguments": {
      // provide these details according to the tool's MCP specification
    }
  },
  "jsonrpc": "2.0",
  "id": 1
}'
                

入力スキーマ

ファイルのコンテンツをダウンロードするリクエストを定義します。

DownloadFileRequest

JSON 表現
{
  "fileId": string,
  "exportMimeType": string
}
フィールド
fileId

string

必須。取得するファイルの ID。

exportMimeType

string

省略可。Google ネイティブ ファイルの場合、ファイルをエクスポートする MIME タイプ。それ以外の場合は無視されます。指定しない場合のデフォルトはテキストです。

出力スキーマ

ファイル ダウンロード リクエストのレスポンス。

FileContent

JSON 表現
{
  "id": string,
  "title": string,
  "mimeType": string,
  "content": string
}
フィールド
id

string

ファイルの ID。

title

string

ファイルのタイトル。

mimeType

string

ファイルの MIME タイプ。

content

string

ファイルの base64 エンコードされたコンテンツ。

ツールのアノテーション

破壊的ヒント: ❌ | べき等ヒント: ✅ | 読み取り専用ヒント: ✅ | オープン ワールド ヒント: ❌

認可スコープ

次の OAuth スコープのいずれかが必要です。

  • https://www.googleapis.com/auth/drive
  • https://www.googleapis.com/auth/drive.appdata
  • https://www.googleapis.com/auth/drive.file
  • https://www.googleapis.com/auth/drive.meet.readonly
  • https://www.googleapis.com/auth/drive.metadata
  • https://www.googleapis.com/auth/drive.metadata.readonly
  • https://www.googleapis.com/auth/drive.photos.readonly
  • https://www.googleapis.com/auth/drive.readonly