universal-mcp-applications 0.1.27rc2__py3-none-any.whl → 0.1.28__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of universal-mcp-applications might be problematic. Click here for more details.
- universal_mcp/applications/google_gemini/app.py +3 -3
- universal_mcp/applications/onedrive/README.md +4 -4
- universal_mcp/applications/onedrive/app.py +23 -23
- universal_mcp/applications/scraper/app.py +36 -268
- universal_mcp/applications/sharepoint/README.md +16 -14
- universal_mcp/applications/sharepoint/app.py +267 -154
- universal_mcp/applications/unipile/app.py +27 -336
- {universal_mcp_applications-0.1.27rc2.dist-info → universal_mcp_applications-0.1.28.dist-info}/METADATA +1 -1
- {universal_mcp_applications-0.1.27rc2.dist-info → universal_mcp_applications-0.1.28.dist-info}/RECORD +11 -11
- {universal_mcp_applications-0.1.27rc2.dist-info → universal_mcp_applications-0.1.28.dist-info}/WHEEL +0 -0
- {universal_mcp_applications-0.1.27rc2.dist-info → universal_mcp_applications-0.1.28.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,225 +1,338 @@
|
|
|
1
1
|
import base64
|
|
2
|
-
import
|
|
3
|
-
from datetime import datetime
|
|
4
|
-
from io import BytesIO
|
|
2
|
+
import os
|
|
5
3
|
from typing import Any
|
|
6
4
|
|
|
7
5
|
from loguru import logger
|
|
8
|
-
from
|
|
9
|
-
from universal_mcp.applications.application import BaseApplication
|
|
6
|
+
from universal_mcp.applications.application import APIApplication
|
|
10
7
|
from universal_mcp.integrations import Integration
|
|
11
8
|
|
|
12
9
|
|
|
13
|
-
|
|
14
|
-
"""Converts a datetime object to ISO format string, or returns None if the object is None."""
|
|
15
|
-
if dt_obj is not None:
|
|
16
|
-
return dt_obj.isoformat()
|
|
17
|
-
return None
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class SharepointApp(BaseApplication):
|
|
10
|
+
class SharepointApp(APIApplication):
|
|
21
11
|
"""
|
|
22
|
-
|
|
12
|
+
Application for interacting with Microsoft SharePoint API (via Microsoft Graph).
|
|
13
|
+
Provides tools to manage files, folders, and access Drive information.
|
|
23
14
|
"""
|
|
24
15
|
|
|
25
|
-
def __init__(self, integration: Integration
|
|
26
|
-
""
|
|
16
|
+
def __init__(self, integration: Integration | None = None, **kwargs) -> None:
|
|
17
|
+
super().__init__(name="sharepoint", integration=integration, **kwargs)
|
|
18
|
+
self.base_url = "https://graph.microsoft.com/v1.0"
|
|
19
|
+
|
|
20
|
+
def get_my_profile(self) -> dict[str, Any]:
|
|
21
|
+
"""
|
|
22
|
+
Fetches the profile for the currently authenticated user, specifically retrieving their ID and user principal name. This function confirms user identity, distinguishing it from `get_drive_info`, which returns details about the SharePoint storage space (e.g., quota) rather than the user's personal profile.
|
|
23
|
+
|
|
24
|
+
Returns:
|
|
25
|
+
dict[str, Any]: A dictionary containing the user's id and userPrincipalName.
|
|
26
|
+
|
|
27
|
+
Raises:
|
|
28
|
+
HTTPStatusError: If the API request fails.
|
|
29
|
+
|
|
30
|
+
Tags:
|
|
31
|
+
profile, user, account
|
|
32
|
+
"""
|
|
33
|
+
url = f"{self.base_url}/me"
|
|
34
|
+
query_params = {"$select": "id,userPrincipalName"}
|
|
35
|
+
response = self._get(url, params=query_params)
|
|
36
|
+
return self._handle_response(response)
|
|
37
|
+
|
|
38
|
+
def get_drive_info(self) -> dict[str, Any]:
|
|
39
|
+
"""
|
|
40
|
+
Fetches high-level information about the user's entire SharePoint. It returns drive-wide details like the owner and storage quota, differing from `get_item_metadata` which describes a specific item, and `get_my_profile` which retrieves general user account information.
|
|
41
|
+
|
|
42
|
+
Returns:
|
|
43
|
+
A dictionary containing drive information.
|
|
44
|
+
|
|
45
|
+
Tags:
|
|
46
|
+
drive, storage, quota, info
|
|
47
|
+
"""
|
|
48
|
+
url = f"{self.base_url}/me/drive"
|
|
49
|
+
response = self._get(url)
|
|
50
|
+
return self._handle_response(response)
|
|
51
|
+
|
|
52
|
+
def _list_drive_items(self, item_id: str = "root") -> dict[str, Any]:
|
|
53
|
+
"""
|
|
54
|
+
Lists the files and folders in the current user's SharePoint.
|
|
55
|
+
|
|
56
|
+
Args:
|
|
57
|
+
item_id (str, optional): The ID of the folder to list. Defaults to 'root'.
|
|
58
|
+
|
|
59
|
+
Returns:
|
|
60
|
+
A dictionary containing the list of files and folders.
|
|
61
|
+
"""
|
|
62
|
+
url = f"{self.base_url}/me/drive/items/{item_id}/children"
|
|
63
|
+
response = self._get(url)
|
|
64
|
+
return self._handle_response(response)
|
|
65
|
+
|
|
66
|
+
def search_files(self, query: str) -> dict[str, Any]:
|
|
67
|
+
"""
|
|
68
|
+
Searches the user's entire SharePoint for files and folders matching a specified text query. This function performs a comprehensive search from the drive's root, distinguishing it from `list_files` or `list_folders` which only browse the contents of a single directory.
|
|
69
|
+
|
|
27
70
|
Args:
|
|
28
|
-
|
|
71
|
+
query (str): The search query.
|
|
72
|
+
|
|
73
|
+
Returns:
|
|
74
|
+
A dictionary containing the search results.
|
|
75
|
+
|
|
76
|
+
Tags:
|
|
77
|
+
search, find, query, files, important
|
|
29
78
|
"""
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
self.
|
|
79
|
+
if not query:
|
|
80
|
+
raise ValueError("Search query cannot be empty.")
|
|
81
|
+
|
|
82
|
+
url = f"{self.base_url}/me/drive/root/search(q='{query}')"
|
|
83
|
+
response = self._get(url)
|
|
84
|
+
return self._handle_response(response)
|
|
34
85
|
|
|
35
|
-
|
|
36
|
-
def client(self):
|
|
86
|
+
def get_item_metadata(self, item_id: str) -> dict[str, Any]:
|
|
37
87
|
"""
|
|
38
|
-
|
|
88
|
+
Fetches detailed metadata for a specific file or folder using its unique ID. It returns properties like name, size, and type. Unlike `get_document_content`, it doesn't retrieve the file's actual content, focusing solely on the item's attributes for quick inspection without a full download.
|
|
89
|
+
|
|
90
|
+
Args:
|
|
91
|
+
item_id (str): The ID of the file or folder.
|
|
39
92
|
|
|
40
93
|
Returns:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if not
|
|
47
|
-
raise ValueError("
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
access_token = credentials.get("access_token")
|
|
57
|
-
refresh_token = credentials.get("refresh_token")
|
|
58
|
-
return {
|
|
59
|
-
"access_token": access_token,
|
|
60
|
-
"refresh_token": refresh_token,
|
|
61
|
-
"token_type": "Bearer",
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if self._client is None:
|
|
65
|
-
self._client = GraphClient(token_callback=_acquire_token)
|
|
66
|
-
# Get me
|
|
67
|
-
me = self._client.me.get().execute_query()
|
|
68
|
-
logger.debug(me.properties)
|
|
69
|
-
# Get sites
|
|
70
|
-
sites = self._client.sites.root.get().execute_query()
|
|
71
|
-
self._site_url = sites.properties.get("id")
|
|
72
|
-
return self._client
|
|
73
|
-
|
|
74
|
-
def list_folders(self, folder_path: str | None = None) -> list[dict[str, Any]]:
|
|
75
|
-
"""
|
|
76
|
-
Retrieves a list of immediate subfolder names within a specified SharePoint directory. If no path is provided, it defaults to the root drive. This function is distinct from `list_files`, as it exclusively lists directories, not files.
|
|
94
|
+
A dictionary containing the item's metadata.
|
|
95
|
+
|
|
96
|
+
Tags:
|
|
97
|
+
metadata, info, file, folder
|
|
98
|
+
"""
|
|
99
|
+
if not item_id:
|
|
100
|
+
raise ValueError("Missing required parameter 'item_id'.")
|
|
101
|
+
|
|
102
|
+
url = f"{self.base_url}/me/drive/items/{item_id}"
|
|
103
|
+
response = self._get(url)
|
|
104
|
+
return self._handle_response(response)
|
|
105
|
+
|
|
106
|
+
def create_folder(self, name: str, parent_id: str = "root") -> dict[str, Any]:
|
|
107
|
+
"""
|
|
108
|
+
Creates a new folder with a specified name within a parent directory, which defaults to the root. Returns metadata for the new folder. Unlike `create_folder_and_list`, this function only creates the folder and returns its specific metadata, not the parent directory's contents.
|
|
77
109
|
|
|
78
110
|
Args:
|
|
79
|
-
|
|
111
|
+
name (str): The name of the new folder.
|
|
112
|
+
parent_id (str, optional): The ID of the parent folder. Defaults to 'root'.
|
|
80
113
|
|
|
81
114
|
Returns:
|
|
82
|
-
|
|
115
|
+
A dictionary containing the new folder's metadata.
|
|
83
116
|
|
|
84
117
|
Tags:
|
|
85
|
-
important
|
|
118
|
+
create, folder, directory, important
|
|
86
119
|
"""
|
|
87
|
-
if
|
|
88
|
-
|
|
89
|
-
folders = folder.get_folders(False).execute_query()
|
|
90
|
-
else:
|
|
91
|
-
folders = self.client.me.drive.root.get_folders(False).execute_query()
|
|
120
|
+
if not name:
|
|
121
|
+
raise ValueError("Folder name cannot be empty.")
|
|
92
122
|
|
|
93
|
-
|
|
123
|
+
url = f"{self.base_url}/me/drive/items/{parent_id}/children"
|
|
124
|
+
data = {"name": name, "folder": {}, "@microsoft.graph.conflictBehavior": "rename"}
|
|
125
|
+
response = self._post(url, data=data)
|
|
126
|
+
return self._handle_response(response)
|
|
94
127
|
|
|
95
|
-
def
|
|
96
|
-
self, folder_name: str, folder_path: str | None = None
|
|
97
|
-
) -> dict[str, Any]:
|
|
128
|
+
def delete_item(self, item_id: str) -> dict[str, Any]:
|
|
98
129
|
"""
|
|
99
|
-
|
|
130
|
+
Permanently deletes a specified file or folder from SharePoint using its unique item ID. This versatile function can remove any type of drive item, distinguished from functions that only list or create specific types. A successful deletion returns an empty response, confirming the item's removal.
|
|
100
131
|
|
|
101
132
|
Args:
|
|
102
|
-
|
|
103
|
-
folder_path (str | None, optional): The path to the parent folder. If None, creates in the root.
|
|
133
|
+
item_id (str): The ID of the item to delete.
|
|
104
134
|
|
|
105
135
|
Returns:
|
|
106
|
-
|
|
136
|
+
An empty dictionary if successful.
|
|
107
137
|
|
|
108
138
|
Tags:
|
|
109
|
-
important
|
|
139
|
+
delete, remove, file, folder, important
|
|
110
140
|
"""
|
|
111
|
-
if
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
return self.
|
|
141
|
+
if not item_id:
|
|
142
|
+
raise ValueError("Missing required parameter 'item_id'.")
|
|
143
|
+
|
|
144
|
+
url = f"{self.base_url}/me/drive/items/{item_id}"
|
|
145
|
+
response = self._delete(url)
|
|
146
|
+
return self._handle_response(response)
|
|
117
147
|
|
|
118
|
-
def
|
|
148
|
+
def download_file(self, item_id: str) -> dict[str, Any]:
|
|
119
149
|
"""
|
|
120
|
-
Retrieves
|
|
150
|
+
Retrieves a temporary, pre-authenticated download URL for a specific file using its item ID. This function provides a link for subsequent download, differing from `get_document_content` which directly fetches the file's raw content. The URL is returned within a dictionary.
|
|
121
151
|
|
|
122
152
|
Args:
|
|
123
|
-
|
|
153
|
+
item_id (str): The ID of the file to download.
|
|
124
154
|
|
|
125
155
|
Returns:
|
|
126
|
-
|
|
156
|
+
A dictionary containing the download URL for the file under the key '@microsoft.graph.downloadUrl'.
|
|
127
157
|
|
|
128
158
|
Tags:
|
|
129
|
-
important
|
|
159
|
+
download, file, get, important
|
|
160
|
+
"""
|
|
161
|
+
if not item_id:
|
|
162
|
+
raise ValueError("Missing required parameter 'item_id'.")
|
|
163
|
+
|
|
164
|
+
url = f"{self.base_url}/me/drive/items/{item_id}"
|
|
165
|
+
response = self._get(url)
|
|
166
|
+
metadata = self._handle_response(response)
|
|
167
|
+
download_url = metadata.get("@microsoft.graph.downloadUrl")
|
|
168
|
+
if not download_url:
|
|
169
|
+
raise ValueError("Could not retrieve download URL for the item.")
|
|
170
|
+
return {"download_url": download_url}
|
|
171
|
+
|
|
172
|
+
def upload_file(self, file_path: str, parent_id: str = "root", file_name: str | None = None) -> dict[str, Any]:
|
|
130
173
|
"""
|
|
131
|
-
folder
|
|
132
|
-
files = folder.get_files(False).execute_query()
|
|
174
|
+
Uploads a local binary file (under 4MB) from a given path to a specified SharePoint folder. Unlike `upload_text_file`, which uploads string content, this function reads from the filesystem. The destination filename can be customized, and it returns the new file's metadata upon completion.
|
|
133
175
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
176
|
+
Args:
|
|
177
|
+
file_path (str): The local path to the file to upload.
|
|
178
|
+
parent_id (str, optional): The ID of the folder to upload the file to. Defaults to 'root'.
|
|
179
|
+
file_name (str, optional): The name to give the uploaded file. If not provided, the local filename is used.
|
|
180
|
+
|
|
181
|
+
Returns:
|
|
182
|
+
A dictionary containing the uploaded file's metadata.
|
|
183
|
+
|
|
184
|
+
Tags:
|
|
185
|
+
upload, file, put, important
|
|
186
|
+
"""
|
|
187
|
+
if not os.path.exists(file_path):
|
|
188
|
+
raise FileNotFoundError(f"The file was not found at path: {file_path}")
|
|
189
|
+
|
|
190
|
+
if not file_name:
|
|
191
|
+
file_name = os.path.basename(file_path)
|
|
192
|
+
|
|
193
|
+
url = f"{self.base_url}/me/drive/items/{parent_id}:/{file_name}:/content"
|
|
194
|
+
with open(file_path, "rb") as f:
|
|
195
|
+
data = f.read()
|
|
196
|
+
response = self._put(url, data=data, content_type="application/octet-stream")
|
|
197
|
+
return self._handle_response(response)
|
|
198
|
+
|
|
199
|
+
def list_folders(self, item_id: str = "root") -> dict[str, Any]:
|
|
200
|
+
"""
|
|
201
|
+
Retrieves a list of only the folders within a specified parent directory in SharePoint. Unlike `_list_drive_items` which returns all items, this function filters the results to exclude files. Defaults to the root directory if no parent `item_id` is provided.
|
|
150
202
|
|
|
151
203
|
Args:
|
|
152
|
-
|
|
153
|
-
file_name (str): The name of the document to create.
|
|
154
|
-
content (str): The content to write into the document.
|
|
204
|
+
item_id (str, optional): The ID of the folder to list from. Defaults to 'root'.
|
|
155
205
|
|
|
156
206
|
Returns:
|
|
157
|
-
|
|
207
|
+
A dictionary containing the list of folders.
|
|
158
208
|
|
|
159
|
-
Tags:
|
|
209
|
+
Tags:
|
|
210
|
+
list, folders, directories, important
|
|
160
211
|
"""
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
file.upload_file(file_io).execute_query()
|
|
165
|
-
return self.list_documents(file_path)
|
|
212
|
+
all_items = self._list_drive_items(item_id=item_id)
|
|
213
|
+
folders = [item for item in all_items.get("value", []) if "folder" in item]
|
|
214
|
+
return {"value": folders}
|
|
166
215
|
|
|
167
|
-
def
|
|
216
|
+
def list_files(self, item_id: str = "root") -> dict[str, Any]:
|
|
168
217
|
"""
|
|
169
|
-
Retrieves a
|
|
218
|
+
Retrieves a list of files within a specified SharePoint folder, defaulting to the root. Unlike `_list_drive_items` which fetches all items, this function filters the results to exclusively return items identified as files, excluding any subdirectories.
|
|
170
219
|
|
|
171
220
|
Args:
|
|
172
|
-
|
|
221
|
+
item_id (str, optional): The ID of the folder to list files from. Defaults to 'root'.
|
|
173
222
|
|
|
174
223
|
Returns:
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
Tags:
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
224
|
+
A dictionary containing the list of files.
|
|
225
|
+
|
|
226
|
+
Tags:
|
|
227
|
+
list, files, documents, important
|
|
228
|
+
"""
|
|
229
|
+
all_items = self._list_drive_items(item_id=item_id)
|
|
230
|
+
files = [item for item in all_items.get("value", []) if "file" in item]
|
|
231
|
+
return {"value": files}
|
|
232
|
+
|
|
233
|
+
def create_folder_and_list(self, name: str, parent_id: str = "root") -> dict[str, Any]:
|
|
234
|
+
"""
|
|
235
|
+
Performs a composite action: creates a new folder, then lists all items (files and folders) within that parent directory. This confirms creation by returning the parent's updated contents, distinct from `create_folder` which only returns the new folder's metadata.
|
|
236
|
+
|
|
237
|
+
Args:
|
|
238
|
+
name (str): The name of the new folder.
|
|
239
|
+
parent_id (str, optional): The ID of the parent folder. Defaults to 'root'.
|
|
240
|
+
|
|
241
|
+
Returns:
|
|
242
|
+
A dictionary containing the list of items in the parent folder after creation.
|
|
243
|
+
|
|
244
|
+
Tags:
|
|
245
|
+
create, folder, list, important
|
|
246
|
+
"""
|
|
247
|
+
self.create_folder(name=name, parent_id=parent_id)
|
|
248
|
+
return self._list_drive_items(item_id=parent_id)
|
|
249
|
+
|
|
250
|
+
def upload_text_file(self, content: str, parent_id: str = "root", file_name: str = "new_file.txt") -> dict[str, Any]:
|
|
251
|
+
"""
|
|
252
|
+
Creates and uploads a new file to SharePoint directly from a string of text content. Unlike `upload_file`, which requires a local file path, this function is specifically for creating a text file from in-memory string data, with a customizable name and destination folder.
|
|
253
|
+
|
|
254
|
+
Args:
|
|
255
|
+
content (str): The text content to upload.
|
|
256
|
+
parent_id (str, optional): The ID of the folder to upload the file to. Defaults to 'root'.
|
|
257
|
+
file_name (str, optional): The name to give the uploaded file. Defaults to 'new_file.txt'.
|
|
258
|
+
|
|
259
|
+
Returns:
|
|
260
|
+
A dictionary containing the uploaded file's metadata.
|
|
261
|
+
|
|
262
|
+
Tags:
|
|
263
|
+
upload, text, file, create, important
|
|
264
|
+
"""
|
|
265
|
+
if not file_name:
|
|
266
|
+
raise ValueError("File name cannot be empty.")
|
|
267
|
+
|
|
268
|
+
url = f"{self.base_url}/me/drive/items/{parent_id}:/{file_name}:/content"
|
|
269
|
+
data = content.encode("utf-8")
|
|
270
|
+
response = self._put(url, data=data, content_type="text/plain")
|
|
271
|
+
return self._handle_response(response)
|
|
199
272
|
|
|
200
|
-
def
|
|
273
|
+
def get_document_content(self, item_id: str) -> dict[str, Any]:
|
|
201
274
|
"""
|
|
202
|
-
|
|
275
|
+
Retrieves the content of a specific file by its item ID and returns it directly as base64-encoded data. This function is distinct from `download_file`, which only provides a temporary URL for the content, and from `get_item_metadata`, which returns file attributes without the content itself. The function fetches the content by following the file's pre-authenticated download URL.
|
|
203
276
|
|
|
204
277
|
Args:
|
|
205
|
-
|
|
278
|
+
item_id (str): The ID of the file.
|
|
206
279
|
|
|
207
280
|
Returns:
|
|
208
|
-
|
|
281
|
+
dict[str, Any]: A dictionary containing the file details:
|
|
282
|
+
- 'type' (str): The general type of the file (e.g., "image", "audio", "video", "file").
|
|
283
|
+
- 'data' (str): The base64 encoded content of the file.
|
|
284
|
+
- 'mime_type' (str): The MIME type of the file.
|
|
285
|
+
- 'file_name' (str): The name of the file.
|
|
209
286
|
|
|
210
287
|
Tags:
|
|
211
|
-
important
|
|
288
|
+
get, content, read, file, important
|
|
212
289
|
"""
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
290
|
+
if not item_id:
|
|
291
|
+
raise ValueError("Missing required parameter 'item_id'.")
|
|
292
|
+
|
|
293
|
+
metadata = self.get_item_metadata(item_id=item_id)
|
|
294
|
+
file_metadata = metadata.get("file")
|
|
295
|
+
if not file_metadata:
|
|
296
|
+
raise ValueError(f"Item with ID '{item_id}' is not a file.")
|
|
297
|
+
|
|
298
|
+
file_mime_type = file_metadata.get("mimeType", "application/octet-stream")
|
|
299
|
+
file_name = metadata.get("name")
|
|
300
|
+
|
|
301
|
+
download_url = metadata.get("@microsoft.graph.downloadUrl")
|
|
302
|
+
if not download_url:
|
|
303
|
+
logger.error(f"Could not find @microsoft.graph.downloadUrl in metadata for item {item_id}")
|
|
304
|
+
raise ValueError("Could not retrieve download URL for the item.")
|
|
305
|
+
|
|
306
|
+
response = self._get(download_url)
|
|
307
|
+
|
|
308
|
+
response.raise_for_status()
|
|
309
|
+
|
|
310
|
+
content = response.content
|
|
311
|
+
|
|
312
|
+
attachment_type = file_mime_type.split("/")[0] if "/" in file_mime_type else "file"
|
|
313
|
+
if attachment_type not in ["image", "audio", "video", "text"]:
|
|
314
|
+
attachment_type = "file"
|
|
315
|
+
|
|
316
|
+
return {
|
|
317
|
+
"type": attachment_type,
|
|
318
|
+
"data": content,
|
|
319
|
+
"mime_type": file_mime_type,
|
|
320
|
+
"file_name": file_name,
|
|
321
|
+
}
|
|
216
322
|
|
|
217
323
|
def list_tools(self):
|
|
218
324
|
return [
|
|
325
|
+
self.get_drive_info,
|
|
326
|
+
self.search_files,
|
|
327
|
+
self.get_item_metadata,
|
|
328
|
+
self.create_folder,
|
|
329
|
+
self.delete_item,
|
|
330
|
+
self.download_file,
|
|
331
|
+
self.upload_file,
|
|
332
|
+
self.get_my_profile,
|
|
219
333
|
self.list_folders,
|
|
220
|
-
self.create_folder_and_list,
|
|
221
334
|
self.list_files,
|
|
335
|
+
self.create_folder_and_list,
|
|
222
336
|
self.upload_text_file,
|
|
223
337
|
self.get_document_content,
|
|
224
|
-
|
|
225
|
-
]
|
|
338
|
+
]
|