MCP Tools Reference: drivemcp.googleapis.com

도구: download_file_content

이 도구를 호출하여 Drive 파일의 콘텐츠를 base64 인코딩 문자열로 다운로드합니다.

파일이 Google Drive 서드 파티 MIME 유형인 경우 exportMimeType 필드가 필수이며 다운로드한 파일의 형식을 결정합니다.

파일을 찾을 수 없는 경우 search_files와 같은 다른 도구를 사용하여 사용자가 요청하는 파일을 찾습니다.

사용자가 Drive 콘텐츠의 자연어 표현을 원하는 경우 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