GDrive MCP Server

Server URL:

Login URL:

Core Version: 1.1.4

MCP Status: Running ✅

Header Parameters

Notes

- Ensure that the appropriate scopes are enabled in the Google authentication page for the services in use.

- All tools that perform delete actions require confirmation. This is an experimental feature. Instruct the language model to prompt the user for confirmation for it to work effectively.

Tools

Documents

Creates a new Google Docs document with the specified content.

* Requires permission scope for documents

Args:
- title (str): The title of the document to create.
- content (str): The content to be added to the document.
- parent_folder_id (str, optional): The ID of the parent folder to create the document in.

Returns:
- A dictionary indicating success or error, without JSON serialization.

Edits an existing Google Docs document with the specified content.

* Requires permission scope for documents

Args:
- document_id (str): The ID of the Google Docs document to edit.
- new_content (str): The new content to be added to the document.

Returns:
- A dictionary indicating success or error.

Drive

Creates a new text, JSON, or CSV file with the specified content and uploads it to Google Drive.

* Requires permission scope for the drive.

Args:
- title (str): The title of the file to create.
- content (str): The content to be added to the file.
- file_type (str): The type of the file to create ("text", "json", or "csv").
- parent_folder_id (str, optional): The ID of the parent folder to create the file in.

Returns:
- A dictionary indicating success or error, without JSON serialization.

Example Request Payloads:

gdrive_create_file_tool(title="example.txt", content="Hello, this is a text file.", file_type="text") # text file
gdrive_create_file_tool(title="example.json", content={"name": "John", "age": 30}, file_type="json") # json file
gdrive_create_file_tool(title="example.csv", content="Name,Age\nJohn,30\nJane,28", file_type="csv") # csv file

Creates a new folder in Google Drive.

* Requires permission scope for the drive.

Args:
- folder_name (str): The name of the folder to create.
- parent_id (str): The ID of the parent folder (optional). If None, creates in root.

Returns:
- dict: Dictionary containing the folder name and its corresponding ID on success, or error message on failure.

Deletes a specified item (file or folder) from Google Drive with confirmation logic.

* Requires permission scope for the drive.

The function first checks if a confirmation token is provided.
If not, it generates a token based on the item ID.
The user must then confirm the deletion using this token.
If the token is provided, the function validates it before proceeding with the deletion.
The token is valid for a specified duration.

Args:
- file_id (str): The ID of the file or folder to delete.
- confirmation_token (Optional[str]): An optional token to confirm the deletion. If not provided, a token will be generated based on the file/folder ID.

Returns:
- dict: Dictionary indicating success or error.

Retrieves the contents of a file based on its type (Google Docs, Google Sheets, PDF, text, JSON or CSV).

* Requires permission scope for the drive.

Args:
- file_id (str): The ID of the file to retrieve.

Returns:
- JSON string indicating success or error, along with the file contents.

Retrieves information about a file or folder in Google Drive based on its ID.

* Requires permission scope for the drive.

Args:
- item_id (str): The ID of the file or folder to retrieve information from.

Returns:
- dict indicating success or error, along with the file/folder information.

Lists all items in a specified Google Drive folder or the root directory if no folder_id is provided.

* Requires permission scope for the drive.

Args:
- folder_id (Optional[str]): The ID of the folder to list files and folders from.

Returns:
- dict: Contains file/folder data on success or error message on failure.

Moves a file or folder to a new folder in Google Drive.

* Requires permission scope for the drive.

Args:
- item_id (str): The ID of the file or folder to move.
- new_parent_id (str): The ID of the new parent folder.

Returns:
- dict indicating success or error.

Searches for files and folders in Google Drive by their name.

* Requires permission scope for the drive.

Args:
- name (str): The name of the files or folders to search for.

Returns:
- Dictionary containing the list of matching files or folders or an error message.

Spreadsheets

Adds content to an existing Google Sheets document.

* Requires permission scope for spreadsheets.

Args:
- sheet_id (str): The ID of the sheet to add content to.
- values (list): A list of lists representing rows and columns of content to add.

Returns:
- Dictionary indicating success or error.

Example Request Payload:
gdrive_add_rows_to_sheet_tool(
sheet_id="1AbcD3FgHiJkLmnopQRsTuvWxYzZ1234567890",
values=[["Name", "Email", "Age"],["Alice", "alice@example.com", "30"]])

Creates a new Google Sheets document with the specified title.

* Requires permission scope for spreadsheets.

Args:
- title (str): The title of the sheet to create.
- parent_folder_id (str, optional): The ID of the parent folder to create the sheet in.

Returns:
- Dictionary indicating success or error.

Deletes specified rows from an existing Google Sheets document.

* Requires permission scope for spreadsheets.

Args:
- sheet_id (str): The ID of the sheet from which to delete rows.
- row_indices (list): A list of row indices (1-based) to delete.

Returns:
- Dictionary indicating success or error.

Edits rows in an existing Google Sheets document.

* Requires permission scope for spreadsheets.

Args:
- sheet_id (str): The ID of the sheet to edit content in.
- range_name (str): The range of cells to edit (e.g., 'Sheet1!A1:B2').
- values (list): A list of lists representing the new content to replace existing content.

Returns:
- Dictionary indicating success or error.

Privacy Policy Terms and Conditions