Ferrule

Google Drive

13 tools OpenAPI spec ↗

MCPREST
GETlist_files/files

List files and folders in Google Drive. Optionally filter by parent folder ID. Returns file metadata including id, name, mimeType, and links.

Request

Query Parameters

NameTypeRequiredDescription
folderIdstringNoID of the parent folder to list files from. When provided, only files in this folder are returned.
pageSizenumberNoMaximum number of files to return per page (1-1000, default 100).
pageTokenstringNoToken for paginating through results.
orderBystringNoSort order (e.g. 'modifiedTime desc', 'name', 'folder,modifiedTime desc').

Response

filesobject
nextPageTokenobject
incompleteSearchobject

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-drive",
      "method": "list_files"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-drive",
    "arguments": {
      "method": "list_files",
      "params": {}
    }
  }
}
POSTsearch_files/files/search

Search for files and folders in Google Drive. Uses the Drive query syntax for the 'q' parameter (e.g. "name contains 'report'" or "mimeType = 'application/vnd.google-apps.folder'"). Returns file metadata including id, name, mimeType, and links.

Request

Query Parameters

NameTypeRequiredDescription
qstringNoDrive search query (e.g. "name contains 'report'", "mimeType = 'application/vnd.google-apps.folder'", "'folderId' in parents"). See Google Drive API query syntax.
pageSizenumberNoMaximum number of files to return per page (1-1000, default 100).
pageTokenstringNoToken for paginating through results.
orderBystringNoSort order (e.g. 'modifiedTime desc', 'name', 'folder,modifiedTime desc').
corporastringNoSource of files: 'user', 'drive', 'domain', or 'allDrives' (default 'allDrives').
driveIdstringNoID of the shared drive to search. Required when corpora is 'drive'.

Response

filesobject
nextPageTokenobject
incompleteSearchobject

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-drive",
      "method": "search_files"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-drive",
    "arguments": {
      "method": "search_files",
      "params": {}
    }
  }
}
GETget_file/files/:fileId

Get metadata for a single file or folder by its ID. Returns detailed file information including name, MIME type, size, timestamps, owners, and links.

Request

Path Parameters

NameTypeRequiredDescription
fileIdstringYesThe ID of the file or folder to retrieve.

Response

idobject
nameobject
mimeTypeobject
descriptionobject
starredobject
trashedobject
parentsobject
webViewLinkobject
webContentLinkobject
iconLinkobject
thumbnailLinkobject
sizeobject
createdTimeobject
modifiedTimeobject
ownersobject
lastModifyingUserobject
sharedobject
capabilitiesobject

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-drive",
      "method": "get_file"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-drive",
    "arguments": {
      "method": "get_file",
      "params": {
        "fileId": "<fileId>"
      }
    }
  }
}
GETget_file_content/files/:fileId/content

Get the content of a file. For Google Docs, exports as plain text. For Google Sheets, exports as CSV. For other Google Workspace types, exports in a suitable text format. For binary files (PDFs, images, etc.), returns a download URL instead of inline content.

Request

Path Parameters

NameTypeRequiredDescription
fileIdstringYesThe ID of the file to get content from.

Response

fileIdobject
nameobject
mimeTypeobject
contentobject
exportedMimeTypeobject
downloadUrlobject

Runtime output is unvalidated JSON (raw passthrough).

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-drive",
      "method": "get_file_content"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-drive",
    "arguments": {
      "method": "get_file_content",
      "params": {
        "fileId": "<fileId>"
      }
    }
  }
}
GETexport_file/files/:fileId/export

Export a Google Workspace file (Docs, Sheets, Slides, Drawings) to a specified MIME type. For example, export a Google Doc as 'application/pdf' or 'text/html', or a Sheet as 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'.

Request

Path Parameters

NameTypeRequiredDescription
fileIdstringYesThe ID of the Google Workspace file to export.

Query Parameters

NameTypeRequiredDescription
mimeTypestringNoThe MIME type to export to (e.g. 'application/pdf', 'text/html', 'text/csv', 'text/plain').

Response

fileIdobject
nameobject
mimeTypeobject
contentobject
exportedMimeTypeobject
downloadUrlobject

Runtime output is unvalidated JSON (raw passthrough).

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-drive",
      "method": "export_file"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-drive",
    "arguments": {
      "method": "export_file",
      "params": {
        "fileId": "<fileId>"
      }
    }
  }
}
POSTupload_file/files

Upload a file to Google Drive. The file content must be provided as a base64-encoded string.

Request

Query Parameters

NameTypeRequiredDescription
namestringNoThe name for the uploaded file.
contentstringNoThe file content as a base64-encoded string.
mimeTypestringNoThe MIME type of the file (e.g. 'application/pdf').
folderIdstringNoID of the parent folder to upload into.

Response

idobject
nameobject
mimeTypeobject
descriptionobject
starredobject
trashedobject
parentsobject
webViewLinkobject
webContentLinkobject
iconLinkobject
thumbnailLinkobject
sizeobject
createdTimeobject
modifiedTimeobject
ownersobject
lastModifyingUserobject
sharedobject
capabilitiesobject

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-drive",
      "method": "upload_file"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-drive",
    "arguments": {
      "method": "upload_file",
      "params": {}
    }
  }
}
POSTcreate_folder/folders

Create a new folder in Google Drive. Optionally specify a parent folder.

Request

Query Parameters

NameTypeRequiredDescription
namestringNoThe name for the new folder.
parentIdstringNoID of the parent folder to create the folder in.

Response

idobject
nameobject
mimeTypeobject
descriptionobject
starredobject
trashedobject
parentsobject
webViewLinkobject
webContentLinkobject
iconLinkobject
thumbnailLinkobject
sizeobject
createdTimeobject
modifiedTimeobject
ownersobject
lastModifyingUserobject
sharedobject
capabilitiesobject

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-drive",
      "method": "create_folder"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-drive",
    "arguments": {
      "method": "create_folder",
      "params": {}
    }
  }
}
POSTmove_file/files/:fileId/move

Move a file or folder to a different parent folder in Google Drive. By default removes the file from its current parent.

Request

Path Parameters

NameTypeRequiredDescription
fileIdstringYesThe ID of the file or folder to move.

Query Parameters

NameTypeRequiredDescription
newParentIdstringNoThe ID of the destination parent folder.
removeFromCurrentParentbooleanNoWhether to remove the file from its current parent folder (default true).

Response

idobject
nameobject
mimeTypeobject
descriptionobject
starredobject
trashedobject
parentsobject
webViewLinkobject
webContentLinkobject
iconLinkobject
thumbnailLinkobject
sizeobject
createdTimeobject
modifiedTimeobject
ownersobject
lastModifyingUserobject
sharedobject
capabilitiesobject

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-drive",
      "method": "move_file"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-drive",
    "arguments": {
      "method": "move_file",
      "params": {
        "fileId": "<fileId>"
      }
    }
  }
}
PATCHrename_file/files/:fileId

Rename a file or folder in Google Drive.

Request

Path Parameters

NameTypeRequiredDescription
fileIdstringYesThe ID of the file or folder to rename.

Query Parameters

NameTypeRequiredDescription
newNamestringNoThe new name for the file or folder.

Response

idobject
nameobject
mimeTypeobject
descriptionobject
starredobject
trashedobject
parentsobject
webViewLinkobject
webContentLinkobject
iconLinkobject
thumbnailLinkobject
sizeobject
createdTimeobject
modifiedTimeobject
ownersobject
lastModifyingUserobject
sharedobject
capabilitiesobject

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-drive",
      "method": "rename_file"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-drive",
    "arguments": {
      "method": "rename_file",
      "params": {
        "fileId": "<fileId>"
      }
    }
  }
}
DELETEtrash_file/files/:fileId

Move a file or folder to the trash in Google Drive. The file can be recovered from the trash within 30 days.

Request

Path Parameters

NameTypeRequiredDescription
fileIdstringYesThe ID of the file or folder to trash.

Response

idobject
nameobject
mimeTypeobject
descriptionobject
starredobject
trashedobject
parentsobject
webViewLinkobject
webContentLinkobject
iconLinkobject
thumbnailLinkobject
sizeobject
createdTimeobject
modifiedTimeobject
ownersobject
lastModifyingUserobject
sharedobject
capabilitiesobject

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-drive",
      "method": "trash_file"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-drive",
    "arguments": {
      "method": "trash_file",
      "params": {
        "fileId": "<fileId>"
      }
    }
  }
}
GETlist_shared_drives/shared-drives

List all shared drives (Team Drives) the authenticated user has access to.

Request

Query Parameters

NameTypeRequiredDescription
pageSizenumberNoMaximum number of shared drives to return per page (1-100, default 100).
pageTokenstringNoToken for paginating through results.
qstringNoQuery string for searching shared drives (e.g. "name contains 'Marketing'").

Response

drivesobject
nextPageTokenobject

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-drive",
      "method": "list_shared_drives"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-drive",
    "arguments": {
      "method": "list_shared_drives",
      "params": {}
    }
  }
}
GETlist_revisions/files/:fileId/revisions

List historical revisions of a file in Google Drive. Returns revision metadata including id, mimeType, modifiedTime, size, and (for Google-native types) exportLinks that can be used to fetch revision content.

Request

Path Parameters

NameTypeRequiredDescription
fileIdstringYesThe ID of the file whose revisions should be listed.

Query Parameters

NameTypeRequiredDescription
pageSizenumberNoMaximum number of revisions to return per page (1-1000, default 200).
pageTokenstringNoToken for paginating through results.

Response

revisionsobject
nextPageTokenobject
kindobject

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-drive",
      "method": "list_revisions"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-drive",
    "arguments": {
      "method": "list_revisions",
      "params": {
        "fileId": "<fileId>"
      }
    }
  }
}
GETget_revision_content/files/:fileId/revisions/:revisionId/content

Get the content of a specific revision of a file. For Google Workspace types (Docs, Sheets, Slides, Drawings), exports the revision as text and inlines it if small enough; otherwise returns metadata with a downloadPath for REST retrieval. For binary files, returns metadata only and a downloadPath the caller can fetch via the REST API. When called via REST, the raw revision bytes are streamed as an HTTP attachment.

Request

Path Parameters

NameTypeRequiredDescription
fileIdstringYesThe ID of the file whose revision should be fetched.
revisionIdstringYesThe ID of the revision to fetch.

Response

Returns binary file data (e.g., file content, export). No JSON schema.

Examples

1. Describe method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "describe_method",
    "arguments": {
      "service": "google-drive",
      "method": "get_revision_content"
    }
  }
}

2. Call method

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "call_google-drive",
    "arguments": {
      "method": "get_revision_content",
      "params": {
        "fileId": "<fileId>",
        "revisionId": "<revisionId>"
      }
    }
  }
}