@mcp-z/mcp-drive 1.0.0
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.
- package/LICENSE +21 -0
- package/README.md +163 -0
- package/bin/server.js +5 -0
- package/dist/cjs/constants.d.cts +7 -0
- package/dist/cjs/constants.d.ts +7 -0
- package/dist/cjs/constants.js +18 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/index.d.cts +8 -0
- package/dist/cjs/index.d.ts +8 -0
- package/dist/cjs/index.js +314 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/lib/create-store.d.cts +2 -0
- package/dist/cjs/lib/create-store.d.ts +2 -0
- package/dist/cjs/lib/create-store.js +166 -0
- package/dist/cjs/lib/create-store.js.map +1 -0
- package/dist/cjs/lib/query-builder.d.cts +45 -0
- package/dist/cjs/lib/query-builder.d.ts +45 -0
- package/dist/cjs/lib/query-builder.js +219 -0
- package/dist/cjs/lib/query-builder.js.map +1 -0
- package/dist/cjs/mcp/index.d.cts +3 -0
- package/dist/cjs/mcp/index.d.ts +3 -0
- package/dist/cjs/mcp/index.js +66 -0
- package/dist/cjs/mcp/index.js.map +1 -0
- package/dist/cjs/mcp/prompts/index.d.cts +2 -0
- package/dist/cjs/mcp/prompts/index.d.ts +2 -0
- package/dist/cjs/mcp/prompts/index.js +26 -0
- package/dist/cjs/mcp/prompts/index.js.map +1 -0
- package/dist/cjs/mcp/prompts/organize-files.d.cts +16 -0
- package/dist/cjs/mcp/prompts/organize-files.d.ts +16 -0
- package/dist/cjs/mcp/prompts/organize-files.js +169 -0
- package/dist/cjs/mcp/prompts/organize-files.js.map +1 -0
- package/dist/cjs/mcp/prompts/query-syntax.d.cts +19 -0
- package/dist/cjs/mcp/prompts/query-syntax.d.ts +19 -0
- package/dist/cjs/mcp/prompts/query-syntax.js +169 -0
- package/dist/cjs/mcp/prompts/query-syntax.js.map +1 -0
- package/dist/cjs/mcp/resources/file.d.cts +9 -0
- package/dist/cjs/mcp/resources/file.d.ts +9 -0
- package/dist/cjs/mcp/resources/file.js +247 -0
- package/dist/cjs/mcp/resources/file.js.map +1 -0
- package/dist/cjs/mcp/resources/index.d.cts +1 -0
- package/dist/cjs/mcp/resources/index.d.ts +1 -0
- package/dist/cjs/mcp/resources/index.js +17 -0
- package/dist/cjs/mcp/resources/index.js.map +1 -0
- package/dist/cjs/mcp/tools/file-move-to-trash.d.cts +59 -0
- package/dist/cjs/mcp/tools/file-move-to-trash.d.ts +59 -0
- package/dist/cjs/mcp/tools/file-move-to-trash.js +334 -0
- package/dist/cjs/mcp/tools/file-move-to-trash.js.map +1 -0
- package/dist/cjs/mcp/tools/file-move.d.cts +73 -0
- package/dist/cjs/mcp/tools/file-move.d.ts +73 -0
- package/dist/cjs/mcp/tools/file-move.js +613 -0
- package/dist/cjs/mcp/tools/file-move.js.map +1 -0
- package/dist/cjs/mcp/tools/files-search.d.cts +135 -0
- package/dist/cjs/mcp/tools/files-search.d.ts +135 -0
- package/dist/cjs/mcp/tools/files-search.js +558 -0
- package/dist/cjs/mcp/tools/files-search.js.map +1 -0
- package/dist/cjs/mcp/tools/folder-contents.d.cts +139 -0
- package/dist/cjs/mcp/tools/folder-contents.d.ts +139 -0
- package/dist/cjs/mcp/tools/folder-contents.js +513 -0
- package/dist/cjs/mcp/tools/folder-contents.js.map +1 -0
- package/dist/cjs/mcp/tools/folder-create.d.cts +59 -0
- package/dist/cjs/mcp/tools/folder-create.d.ts +59 -0
- package/dist/cjs/mcp/tools/folder-create.js +368 -0
- package/dist/cjs/mcp/tools/folder-create.js.map +1 -0
- package/dist/cjs/mcp/tools/folder-path.d.cts +49 -0
- package/dist/cjs/mcp/tools/folder-path.d.ts +49 -0
- package/dist/cjs/mcp/tools/folder-path.js +367 -0
- package/dist/cjs/mcp/tools/folder-path.js.map +1 -0
- package/dist/cjs/mcp/tools/folder-search.d.cts +139 -0
- package/dist/cjs/mcp/tools/folder-search.d.ts +139 -0
- package/dist/cjs/mcp/tools/folder-search.js +760 -0
- package/dist/cjs/mcp/tools/folder-search.js.map +1 -0
- package/dist/cjs/mcp/tools/index.d.cts +7 -0
- package/dist/cjs/mcp/tools/index.d.ts +7 -0
- package/dist/cjs/mcp/tools/index.js +46 -0
- package/dist/cjs/mcp/tools/index.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/schemas/drive-query-schema.d.cts +40 -0
- package/dist/cjs/schemas/drive-query-schema.d.ts +40 -0
- package/dist/cjs/schemas/drive-query-schema.js +90 -0
- package/dist/cjs/schemas/drive-query-schema.js.map +1 -0
- package/dist/cjs/schemas/drive-validation.d.cts +48 -0
- package/dist/cjs/schemas/drive-validation.d.ts +48 -0
- package/dist/cjs/schemas/drive-validation.js +96 -0
- package/dist/cjs/schemas/drive-validation.js.map +1 -0
- package/dist/cjs/schemas/index.d.cts +2 -0
- package/dist/cjs/schemas/index.d.ts +2 -0
- package/dist/cjs/schemas/index.js +20 -0
- package/dist/cjs/schemas/index.js.map +1 -0
- package/dist/cjs/setup/config.d.cts +44 -0
- package/dist/cjs/setup/config.d.ts +44 -0
- package/dist/cjs/setup/config.js +201 -0
- package/dist/cjs/setup/config.js.map +1 -0
- package/dist/cjs/setup/http.d.cts +8 -0
- package/dist/cjs/setup/http.d.ts +8 -0
- package/dist/cjs/setup/http.js +260 -0
- package/dist/cjs/setup/http.js.map +1 -0
- package/dist/cjs/setup/index.d.cts +5 -0
- package/dist/cjs/setup/index.d.ts +5 -0
- package/dist/cjs/setup/index.js +46 -0
- package/dist/cjs/setup/index.js.map +1 -0
- package/dist/cjs/setup/oauth-google.d.cts +64 -0
- package/dist/cjs/setup/oauth-google.d.ts +64 -0
- package/dist/cjs/setup/oauth-google.js +347 -0
- package/dist/cjs/setup/oauth-google.js.map +1 -0
- package/dist/cjs/setup/runtime.d.cts +10 -0
- package/dist/cjs/setup/runtime.d.ts +10 -0
- package/dist/cjs/setup/runtime.js +353 -0
- package/dist/cjs/setup/runtime.js.map +1 -0
- package/dist/cjs/setup/stdio.d.cts +7 -0
- package/dist/cjs/setup/stdio.d.ts +7 -0
- package/dist/cjs/setup/stdio.js +239 -0
- package/dist/cjs/setup/stdio.js.map +1 -0
- package/dist/cjs/types.d.cts +45 -0
- package/dist/cjs/types.d.ts +45 -0
- package/dist/cjs/types.js +5 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/esm/constants.d.ts +7 -0
- package/dist/esm/constants.js +7 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/index.d.ts +8 -0
- package/dist/esm/index.js +34 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lib/create-store.d.ts +2 -0
- package/dist/esm/lib/create-store.js +6 -0
- package/dist/esm/lib/create-store.js.map +1 -0
- package/dist/esm/lib/query-builder.d.ts +45 -0
- package/dist/esm/lib/query-builder.js +184 -0
- package/dist/esm/lib/query-builder.js.map +1 -0
- package/dist/esm/mcp/index.d.ts +3 -0
- package/dist/esm/mcp/index.js +6 -0
- package/dist/esm/mcp/index.js.map +1 -0
- package/dist/esm/mcp/prompts/index.d.ts +2 -0
- package/dist/esm/mcp/prompts/index.js +2 -0
- package/dist/esm/mcp/prompts/index.js.map +1 -0
- package/dist/esm/mcp/prompts/organize-files.d.ts +16 -0
- package/dist/esm/mcp/prompts/organize-files.js +21 -0
- package/dist/esm/mcp/prompts/organize-files.js.map +1 -0
- package/dist/esm/mcp/prompts/query-syntax.d.ts +19 -0
- package/dist/esm/mcp/prompts/query-syntax.js +82 -0
- package/dist/esm/mcp/prompts/query-syntax.js.map +1 -0
- package/dist/esm/mcp/resources/file.d.ts +9 -0
- package/dist/esm/mcp/resources/file.js +77 -0
- package/dist/esm/mcp/resources/file.js.map +1 -0
- package/dist/esm/mcp/resources/index.d.ts +1 -0
- package/dist/esm/mcp/resources/index.js +1 -0
- package/dist/esm/mcp/resources/index.js.map +1 -0
- package/dist/esm/mcp/tools/file-move-to-trash.d.ts +59 -0
- package/dist/esm/mcp/tools/file-move-to-trash.js +118 -0
- package/dist/esm/mcp/tools/file-move-to-trash.js.map +1 -0
- package/dist/esm/mcp/tools/file-move.d.ts +73 -0
- package/dist/esm/mcp/tools/file-move.js +274 -0
- package/dist/esm/mcp/tools/file-move.js.map +1 -0
- package/dist/esm/mcp/tools/files-search.d.ts +135 -0
- package/dist/esm/mcp/tools/files-search.js +254 -0
- package/dist/esm/mcp/tools/files-search.js.map +1 -0
- package/dist/esm/mcp/tools/folder-contents.d.ts +139 -0
- package/dist/esm/mcp/tools/folder-contents.js +214 -0
- package/dist/esm/mcp/tools/folder-contents.js.map +1 -0
- package/dist/esm/mcp/tools/folder-create.d.ts +59 -0
- package/dist/esm/mcp/tools/folder-create.js +140 -0
- package/dist/esm/mcp/tools/folder-create.js.map +1 -0
- package/dist/esm/mcp/tools/folder-path.d.ts +49 -0
- package/dist/esm/mcp/tools/folder-path.js +147 -0
- package/dist/esm/mcp/tools/folder-path.js.map +1 -0
- package/dist/esm/mcp/tools/folder-search.d.ts +139 -0
- package/dist/esm/mcp/tools/folder-search.js +343 -0
- package/dist/esm/mcp/tools/folder-search.js.map +1 -0
- package/dist/esm/mcp/tools/index.d.ts +7 -0
- package/dist/esm/mcp/tools/index.js +7 -0
- package/dist/esm/mcp/tools/index.js.map +1 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/schemas/drive-query-schema.d.ts +40 -0
- package/dist/esm/schemas/drive-query-schema.js +84 -0
- package/dist/esm/schemas/drive-query-schema.js.map +1 -0
- package/dist/esm/schemas/drive-validation.d.ts +48 -0
- package/dist/esm/schemas/drive-validation.js +73 -0
- package/dist/esm/schemas/drive-validation.js.map +1 -0
- package/dist/esm/schemas/index.d.ts +2 -0
- package/dist/esm/schemas/index.js +2 -0
- package/dist/esm/schemas/index.js.map +1 -0
- package/dist/esm/setup/config.d.ts +44 -0
- package/dist/esm/setup/config.js +151 -0
- package/dist/esm/setup/config.js.map +1 -0
- package/dist/esm/setup/http.d.ts +8 -0
- package/dist/esm/setup/http.js +54 -0
- package/dist/esm/setup/http.js.map +1 -0
- package/dist/esm/setup/index.d.ts +5 -0
- package/dist/esm/setup/index.js +5 -0
- package/dist/esm/setup/index.js.map +1 -0
- package/dist/esm/setup/oauth-google.d.ts +64 -0
- package/dist/esm/setup/oauth-google.js +168 -0
- package/dist/esm/setup/oauth-google.js.map +1 -0
- package/dist/esm/setup/runtime.d.ts +10 -0
- package/dist/esm/setup/runtime.js +84 -0
- package/dist/esm/setup/runtime.js.map +1 -0
- package/dist/esm/setup/stdio.d.ts +7 -0
- package/dist/esm/setup/stdio.js +38 -0
- package/dist/esm/setup/stdio.js.map +1 -0
- package/dist/esm/types.d.ts +45 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/types.js.map +1 -0
- package/package.json +108 -0
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return createTool;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var _oauthgoogle = require("@mcp-z/oauth-google");
|
|
12
|
+
var _types = require("@modelcontextprotocol/sdk/types.js");
|
|
13
|
+
var _googleapis = require("googleapis");
|
|
14
|
+
var _zod = require("zod");
|
|
15
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
16
|
+
try {
|
|
17
|
+
var info = gen[key](arg);
|
|
18
|
+
var value = info.value;
|
|
19
|
+
} catch (error) {
|
|
20
|
+
reject(error);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (info.done) {
|
|
24
|
+
resolve(value);
|
|
25
|
+
} else {
|
|
26
|
+
Promise.resolve(value).then(_next, _throw);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function _async_to_generator(fn) {
|
|
30
|
+
return function() {
|
|
31
|
+
var self = this, args = arguments;
|
|
32
|
+
return new Promise(function(resolve, reject) {
|
|
33
|
+
var gen = fn.apply(self, args);
|
|
34
|
+
function _next(value) {
|
|
35
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
36
|
+
}
|
|
37
|
+
function _throw(err) {
|
|
38
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
39
|
+
}
|
|
40
|
+
_next(undefined);
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function _define_property(obj, key, value) {
|
|
45
|
+
if (key in obj) {
|
|
46
|
+
Object.defineProperty(obj, key, {
|
|
47
|
+
value: value,
|
|
48
|
+
enumerable: true,
|
|
49
|
+
configurable: true,
|
|
50
|
+
writable: true
|
|
51
|
+
});
|
|
52
|
+
} else {
|
|
53
|
+
obj[key] = value;
|
|
54
|
+
}
|
|
55
|
+
return obj;
|
|
56
|
+
}
|
|
57
|
+
function _instanceof(left, right) {
|
|
58
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
59
|
+
return !!right[Symbol.hasInstance](left);
|
|
60
|
+
} else {
|
|
61
|
+
return left instanceof right;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function _object_spread(target) {
|
|
65
|
+
for(var i = 1; i < arguments.length; i++){
|
|
66
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
67
|
+
var ownKeys = Object.keys(source);
|
|
68
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
69
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
70
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
ownKeys.forEach(function(key) {
|
|
74
|
+
_define_property(target, key, source[key]);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
return target;
|
|
78
|
+
}
|
|
79
|
+
function _ts_generator(thisArg, body) {
|
|
80
|
+
var f, y, t, _ = {
|
|
81
|
+
label: 0,
|
|
82
|
+
sent: function() {
|
|
83
|
+
if (t[0] & 1) throw t[1];
|
|
84
|
+
return t[1];
|
|
85
|
+
},
|
|
86
|
+
trys: [],
|
|
87
|
+
ops: []
|
|
88
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
89
|
+
return d(g, "next", {
|
|
90
|
+
value: verb(0)
|
|
91
|
+
}), d(g, "throw", {
|
|
92
|
+
value: verb(1)
|
|
93
|
+
}), d(g, "return", {
|
|
94
|
+
value: verb(2)
|
|
95
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
96
|
+
value: function() {
|
|
97
|
+
return this;
|
|
98
|
+
}
|
|
99
|
+
}), g;
|
|
100
|
+
function verb(n) {
|
|
101
|
+
return function(v) {
|
|
102
|
+
return step([
|
|
103
|
+
n,
|
|
104
|
+
v
|
|
105
|
+
]);
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function step(op) {
|
|
109
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
110
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
111
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
112
|
+
if (y = 0, t) op = [
|
|
113
|
+
op[0] & 2,
|
|
114
|
+
t.value
|
|
115
|
+
];
|
|
116
|
+
switch(op[0]){
|
|
117
|
+
case 0:
|
|
118
|
+
case 1:
|
|
119
|
+
t = op;
|
|
120
|
+
break;
|
|
121
|
+
case 4:
|
|
122
|
+
_.label++;
|
|
123
|
+
return {
|
|
124
|
+
value: op[1],
|
|
125
|
+
done: false
|
|
126
|
+
};
|
|
127
|
+
case 5:
|
|
128
|
+
_.label++;
|
|
129
|
+
y = op[1];
|
|
130
|
+
op = [
|
|
131
|
+
0
|
|
132
|
+
];
|
|
133
|
+
continue;
|
|
134
|
+
case 7:
|
|
135
|
+
op = _.ops.pop();
|
|
136
|
+
_.trys.pop();
|
|
137
|
+
continue;
|
|
138
|
+
default:
|
|
139
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
140
|
+
_ = 0;
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
144
|
+
_.label = op[1];
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
148
|
+
_.label = t[1];
|
|
149
|
+
t = op;
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
if (t && _.label < t[2]) {
|
|
153
|
+
_.label = t[2];
|
|
154
|
+
_.ops.push(op);
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
if (t[2]) _.ops.pop();
|
|
158
|
+
_.trys.pop();
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
op = body.call(thisArg, _);
|
|
162
|
+
} catch (e) {
|
|
163
|
+
op = [
|
|
164
|
+
6,
|
|
165
|
+
e
|
|
166
|
+
];
|
|
167
|
+
y = 0;
|
|
168
|
+
} finally{
|
|
169
|
+
f = t = 0;
|
|
170
|
+
}
|
|
171
|
+
if (op[0] & 5) throw op[1];
|
|
172
|
+
return {
|
|
173
|
+
value: op[0] ? op[1] : void 0,
|
|
174
|
+
done: true
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
var AuthRequiredBranchSchema = _oauthgoogle.schemas.AuthRequiredBranchSchema;
|
|
179
|
+
var inputSchema = _zod.z.object({
|
|
180
|
+
name: _zod.z.string().trim().min(1).describe('Name for the new folder'),
|
|
181
|
+
parentId: _zod.z.string().optional().describe('Parent folder ID (omit to create in My Drive root)')
|
|
182
|
+
});
|
|
183
|
+
// Success branch schema
|
|
184
|
+
var successBranchSchema = _zod.z.object({
|
|
185
|
+
type: _zod.z.literal('success'),
|
|
186
|
+
operationSummary: _zod.z.string().describe('Summary of the folder creation operation'),
|
|
187
|
+
itemsProcessed: _zod.z.number().describe('Total items attempted (always 1 for single folder)'),
|
|
188
|
+
itemsChanged: _zod.z.number().describe('Successfully created folders (always 1 on success)'),
|
|
189
|
+
completedAt: _zod.z.string().describe('ISO datetime when operation completed'),
|
|
190
|
+
id: _zod.z.string().describe('ID of the created folder'),
|
|
191
|
+
name: _zod.z.string().describe('Name of the created folder'),
|
|
192
|
+
webViewLink: _zod.z.string().describe('URL to view the folder in Drive'),
|
|
193
|
+
parentId: _zod.z.string().optional().describe('ID of the parent folder'),
|
|
194
|
+
parentName: _zod.z.string().optional().describe('Name of the parent folder')
|
|
195
|
+
});
|
|
196
|
+
// Output schema with auth_required support
|
|
197
|
+
var outputSchema = _zod.z.discriminatedUnion('type', [
|
|
198
|
+
successBranchSchema,
|
|
199
|
+
AuthRequiredBranchSchema
|
|
200
|
+
]);
|
|
201
|
+
var config = {
|
|
202
|
+
title: 'Create Folder',
|
|
203
|
+
description: 'Create a new folder in Google Drive. Returns folder ID for use in other operations.',
|
|
204
|
+
inputSchema: inputSchema,
|
|
205
|
+
outputSchema: _zod.z.object({
|
|
206
|
+
result: outputSchema
|
|
207
|
+
})
|
|
208
|
+
};
|
|
209
|
+
function handler(_0, _1) {
|
|
210
|
+
return _async_to_generator(function(param, extra) {
|
|
211
|
+
var folderName, parentId, logger, _res_id, _res_name, _res_webViewLink, drive, folderMimeType, response, res, id, name, webViewLink, parents, parentName, actualParentId, parentResponse, e, locationSummary, result, error, message;
|
|
212
|
+
return _ts_generator(this, function(_state) {
|
|
213
|
+
switch(_state.label){
|
|
214
|
+
case 0:
|
|
215
|
+
folderName = param.name, parentId = param.parentId;
|
|
216
|
+
logger = extra.logger;
|
|
217
|
+
logger.info('drive.folder.create called', {
|
|
218
|
+
name: folderName,
|
|
219
|
+
parentId: parentId || 'root'
|
|
220
|
+
});
|
|
221
|
+
_state.label = 1;
|
|
222
|
+
case 1:
|
|
223
|
+
_state.trys.push([
|
|
224
|
+
1,
|
|
225
|
+
8,
|
|
226
|
+
,
|
|
227
|
+
9
|
|
228
|
+
]);
|
|
229
|
+
drive = _googleapis.google.drive({
|
|
230
|
+
version: 'v3',
|
|
231
|
+
auth: extra.authContext.auth
|
|
232
|
+
});
|
|
233
|
+
// Folder MIME type constant (consistent with folder-search.ts)
|
|
234
|
+
folderMimeType = 'application/vnd.google-apps.folder';
|
|
235
|
+
return [
|
|
236
|
+
4,
|
|
237
|
+
drive.files.create({
|
|
238
|
+
requestBody: {
|
|
239
|
+
name: folderName,
|
|
240
|
+
mimeType: folderMimeType,
|
|
241
|
+
parents: parentId ? [
|
|
242
|
+
parentId
|
|
243
|
+
] : null
|
|
244
|
+
},
|
|
245
|
+
fields: 'id,name,webViewLink,parents'
|
|
246
|
+
})
|
|
247
|
+
];
|
|
248
|
+
case 2:
|
|
249
|
+
response = _state.sent();
|
|
250
|
+
res = response.data;
|
|
251
|
+
id = (_res_id = res.id) !== null && _res_id !== void 0 ? _res_id : '';
|
|
252
|
+
name = (_res_name = res.name) !== null && _res_name !== void 0 ? _res_name : folderName;
|
|
253
|
+
webViewLink = (_res_webViewLink = res.webViewLink) !== null && _res_webViewLink !== void 0 ? _res_webViewLink : '';
|
|
254
|
+
parents = res.parents || [];
|
|
255
|
+
if (!(parents.length > 0)) return [
|
|
256
|
+
3,
|
|
257
|
+
7
|
|
258
|
+
];
|
|
259
|
+
actualParentId = parents[0];
|
|
260
|
+
if (!(actualParentId === 'root')) return [
|
|
261
|
+
3,
|
|
262
|
+
3
|
|
263
|
+
];
|
|
264
|
+
parentName = 'My Drive';
|
|
265
|
+
return [
|
|
266
|
+
3,
|
|
267
|
+
7
|
|
268
|
+
];
|
|
269
|
+
case 3:
|
|
270
|
+
if (!actualParentId) return [
|
|
271
|
+
3,
|
|
272
|
+
7
|
|
273
|
+
];
|
|
274
|
+
_state.label = 4;
|
|
275
|
+
case 4:
|
|
276
|
+
_state.trys.push([
|
|
277
|
+
4,
|
|
278
|
+
6,
|
|
279
|
+
,
|
|
280
|
+
7
|
|
281
|
+
]);
|
|
282
|
+
return [
|
|
283
|
+
4,
|
|
284
|
+
drive.files.get({
|
|
285
|
+
fileId: actualParentId,
|
|
286
|
+
fields: 'name'
|
|
287
|
+
})
|
|
288
|
+
];
|
|
289
|
+
case 5:
|
|
290
|
+
parentResponse = _state.sent();
|
|
291
|
+
parentName = parentResponse.data.name || actualParentId;
|
|
292
|
+
return [
|
|
293
|
+
3,
|
|
294
|
+
7
|
|
295
|
+
];
|
|
296
|
+
case 6:
|
|
297
|
+
e = _state.sent();
|
|
298
|
+
logger.info('Failed to fetch parent name', {
|
|
299
|
+
parentId: actualParentId,
|
|
300
|
+
error: e
|
|
301
|
+
});
|
|
302
|
+
parentName = actualParentId; // Fallback to ID
|
|
303
|
+
return [
|
|
304
|
+
3,
|
|
305
|
+
7
|
|
306
|
+
];
|
|
307
|
+
case 7:
|
|
308
|
+
locationSummary = parentName ? ' in "'.concat(parentName, '"') : ' in My Drive';
|
|
309
|
+
logger.info('drive.folder.create success', {
|
|
310
|
+
id: id,
|
|
311
|
+
name: name,
|
|
312
|
+
parentId: actualParentId
|
|
313
|
+
});
|
|
314
|
+
// Build result object with operation metadata
|
|
315
|
+
result = _object_spread({
|
|
316
|
+
type: 'success',
|
|
317
|
+
operationSummary: 'Created folder "'.concat(name, '"').concat(locationSummary),
|
|
318
|
+
itemsProcessed: 1,
|
|
319
|
+
itemsChanged: 1,
|
|
320
|
+
completedAt: new Date().toISOString(),
|
|
321
|
+
id: id,
|
|
322
|
+
name: name,
|
|
323
|
+
webViewLink: webViewLink
|
|
324
|
+
}, actualParentId && {
|
|
325
|
+
parentId: actualParentId
|
|
326
|
+
}, parentName && {
|
|
327
|
+
parentName: parentName
|
|
328
|
+
});
|
|
329
|
+
return [
|
|
330
|
+
2,
|
|
331
|
+
{
|
|
332
|
+
content: [
|
|
333
|
+
{
|
|
334
|
+
type: 'text',
|
|
335
|
+
text: JSON.stringify(result)
|
|
336
|
+
}
|
|
337
|
+
],
|
|
338
|
+
structuredContent: {
|
|
339
|
+
result: result
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
];
|
|
343
|
+
case 8:
|
|
344
|
+
error = _state.sent();
|
|
345
|
+
message = _instanceof(error, Error) ? error.message : String(error);
|
|
346
|
+
logger.error('drive.folder.create error', {
|
|
347
|
+
error: message
|
|
348
|
+
});
|
|
349
|
+
// Throw McpError for proper MCP error handling
|
|
350
|
+
throw new _types.McpError(_types.ErrorCode.InternalError, "Error creating folder: ".concat(message), {
|
|
351
|
+
stack: _instanceof(error, Error) ? error.stack : undefined
|
|
352
|
+
});
|
|
353
|
+
case 9:
|
|
354
|
+
return [
|
|
355
|
+
2
|
|
356
|
+
];
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
}).apply(this, arguments);
|
|
360
|
+
}
|
|
361
|
+
function createTool() {
|
|
362
|
+
return {
|
|
363
|
+
name: 'folder-create',
|
|
364
|
+
config: config,
|
|
365
|
+
handler: handler
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/Projects/ai/mcp-z/servers/mcp-drive/src/mcp/tools/folder-create.ts"],"sourcesContent":["import type { EnrichedExtra } from '@mcp-z/oauth-google';\nimport { schemas } from '@mcp-z/oauth-google';\n\nconst { AuthRequiredBranchSchema } = schemas;\n\nimport type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';\nimport { ErrorCode, McpError } from '@modelcontextprotocol/sdk/types.js';\nimport { google } from 'googleapis';\nimport { z } from 'zod';\n\nconst inputSchema = z.object({\n name: z.string().trim().min(1).describe('Name for the new folder'),\n parentId: z.string().optional().describe('Parent folder ID (omit to create in My Drive root)'),\n});\n\n// Success branch schema\nconst successBranchSchema = z.object({\n type: z.literal('success'),\n operationSummary: z.string().describe('Summary of the folder creation operation'),\n itemsProcessed: z.number().describe('Total items attempted (always 1 for single folder)'),\n itemsChanged: z.number().describe('Successfully created folders (always 1 on success)'),\n completedAt: z.string().describe('ISO datetime when operation completed'),\n id: z.string().describe('ID of the created folder'),\n name: z.string().describe('Name of the created folder'),\n webViewLink: z.string().describe('URL to view the folder in Drive'),\n parentId: z.string().optional().describe('ID of the parent folder'),\n parentName: z.string().optional().describe('Name of the parent folder'),\n});\n\n// Output schema with auth_required support\nconst outputSchema = z.discriminatedUnion('type', [successBranchSchema, AuthRequiredBranchSchema]);\n\nconst config = {\n title: 'Create Folder',\n description: 'Create a new folder in Google Drive. Returns folder ID for use in other operations.',\n inputSchema,\n outputSchema: z.object({\n result: outputSchema,\n }),\n} as const;\n\n// Export types for strong typing in tests\nexport type Input = z.infer<typeof inputSchema>;\nexport type Output = z.infer<typeof outputSchema>;\n\nasync function handler({ name: folderName, parentId }: Input, extra: EnrichedExtra): Promise<CallToolResult> {\n const logger = extra.logger;\n logger.info('drive.folder.create called', {\n name: folderName,\n parentId: parentId || 'root',\n });\n\n try {\n const drive = google.drive({ version: 'v3', auth: extra.authContext.auth });\n\n // Folder MIME type constant (consistent with folder-search.ts)\n const folderMimeType = 'application/vnd.google-apps.folder';\n\n // Create the folder\n const response = await drive.files.create({\n requestBody: {\n name: folderName,\n mimeType: folderMimeType,\n parents: parentId ? [parentId] : null,\n },\n fields: 'id,name,webViewLink,parents',\n });\n\n const res = response.data;\n const id = res.id ?? '';\n const name = res.name ?? folderName;\n const webViewLink = res.webViewLink ?? '';\n const parents = (res.parents as string[] | undefined) || [];\n\n // Fetch parent name if parentId was provided\n let parentName: string | undefined;\n let actualParentId: string | undefined;\n\n if (parents.length > 0) {\n actualParentId = parents[0];\n\n if (actualParentId === 'root') {\n parentName = 'My Drive';\n } else if (actualParentId) {\n try {\n const parentResponse = await drive.files.get({\n fileId: actualParentId,\n fields: 'name',\n });\n parentName = (parentResponse.data.name as string | undefined) || actualParentId;\n } catch (e) {\n logger.info('Failed to fetch parent name', {\n parentId: actualParentId,\n error: e,\n });\n parentName = actualParentId; // Fallback to ID\n }\n }\n }\n\n const locationSummary = parentName ? ` in \"${parentName}\"` : ' in My Drive';\n\n logger.info('drive.folder.create success', {\n id,\n name,\n parentId: actualParentId,\n });\n\n // Build result object with operation metadata\n const result: Output = {\n type: 'success' as const,\n operationSummary: `Created folder \"${name}\"${locationSummary}`,\n itemsProcessed: 1,\n itemsChanged: 1,\n completedAt: new Date().toISOString(),\n id,\n name,\n webViewLink,\n ...(actualParentId && { parentId: actualParentId }),\n ...(parentName && { parentName }),\n };\n\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify(result),\n },\n ],\n structuredContent: { result },\n };\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n logger.error('drive.folder.create error', { error: message });\n\n // Throw McpError for proper MCP error handling\n throw new McpError(ErrorCode.InternalError, `Error creating folder: ${message}`, {\n stack: error instanceof Error ? error.stack : undefined,\n });\n }\n}\n\nexport default function createTool() {\n return {\n name: 'folder-create' as const,\n config,\n handler,\n };\n}\n"],"names":["createTool","AuthRequiredBranchSchema","schemas","inputSchema","z","object","name","string","trim","min","describe","parentId","optional","successBranchSchema","type","literal","operationSummary","itemsProcessed","number","itemsChanged","completedAt","id","webViewLink","parentName","outputSchema","discriminatedUnion","config","title","description","result","handler","extra","folderName","logger","res","drive","folderMimeType","response","parents","actualParentId","parentResponse","e","locationSummary","error","message","info","google","version","auth","authContext","files","create","requestBody","mimeType","fields","data","length","get","fileId","Date","toISOString","content","text","JSON","stringify","structuredContent","Error","String","McpError","ErrorCode","InternalError","stack","undefined"],"mappings":";;;;+BA8IA;;;eAAwBA;;;2BA7IA;qBAKY;0BACb;mBACL;;;;;;;;;;;;;;;;;;;;;;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F;AACF"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { EnrichedExtra } from '@mcp-z/oauth-google';
|
|
2
|
+
import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
declare const inputSchema: z.ZodObject<{
|
|
5
|
+
folderId: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
declare const outputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
8
|
+
type: z.ZodLiteral<"success">;
|
|
9
|
+
path: z.ZodString;
|
|
10
|
+
items: z.ZodArray<z.ZodObject<{
|
|
11
|
+
id: z.ZodString;
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
15
|
+
type: z.ZodLiteral<"auth_required">;
|
|
16
|
+
provider: z.ZodString;
|
|
17
|
+
message: z.ZodString;
|
|
18
|
+
url: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$strip>], "type">;
|
|
20
|
+
export type Input = z.infer<typeof inputSchema>;
|
|
21
|
+
export type Output = z.infer<typeof outputSchema>;
|
|
22
|
+
declare function handler({ folderId }: Input, extra: EnrichedExtra): Promise<CallToolResult>;
|
|
23
|
+
export default function createTool(): {
|
|
24
|
+
name: "folder-path";
|
|
25
|
+
config: {
|
|
26
|
+
readonly title: "Get Folder Path";
|
|
27
|
+
readonly description: "Get full path from folder to root. Returns human-readable path and items with IDs.";
|
|
28
|
+
readonly inputSchema: z.ZodObject<{
|
|
29
|
+
folderId: z.ZodString;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
readonly outputSchema: z.ZodObject<{
|
|
32
|
+
result: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
33
|
+
type: z.ZodLiteral<"success">;
|
|
34
|
+
path: z.ZodString;
|
|
35
|
+
items: z.ZodArray<z.ZodObject<{
|
|
36
|
+
id: z.ZodString;
|
|
37
|
+
name: z.ZodString;
|
|
38
|
+
}, z.core.$strip>>;
|
|
39
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
40
|
+
type: z.ZodLiteral<"auth_required">;
|
|
41
|
+
provider: z.ZodString;
|
|
42
|
+
message: z.ZodString;
|
|
43
|
+
url: z.ZodOptional<z.ZodString>;
|
|
44
|
+
}, z.core.$strip>], "type">;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
};
|
|
47
|
+
handler: typeof handler;
|
|
48
|
+
};
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { EnrichedExtra } from '@mcp-z/oauth-google';
|
|
2
|
+
import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
declare const inputSchema: z.ZodObject<{
|
|
5
|
+
folderId: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
declare const outputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
8
|
+
type: z.ZodLiteral<"success">;
|
|
9
|
+
path: z.ZodString;
|
|
10
|
+
items: z.ZodArray<z.ZodObject<{
|
|
11
|
+
id: z.ZodString;
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
15
|
+
type: z.ZodLiteral<"auth_required">;
|
|
16
|
+
provider: z.ZodString;
|
|
17
|
+
message: z.ZodString;
|
|
18
|
+
url: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$strip>], "type">;
|
|
20
|
+
export type Input = z.infer<typeof inputSchema>;
|
|
21
|
+
export type Output = z.infer<typeof outputSchema>;
|
|
22
|
+
declare function handler({ folderId }: Input, extra: EnrichedExtra): Promise<CallToolResult>;
|
|
23
|
+
export default function createTool(): {
|
|
24
|
+
name: "folder-path";
|
|
25
|
+
config: {
|
|
26
|
+
readonly title: "Get Folder Path";
|
|
27
|
+
readonly description: "Get full path from folder to root. Returns human-readable path and items with IDs.";
|
|
28
|
+
readonly inputSchema: z.ZodObject<{
|
|
29
|
+
folderId: z.ZodString;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
readonly outputSchema: z.ZodObject<{
|
|
32
|
+
result: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
33
|
+
type: z.ZodLiteral<"success">;
|
|
34
|
+
path: z.ZodString;
|
|
35
|
+
items: z.ZodArray<z.ZodObject<{
|
|
36
|
+
id: z.ZodString;
|
|
37
|
+
name: z.ZodString;
|
|
38
|
+
}, z.core.$strip>>;
|
|
39
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
40
|
+
type: z.ZodLiteral<"auth_required">;
|
|
41
|
+
provider: z.ZodString;
|
|
42
|
+
message: z.ZodString;
|
|
43
|
+
url: z.ZodOptional<z.ZodString>;
|
|
44
|
+
}, z.core.$strip>], "type">;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
};
|
|
47
|
+
handler: typeof handler;
|
|
48
|
+
};
|
|
49
|
+
export {};
|