@mindstone/mcp-server-google-workspace 0.4.2 → 0.5.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/README.md +43 -5
- package/dist/modules/docs/service.d.ts +76 -6
- package/dist/modules/docs/service.js +791 -103
- package/dist/modules/docs/tabCopy.d.ts +266 -0
- package/dist/modules/docs/tabCopy.js +794 -0
- package/dist/modules/docs/tabs.d.ts +161 -0
- package/dist/modules/docs/tabs.js +416 -0
- package/dist/modules/docs/types.d.ts +141 -1
- package/dist/modules/drive/service.d.ts +15 -0
- package/dist/modules/drive/service.js +77 -2
- package/dist/modules/drive/types.d.ts +1 -1
- package/dist/modules/sheets/a1Utils.d.ts +13 -0
- package/dist/modules/sheets/a1Utils.js +33 -7
- package/dist/modules/sheets/formatters.d.ts +33 -2
- package/dist/modules/sheets/formatters.js +84 -5
- package/dist/modules/sheets/service.d.ts +26 -1
- package/dist/modules/sheets/service.js +264 -8
- package/dist/modules/sheets/types.d.ts +71 -0
- package/dist/modules/sheets/types.js +12 -1
- package/dist/modules/sheets/writeGuards.js +2 -2
- package/dist/tools/definitions/destructive-overrides.json +8 -0
- package/dist/tools/definitions/docs.js +395 -9
- package/dist/tools/definitions/drive.js +9 -4
- package/dist/tools/definitions/open-world-overrides.json +8 -0
- package/dist/tools/definitions/sheets.js +177 -1
- package/dist/tools/docs-handlers.d.ts +125 -0
- package/dist/tools/docs-handlers.js +397 -15
- package/dist/tools/param-normalizer.js +16 -0
- package/dist/tools/server.js +35 -3
- package/dist/tools/sheets-handlers.d.ts +54 -1
- package/dist/tools/sheets-handlers.js +107 -13
- package/dist/tools/type-guards.d.ts +89 -0
- package/dist/tools/type-guards.js +190 -6
- package/dist/tools/types.d.ts +1 -1
- package/dist/utils/apiError.d.ts +6 -0
- package/dist/utils/apiError.js +12 -0
- package/dist/utils/tabPosition.d.ts +20 -0
- package/dist/utils/tabPosition.js +19 -0
- package/package.json +1 -1
package/dist/utils/apiError.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { wrapUntrustedContent } from './untrusted-content.js';
|
|
2
3
|
/**
|
|
3
4
|
* Extracts the HTTP status from a googleapis (GaxiosError-shaped) failure,
|
|
4
5
|
* preferring `response.status` and falling back to a top-level `status` or a
|
|
@@ -30,6 +31,17 @@ export function describeApiError(error) {
|
|
|
30
31
|
const status = extractHttpStatus(error);
|
|
31
32
|
return status !== undefined ? `${message} (status ${status})` : message;
|
|
32
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* describeApiError with the error message wrapped as untrusted content (the
|
|
36
|
+
* HTTP status stays outside). Google's error text can quote request or
|
|
37
|
+
* document content, so results that reach the model carry it enveloped.
|
|
38
|
+
*/
|
|
39
|
+
export function describeApiErrorUntrusted(error, source) {
|
|
40
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
41
|
+
const status = extractHttpStatus(error);
|
|
42
|
+
const wrapped = wrapUntrustedContent(message, source);
|
|
43
|
+
return status !== undefined ? `${wrapped} (status ${status})` : wrapped;
|
|
44
|
+
}
|
|
33
45
|
/**
|
|
34
46
|
* Structural check for this connector's domain error classes (GmailError,
|
|
35
47
|
* CalendarError, ContactsError, GoogleServiceError). They all share a
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Index arithmetic for moving a tab (a Docs tab or a Sheets sheet) to a new
|
|
3
|
+
* position among its siblings.
|
|
4
|
+
*
|
|
5
|
+
* Both Docs `updateDocumentTabProperties.index` and Sheets
|
|
6
|
+
* `updateSheetProperties.index` count positions *before* the moved item is
|
|
7
|
+
* removed from its current place. Moving a tab forward within the same parent
|
|
8
|
+
* therefore needs one more than the final position (moving A in [A, B, C] to
|
|
9
|
+
* position 1 means index 2; index 1 would be a no-op). Moves backwards, and
|
|
10
|
+
* moves to a different parent, use the final position unchanged.
|
|
11
|
+
*
|
|
12
|
+
* `targetPosition` is the 0-based position the tab should end up at among its
|
|
13
|
+
* destination siblings (not counting the tab itself).
|
|
14
|
+
*/
|
|
15
|
+
export declare function computeMoveApiIndex(args: {
|
|
16
|
+
sameParent: boolean;
|
|
17
|
+
currentIndex: number;
|
|
18
|
+
targetPosition: number;
|
|
19
|
+
}): number;
|
|
20
|
+
//# sourceMappingURL=tabPosition.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Index arithmetic for moving a tab (a Docs tab or a Sheets sheet) to a new
|
|
3
|
+
* position among its siblings.
|
|
4
|
+
*
|
|
5
|
+
* Both Docs `updateDocumentTabProperties.index` and Sheets
|
|
6
|
+
* `updateSheetProperties.index` count positions *before* the moved item is
|
|
7
|
+
* removed from its current place. Moving a tab forward within the same parent
|
|
8
|
+
* therefore needs one more than the final position (moving A in [A, B, C] to
|
|
9
|
+
* position 1 means index 2; index 1 would be a no-op). Moves backwards, and
|
|
10
|
+
* moves to a different parent, use the final position unchanged.
|
|
11
|
+
*
|
|
12
|
+
* `targetPosition` is the 0-based position the tab should end up at among its
|
|
13
|
+
* destination siblings (not counting the tab itself).
|
|
14
|
+
*/
|
|
15
|
+
export function computeMoveApiIndex(args) {
|
|
16
|
+
const { sameParent, currentIndex, targetPosition } = args;
|
|
17
|
+
return sameParent && currentIndex < targetPosition ? targetPosition + 1 : targetPosition;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=tabPosition.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mindstone/mcp-server-google-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"mcpName": "io.github.mindstone/mcp-server-google-workspace",
|
|
5
5
|
"description": "Google Workspace MCP server for Gmail, Calendar, Drive, Docs, Sheets, Slides, Contacts, Tasks, and Forms",
|
|
6
6
|
"license": "FSL-1.1-MIT",
|