@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.
Files changed (39) hide show
  1. package/README.md +43 -5
  2. package/dist/modules/docs/service.d.ts +76 -6
  3. package/dist/modules/docs/service.js +791 -103
  4. package/dist/modules/docs/tabCopy.d.ts +266 -0
  5. package/dist/modules/docs/tabCopy.js +794 -0
  6. package/dist/modules/docs/tabs.d.ts +161 -0
  7. package/dist/modules/docs/tabs.js +416 -0
  8. package/dist/modules/docs/types.d.ts +141 -1
  9. package/dist/modules/drive/service.d.ts +15 -0
  10. package/dist/modules/drive/service.js +77 -2
  11. package/dist/modules/drive/types.d.ts +1 -1
  12. package/dist/modules/sheets/a1Utils.d.ts +13 -0
  13. package/dist/modules/sheets/a1Utils.js +33 -7
  14. package/dist/modules/sheets/formatters.d.ts +33 -2
  15. package/dist/modules/sheets/formatters.js +84 -5
  16. package/dist/modules/sheets/service.d.ts +26 -1
  17. package/dist/modules/sheets/service.js +264 -8
  18. package/dist/modules/sheets/types.d.ts +71 -0
  19. package/dist/modules/sheets/types.js +12 -1
  20. package/dist/modules/sheets/writeGuards.js +2 -2
  21. package/dist/tools/definitions/destructive-overrides.json +8 -0
  22. package/dist/tools/definitions/docs.js +395 -9
  23. package/dist/tools/definitions/drive.js +9 -4
  24. package/dist/tools/definitions/open-world-overrides.json +8 -0
  25. package/dist/tools/definitions/sheets.js +177 -1
  26. package/dist/tools/docs-handlers.d.ts +125 -0
  27. package/dist/tools/docs-handlers.js +397 -15
  28. package/dist/tools/param-normalizer.js +16 -0
  29. package/dist/tools/server.js +35 -3
  30. package/dist/tools/sheets-handlers.d.ts +54 -1
  31. package/dist/tools/sheets-handlers.js +107 -13
  32. package/dist/tools/type-guards.d.ts +89 -0
  33. package/dist/tools/type-guards.js +190 -6
  34. package/dist/tools/types.d.ts +1 -1
  35. package/dist/utils/apiError.d.ts +6 -0
  36. package/dist/utils/apiError.js +12 -0
  37. package/dist/utils/tabPosition.d.ts +20 -0
  38. package/dist/utils/tabPosition.js +19 -0
  39. package/package.json +1 -1
@@ -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.4.2",
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",