mcp-google-multi 6.0.0-alpha.49 → 6.0.0-alpha.50
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/dist/client.d.ts +5 -0
- package/dist/services.d.ts +2 -1
- package/dist/tools/calendar.d.ts +2 -1
- package/dist/tools/calendar.js +18 -14
- package/dist/tools/contacts.d.ts +2 -1
- package/dist/tools/contacts.js +17 -13
- package/dist/tools/meet.d.ts +2 -1
- package/dist/tools/meet.js +12 -8
- package/dist/tools/searchconsole.d.ts +2 -1
- package/dist/tools/searchconsole.js +17 -13
- package/dist/tools/tasks.d.ts +2 -1
- package/dist/tools/tasks.js +19 -15
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -17,6 +17,11 @@ export declare function __inflightSizeForTest(): number;
|
|
|
17
17
|
* custody. The free core builds exactly one, bound to the global registry.
|
|
18
18
|
*/
|
|
19
19
|
export declare function makeGetClient(contextKey: string, deps: GetClientDeps): (account: Account) => Promise<OAuth2Client>;
|
|
20
|
+
/** Injection surface for curated tool files: absent = the single-owner
|
|
21
|
+
* getClient below (today's behavior); a tenant context passes its own. */
|
|
22
|
+
export interface CuratedToolDeps {
|
|
23
|
+
getClientFn?: typeof getClient;
|
|
24
|
+
}
|
|
20
25
|
/** The single-owner client, bound to the global registry + token store. The
|
|
21
26
|
* operator surfaces that never carry a tenant (api-probe, executor and
|
|
22
27
|
* escape-hatch `deps.getClientFn ?? getClient` defaults, stdio dispatch)
|
package/dist/services.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { AccountSet } from './accounts.js';
|
|
2
|
+
import type { CuratedToolDeps } from './client.js';
|
|
2
3
|
import type { ToolRegistry } from './registry.js';
|
|
3
4
|
export interface ServiceEntry {
|
|
4
5
|
name: string;
|
|
5
|
-
register: (registry: ToolRegistry) => void;
|
|
6
|
+
register: (registry: ToolRegistry, deps?: CuratedToolDeps) => void;
|
|
6
7
|
/** Absent = always on. Gates evaluate against the PASSED account set (the
|
|
7
8
|
* calling tenant's view); omitted set = the global registry, today's
|
|
8
9
|
* behavior. */
|
package/dist/tools/calendar.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ToolRegistry } from '../registry.js';
|
|
2
|
-
|
|
2
|
+
import { type CuratedToolDeps } from '../client.js';
|
|
3
|
+
export declare function registerCalendarTools(server: ToolRegistry, deps?: CuratedToolDeps): void;
|
|
3
4
|
/** Google disagrees with itself on a backwards window: events.list answers 200
|
|
4
5
|
* with [], which reads as "nothing scheduled", while freebusy.query 400s on the
|
|
5
6
|
* identical input. Decide locally so an empty list always means empty. Returns
|
package/dist/tools/calendar.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { coerceArray, coerceBoolean } from './_coerce.js';
|
|
3
3
|
import { calendar as calendarClient } from '@googleapis/calendar';
|
|
4
|
-
import {
|
|
4
|
+
import { accountArgLive } from '../accounts.js';
|
|
5
5
|
import { getClient } from '../client.js';
|
|
6
6
|
import { checkOutbound } from '../outbound-allowlist.js';
|
|
7
7
|
import { handleGoogleApiError, invalidParams } from './_errors.js';
|
|
8
8
|
import { listResult, sliceClean } from '../trim.js';
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
export function registerCalendarTools(server, deps = {}) {
|
|
10
|
+
// Per-registry, LIVE account enum + injectable client (S1.10): the
|
|
11
|
+
// schema follows the registry's account view at parse time, and the
|
|
12
|
+
// custody path is the context's, not the process global.
|
|
13
|
+
const accountEnum = accountArgLive(() => server.accountAliases()).optional();
|
|
14
|
+
const getClientFn = deps.getClientFn ?? getClient;
|
|
11
15
|
server.registerTool('calendar_list_calendars', {
|
|
12
16
|
description: 'List all calendars for a Google account',
|
|
13
17
|
inputSchema: {
|
|
@@ -15,7 +19,7 @@ export function registerCalendarTools(server) {
|
|
|
15
19
|
},
|
|
16
20
|
}, async ({ account }) => {
|
|
17
21
|
try {
|
|
18
|
-
const auth = await
|
|
22
|
+
const auth = await getClientFn(account);
|
|
19
23
|
const cal = calendarClient({ version: 'v3', auth });
|
|
20
24
|
const res = await cal.calendarList.list();
|
|
21
25
|
const calendars = (res.data.items ?? []).map((c) => ({
|
|
@@ -55,7 +59,7 @@ export function registerCalendarTools(server) {
|
|
|
55
59
|
if (rangeError)
|
|
56
60
|
return invalidParams(account, rangeError, TIME_RANGE_HINT);
|
|
57
61
|
try {
|
|
58
|
-
const auth = await
|
|
62
|
+
const auth = await getClientFn(account);
|
|
59
63
|
const cal = calendarClient({ version: 'v3', auth });
|
|
60
64
|
const params = {
|
|
61
65
|
calendarId: calendarId ?? 'primary',
|
|
@@ -98,7 +102,7 @@ export function registerCalendarTools(server) {
|
|
|
98
102
|
},
|
|
99
103
|
}, async ({ account, eventId, calendarId }) => {
|
|
100
104
|
try {
|
|
101
|
-
const auth = await
|
|
105
|
+
const auth = await getClientFn(account);
|
|
102
106
|
const cal = calendarClient({ version: 'v3', auth });
|
|
103
107
|
const res = await cal.events.get({
|
|
104
108
|
calendarId: calendarId ?? 'primary',
|
|
@@ -135,7 +139,7 @@ export function registerCalendarTools(server) {
|
|
|
135
139
|
if (outbound)
|
|
136
140
|
return outbound;
|
|
137
141
|
}
|
|
138
|
-
const auth = await
|
|
142
|
+
const auth = await getClientFn(account);
|
|
139
143
|
const cal = calendarClient({ version: 'v3', auth });
|
|
140
144
|
const event = { summary };
|
|
141
145
|
if (allDay) {
|
|
@@ -190,7 +194,7 @@ export function registerCalendarTools(server) {
|
|
|
190
194
|
if (outbound)
|
|
191
195
|
return outbound;
|
|
192
196
|
}
|
|
193
|
-
const auth = await
|
|
197
|
+
const auth = await getClientFn(account);
|
|
194
198
|
const cal = calendarClient({ version: 'v3', auth });
|
|
195
199
|
// Fetch the event first so a 404 surfaces before we attempt the patch.
|
|
196
200
|
await cal.events.get({
|
|
@@ -243,7 +247,7 @@ export function registerCalendarTools(server) {
|
|
|
243
247
|
},
|
|
244
248
|
}, async ({ account, eventId, calendarId }) => {
|
|
245
249
|
try {
|
|
246
|
-
const auth = await
|
|
250
|
+
const auth = await getClientFn(account);
|
|
247
251
|
const cal = calendarClient({ version: 'v3', auth });
|
|
248
252
|
await cal.events.delete({
|
|
249
253
|
calendarId: calendarId ?? 'primary',
|
|
@@ -268,7 +272,7 @@ export function registerCalendarTools(server) {
|
|
|
268
272
|
},
|
|
269
273
|
}, async ({ account, calendarId, text, sendNotifications }) => {
|
|
270
274
|
try {
|
|
271
|
-
const auth = await
|
|
275
|
+
const auth = await getClientFn(account);
|
|
272
276
|
const cal = calendarClient({ version: 'v3', auth });
|
|
273
277
|
const res = await cal.events.quickAdd({
|
|
274
278
|
calendarId: calendarId ?? 'primary',
|
|
@@ -294,7 +298,7 @@ export function registerCalendarTools(server) {
|
|
|
294
298
|
},
|
|
295
299
|
}, async ({ account, calendarId, eventId, destinationCalendarId, sendNotifications }) => {
|
|
296
300
|
try {
|
|
297
|
-
const auth = await
|
|
301
|
+
const auth = await getClientFn(account);
|
|
298
302
|
const cal = calendarClient({ version: 'v3', auth });
|
|
299
303
|
const res = await cal.events.move({
|
|
300
304
|
calendarId,
|
|
@@ -329,7 +333,7 @@ export function registerCalendarTools(server) {
|
|
|
329
333
|
if (rangeError)
|
|
330
334
|
return invalidParams(account, rangeError, TIME_RANGE_HINT);
|
|
331
335
|
try {
|
|
332
|
-
const auth = await
|
|
336
|
+
const auth = await getClientFn(account);
|
|
333
337
|
const cal = calendarClient({ version: 'v3', auth });
|
|
334
338
|
const res = await cal.events.instances({
|
|
335
339
|
calendarId: calendarId ?? 'primary',
|
|
@@ -367,7 +371,7 @@ export function registerCalendarTools(server) {
|
|
|
367
371
|
const rangeError = timeRangeError(timeMin, timeMax);
|
|
368
372
|
if (rangeError)
|
|
369
373
|
return invalidParams(account, rangeError, TIME_RANGE_HINT);
|
|
370
|
-
const auth = await
|
|
374
|
+
const auth = await getClientFn(account);
|
|
371
375
|
const cal = calendarClient({ version: 'v3', auth });
|
|
372
376
|
const res = await cal.freebusy.query({
|
|
373
377
|
requestBody: {
|
|
@@ -399,7 +403,7 @@ export function registerCalendarTools(server) {
|
|
|
399
403
|
},
|
|
400
404
|
}, async ({ account, summary, description, timeZone }) => {
|
|
401
405
|
try {
|
|
402
|
-
const auth = await
|
|
406
|
+
const auth = await getClientFn(account);
|
|
403
407
|
const cal = calendarClient({ version: 'v3', auth });
|
|
404
408
|
const res = await cal.calendars.insert({
|
|
405
409
|
requestBody: {
|
package/dist/tools/contacts.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ToolRegistry } from '../registry.js';
|
|
2
|
+
import { type CuratedToolDeps } from '../client.js';
|
|
2
3
|
export interface ResolveCandidate {
|
|
3
4
|
resourceName: string;
|
|
4
5
|
displayName: string;
|
|
@@ -39,4 +40,4 @@ export declare function resolveContacts(candidates: ResolveCandidate[], name: st
|
|
|
39
40
|
}[];
|
|
40
41
|
resolved?: undefined;
|
|
41
42
|
};
|
|
42
|
-
export declare function registerContactsTools(server: ToolRegistry): void;
|
|
43
|
+
export declare function registerContactsTools(server: ToolRegistry, deps?: CuratedToolDeps): void;
|
package/dist/tools/contacts.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { people as peopleClient } from '@googleapis/people';
|
|
3
|
-
import {
|
|
3
|
+
import { accountArgLive } from '../accounts.js';
|
|
4
4
|
import { getClient } from '../client.js';
|
|
5
5
|
import { coerceBoolean } from './_coerce.js';
|
|
6
6
|
import { handleGoogleApiError, invalidParams } from './_errors.js';
|
|
7
7
|
import { listResult } from '../trim.js';
|
|
8
|
-
const accountEnum = accountAliasSchema.optional();
|
|
9
8
|
const PERSON_FIELDS = 'names,emailAddresses,phoneNumbers,organizations,addresses,photos,memberships';
|
|
10
9
|
// people.getBatchGet rejects more than 200 resource names per call.
|
|
11
10
|
const BATCH_GET_LIMIT = 200;
|
|
@@ -123,7 +122,12 @@ function dedupeCandidates(list) {
|
|
|
123
122
|
}
|
|
124
123
|
return [...byResource.values()];
|
|
125
124
|
}
|
|
126
|
-
export function registerContactsTools(server) {
|
|
125
|
+
export function registerContactsTools(server, deps = {}) {
|
|
126
|
+
// Per-registry, LIVE account enum + injectable client (S1.10): the
|
|
127
|
+
// schema follows the registry's account view at parse time, and the
|
|
128
|
+
// custody path is the context's, not the process global.
|
|
129
|
+
const accountEnum = accountArgLive(() => server.accountAliases()).optional();
|
|
130
|
+
const getClientFn = deps.getClientFn ?? getClient;
|
|
127
131
|
server.registerTool('contacts_search', {
|
|
128
132
|
description: 'Search contacts by name, email, phone, or organization',
|
|
129
133
|
inputSchema: {
|
|
@@ -134,7 +138,7 @@ export function registerContactsTools(server) {
|
|
|
134
138
|
},
|
|
135
139
|
}, async ({ account, query, pageSize }) => {
|
|
136
140
|
try {
|
|
137
|
-
const auth = await
|
|
141
|
+
const auth = await getClientFn(account);
|
|
138
142
|
const people = peopleClient({ version: 'v1', auth });
|
|
139
143
|
// Warmup request required by the People API
|
|
140
144
|
await people.people.searchContacts({
|
|
@@ -174,7 +178,7 @@ export function registerContactsTools(server) {
|
|
|
174
178
|
},
|
|
175
179
|
}, async ({ account, name, maxCandidates, includeOtherContacts }) => {
|
|
176
180
|
try {
|
|
177
|
-
const auth = await
|
|
181
|
+
const auth = await getClientFn(account);
|
|
178
182
|
const people = peopleClient({ version: 'v1', auth });
|
|
179
183
|
// Warmup request required by the People API before searchContacts returns hits.
|
|
180
184
|
await people.people.searchContacts({ query: '', readMask: 'names' });
|
|
@@ -213,7 +217,7 @@ export function registerContactsTools(server) {
|
|
|
213
217
|
},
|
|
214
218
|
}, async ({ account, resourceName }) => {
|
|
215
219
|
try {
|
|
216
|
-
const auth = await
|
|
220
|
+
const auth = await getClientFn(account);
|
|
217
221
|
const people = peopleClient({ version: 'v1', auth });
|
|
218
222
|
const res = await people.people.get({
|
|
219
223
|
resourceName,
|
|
@@ -244,7 +248,7 @@ export function registerContactsTools(server) {
|
|
|
244
248
|
},
|
|
245
249
|
}, async ({ account, pageSize, pageToken, sortOrder }) => {
|
|
246
250
|
try {
|
|
247
|
-
const auth = await
|
|
251
|
+
const auth = await getClientFn(account);
|
|
248
252
|
const people = peopleClient({ version: 'v1', auth });
|
|
249
253
|
const res = await people.people.connections.list({
|
|
250
254
|
resourceName: 'people/me',
|
|
@@ -283,7 +287,7 @@ export function registerContactsTools(server) {
|
|
|
283
287
|
},
|
|
284
288
|
}, async ({ account, givenName, familyName, email, emailType, phone, phoneType, organization, jobTitle }) => {
|
|
285
289
|
try {
|
|
286
|
-
const auth = await
|
|
290
|
+
const auth = await getClientFn(account);
|
|
287
291
|
const people = peopleClient({ version: 'v1', auth });
|
|
288
292
|
const requestBody = {
|
|
289
293
|
names: [{ givenName, familyName: familyName ?? '' }],
|
|
@@ -330,7 +334,7 @@ export function registerContactsTools(server) {
|
|
|
330
334
|
},
|
|
331
335
|
}, async ({ account, resourceName, givenName, familyName, email, emailType, phone, phoneType, organization, jobTitle }) => {
|
|
332
336
|
try {
|
|
333
|
-
const auth = await
|
|
337
|
+
const auth = await getClientFn(account);
|
|
334
338
|
const people = peopleClient({ version: 'v1', auth });
|
|
335
339
|
// Fetch current contact to get etag
|
|
336
340
|
const current = await people.people.get({
|
|
@@ -387,7 +391,7 @@ export function registerContactsTools(server) {
|
|
|
387
391
|
},
|
|
388
392
|
}, async ({ account, resourceName }) => {
|
|
389
393
|
try {
|
|
390
|
-
const auth = await
|
|
394
|
+
const auth = await getClientFn(account);
|
|
391
395
|
const people = peopleClient({ version: 'v1', auth });
|
|
392
396
|
await people.people.deleteContact({ resourceName });
|
|
393
397
|
return {
|
|
@@ -409,7 +413,7 @@ export function registerContactsTools(server) {
|
|
|
409
413
|
},
|
|
410
414
|
}, async ({ account, pageSize }) => {
|
|
411
415
|
try {
|
|
412
|
-
const auth = await
|
|
416
|
+
const auth = await getClientFn(account);
|
|
413
417
|
const people = peopleClient({ version: 'v1', auth });
|
|
414
418
|
const res = await people.contactGroups.list({
|
|
415
419
|
pageSize: pageSize ?? 100,
|
|
@@ -439,7 +443,7 @@ export function registerContactsTools(server) {
|
|
|
439
443
|
},
|
|
440
444
|
}, async ({ account, groupResourceName, maxMembers }) => {
|
|
441
445
|
try {
|
|
442
|
-
const auth = await
|
|
446
|
+
const auth = await getClientFn(account);
|
|
443
447
|
const people = peopleClient({ version: 'v1', auth });
|
|
444
448
|
const groupRes = await people.contactGroups.get({
|
|
445
449
|
resourceName: groupResourceName,
|
|
@@ -503,7 +507,7 @@ export function registerContactsTools(server) {
|
|
|
503
507
|
},
|
|
504
508
|
}, async ({ account, name }) => {
|
|
505
509
|
try {
|
|
506
|
-
const auth = await
|
|
510
|
+
const auth = await getClientFn(account);
|
|
507
511
|
const people = peopleClient({ version: 'v1', auth });
|
|
508
512
|
const res = await people.contactGroups.create({
|
|
509
513
|
requestBody: {
|
package/dist/tools/meet.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { ToolRegistry } from '../registry.js';
|
|
2
|
-
|
|
2
|
+
import { type CuratedToolDeps } from '../client.js';
|
|
3
|
+
export declare function registerMeetTools(server: ToolRegistry, deps?: CuratedToolDeps): void;
|
package/dist/tools/meet.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { meet as meetClient } from '@googleapis/meet';
|
|
3
|
-
import {
|
|
3
|
+
import { accountArgLive } from '../accounts.js';
|
|
4
4
|
import { getClient } from '../client.js';
|
|
5
5
|
import { handleGoogleApiError } from './_errors.js';
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
export function registerMeetTools(server, deps = {}) {
|
|
7
|
+
// Per-registry, LIVE account enum + injectable client (S1.10): the
|
|
8
|
+
// schema follows the registry's account view at parse time, and the
|
|
9
|
+
// custody path is the context's, not the process global.
|
|
10
|
+
const accountEnum = accountArgLive(() => server.accountAliases()).optional();
|
|
11
|
+
const getClientFn = deps.getClientFn ?? getClient;
|
|
8
12
|
// ─── Conference records (past meetings) ────────────────────────────────
|
|
9
13
|
server.registerTool('meet_conference_records_list', {
|
|
10
14
|
description: 'List past conference records (completed Meet sessions) the user has access to',
|
|
@@ -16,7 +20,7 @@ export function registerMeetTools(server) {
|
|
|
16
20
|
},
|
|
17
21
|
}, async ({ account, pageSize, pageToken, filter }) => {
|
|
18
22
|
try {
|
|
19
|
-
const auth = await
|
|
23
|
+
const auth = await getClientFn(account);
|
|
20
24
|
const meet = meetClient({ version: 'v2', auth });
|
|
21
25
|
const res = await meet.conferenceRecords.list({
|
|
22
26
|
pageSize: pageSize ?? 20,
|
|
@@ -39,7 +43,7 @@ export function registerMeetTools(server) {
|
|
|
39
43
|
},
|
|
40
44
|
}, async ({ account, name }) => {
|
|
41
45
|
try {
|
|
42
|
-
const auth = await
|
|
46
|
+
const auth = await getClientFn(account);
|
|
43
47
|
const meet = meetClient({ version: 'v2', auth });
|
|
44
48
|
const res = await meet.conferenceRecords.get({ name });
|
|
45
49
|
return {
|
|
@@ -61,7 +65,7 @@ export function registerMeetTools(server) {
|
|
|
61
65
|
},
|
|
62
66
|
}, async ({ account, parent, pageSize, pageToken }) => {
|
|
63
67
|
try {
|
|
64
|
-
const auth = await
|
|
68
|
+
const auth = await getClientFn(account);
|
|
65
69
|
const meet = meetClient({ version: 'v2', auth });
|
|
66
70
|
const res = await meet.conferenceRecords.recordings.list({
|
|
67
71
|
parent,
|
|
@@ -87,7 +91,7 @@ export function registerMeetTools(server) {
|
|
|
87
91
|
},
|
|
88
92
|
}, async ({ account, parent, pageSize, pageToken }) => {
|
|
89
93
|
try {
|
|
90
|
-
const auth = await
|
|
94
|
+
const auth = await getClientFn(account);
|
|
91
95
|
const meet = meetClient({ version: 'v2', auth });
|
|
92
96
|
const res = await meet.conferenceRecords.transcripts.list({
|
|
93
97
|
parent,
|
|
@@ -112,7 +116,7 @@ export function registerMeetTools(server) {
|
|
|
112
116
|
},
|
|
113
117
|
}, async ({ account, parent, pageSize, pageToken }) => {
|
|
114
118
|
try {
|
|
115
|
-
const auth = await
|
|
119
|
+
const auth = await getClientFn(account);
|
|
116
120
|
const meet = meetClient({ version: 'v2', auth });
|
|
117
121
|
const res = await meet.conferenceRecords.transcripts.entries.list({
|
|
118
122
|
parent,
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { ToolRegistry } from '../registry.js';
|
|
2
|
-
|
|
2
|
+
import { type CuratedToolDeps } from '../client.js';
|
|
3
|
+
export declare function registerSearchConsoleTools(server: ToolRegistry, deps?: CuratedToolDeps): void;
|
|
@@ -2,11 +2,15 @@ import { z } from 'zod';
|
|
|
2
2
|
import { coerceArray, coerceJson } from './_coerce.js';
|
|
3
3
|
import { searchconsole as searchconsoleClient } from '@googleapis/searchconsole';
|
|
4
4
|
import { webmasters as webmastersClient } from '@googleapis/webmasters';
|
|
5
|
-
import {
|
|
5
|
+
import { accountArgLive } from '../accounts.js';
|
|
6
6
|
import { getClient } from '../client.js';
|
|
7
7
|
import { handleGoogleApiError } from './_errors.js';
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
export function registerSearchConsoleTools(server, deps = {}) {
|
|
9
|
+
// Per-registry, LIVE account enum + injectable client (S1.10): the
|
|
10
|
+
// schema follows the registry's account view at parse time, and the
|
|
11
|
+
// custody path is the context's, not the process global.
|
|
12
|
+
const accountEnum = accountArgLive(() => server.accountAliases()).optional();
|
|
13
|
+
const getClientFn = deps.getClientFn ?? getClient;
|
|
10
14
|
// ─── Sites ───────────────────────────────────────────────
|
|
11
15
|
server.registerTool('searchconsole_sites_list', {
|
|
12
16
|
description: 'List all sites (properties) the account has access to in Google Search Console',
|
|
@@ -15,7 +19,7 @@ export function registerSearchConsoleTools(server) {
|
|
|
15
19
|
},
|
|
16
20
|
}, async ({ account }) => {
|
|
17
21
|
try {
|
|
18
|
-
const auth = await
|
|
22
|
+
const auth = await getClientFn(account);
|
|
19
23
|
const wm = webmastersClient({ version: 'v3', auth });
|
|
20
24
|
const res = await wm.sites.list();
|
|
21
25
|
return {
|
|
@@ -34,7 +38,7 @@ export function registerSearchConsoleTools(server) {
|
|
|
34
38
|
},
|
|
35
39
|
}, async ({ account, siteUrl }) => {
|
|
36
40
|
try {
|
|
37
|
-
const auth = await
|
|
41
|
+
const auth = await getClientFn(account);
|
|
38
42
|
const wm = webmastersClient({ version: 'v3', auth });
|
|
39
43
|
const res = await wm.sites.get({ siteUrl });
|
|
40
44
|
return {
|
|
@@ -53,7 +57,7 @@ export function registerSearchConsoleTools(server) {
|
|
|
53
57
|
},
|
|
54
58
|
}, async ({ account, siteUrl }) => {
|
|
55
59
|
try {
|
|
56
|
-
const auth = await
|
|
60
|
+
const auth = await getClientFn(account);
|
|
57
61
|
const wm = webmastersClient({ version: 'v3', auth });
|
|
58
62
|
await wm.sites.add({ siteUrl });
|
|
59
63
|
return {
|
|
@@ -72,7 +76,7 @@ export function registerSearchConsoleTools(server) {
|
|
|
72
76
|
},
|
|
73
77
|
}, async ({ account, siteUrl }) => {
|
|
74
78
|
try {
|
|
75
|
-
const auth = await
|
|
79
|
+
const auth = await getClientFn(account);
|
|
76
80
|
const wm = webmastersClient({ version: 'v3', auth });
|
|
77
81
|
await wm.sites.delete({ siteUrl });
|
|
78
82
|
return {
|
|
@@ -92,7 +96,7 @@ export function registerSearchConsoleTools(server) {
|
|
|
92
96
|
},
|
|
93
97
|
}, async ({ account, siteUrl }) => {
|
|
94
98
|
try {
|
|
95
|
-
const auth = await
|
|
99
|
+
const auth = await getClientFn(account);
|
|
96
100
|
const wm = webmastersClient({ version: 'v3', auth });
|
|
97
101
|
const res = await wm.sitemaps.list({ siteUrl });
|
|
98
102
|
return {
|
|
@@ -112,7 +116,7 @@ export function registerSearchConsoleTools(server) {
|
|
|
112
116
|
},
|
|
113
117
|
}, async ({ account, siteUrl, feedpath }) => {
|
|
114
118
|
try {
|
|
115
|
-
const auth = await
|
|
119
|
+
const auth = await getClientFn(account);
|
|
116
120
|
const wm = webmastersClient({ version: 'v3', auth });
|
|
117
121
|
const res = await wm.sitemaps.get({ siteUrl, feedpath });
|
|
118
122
|
return {
|
|
@@ -132,7 +136,7 @@ export function registerSearchConsoleTools(server) {
|
|
|
132
136
|
},
|
|
133
137
|
}, async ({ account, siteUrl, feedpath }) => {
|
|
134
138
|
try {
|
|
135
|
-
const auth = await
|
|
139
|
+
const auth = await getClientFn(account);
|
|
136
140
|
const wm = webmastersClient({ version: 'v3', auth });
|
|
137
141
|
await wm.sitemaps.submit({ siteUrl, feedpath });
|
|
138
142
|
return {
|
|
@@ -152,7 +156,7 @@ export function registerSearchConsoleTools(server) {
|
|
|
152
156
|
},
|
|
153
157
|
}, async ({ account, siteUrl, feedpath }) => {
|
|
154
158
|
try {
|
|
155
|
-
const auth = await
|
|
159
|
+
const auth = await getClientFn(account);
|
|
156
160
|
const wm = webmastersClient({ version: 'v3', auth });
|
|
157
161
|
await wm.sitemaps.delete({ siteUrl, feedpath });
|
|
158
162
|
return {
|
|
@@ -195,7 +199,7 @@ export function registerSearchConsoleTools(server) {
|
|
|
195
199
|
},
|
|
196
200
|
}, async ({ account, siteUrl, startDate, endDate, dimensions, type, dimensionFilterGroups, rowLimit, startRow, aggregationType, dataState }) => {
|
|
197
201
|
try {
|
|
198
|
-
const auth = await
|
|
202
|
+
const auth = await getClientFn(account);
|
|
199
203
|
const wm = webmastersClient({ version: 'v3', auth });
|
|
200
204
|
const requestBody = { startDate, endDate };
|
|
201
205
|
if (dimensions)
|
|
@@ -237,7 +241,7 @@ export function registerSearchConsoleTools(server) {
|
|
|
237
241
|
},
|
|
238
242
|
}, async ({ account, siteUrl, inspectionUrl, languageCode }) => {
|
|
239
243
|
try {
|
|
240
|
-
const auth = await
|
|
244
|
+
const auth = await getClientFn(account);
|
|
241
245
|
const searchconsole = searchconsoleClient({ version: 'v1', auth });
|
|
242
246
|
const res = await searchconsole.urlInspection.index.inspect({
|
|
243
247
|
requestBody: {
|
package/dist/tools/tasks.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { ToolRegistry } from '../registry.js';
|
|
2
|
-
|
|
2
|
+
import { type CuratedToolDeps } from '../client.js';
|
|
3
|
+
export declare function registerTasksTools(server: ToolRegistry, deps?: CuratedToolDeps): void;
|
package/dist/tools/tasks.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { coerceBoolean } from './_coerce.js';
|
|
3
3
|
import { tasks as tasksClient } from '@googleapis/tasks';
|
|
4
|
-
import {
|
|
4
|
+
import { accountArgLive } from '../accounts.js';
|
|
5
5
|
import { getClient } from '../client.js';
|
|
6
6
|
import { handleGoogleApiError, invalidParams } from './_errors.js';
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
export function registerTasksTools(server, deps = {}) {
|
|
8
|
+
// Per-registry, LIVE account enum + injectable client (S1.10): the
|
|
9
|
+
// schema follows the registry's account view at parse time, and the
|
|
10
|
+
// custody path is the context's, not the process global.
|
|
11
|
+
const accountEnum = accountArgLive(() => server.accountAliases()).optional();
|
|
12
|
+
const getClientFn = deps.getClientFn ?? getClient;
|
|
9
13
|
// ─── Tasklists ─────────────────────────────────────────────────────────
|
|
10
14
|
server.registerTool('tasks_lists_list', {
|
|
11
15
|
description: 'List all tasklists (the user\'s top-level task containers)',
|
|
@@ -16,7 +20,7 @@ export function registerTasksTools(server) {
|
|
|
16
20
|
},
|
|
17
21
|
}, async ({ account, maxResults, pageToken }) => {
|
|
18
22
|
try {
|
|
19
|
-
const auth = await
|
|
23
|
+
const auth = await getClientFn(account);
|
|
20
24
|
const tasks = tasksClient({ version: 'v1', auth });
|
|
21
25
|
const res = await tasks.tasklists.list({
|
|
22
26
|
maxResults: maxResults ?? 100,
|
|
@@ -38,7 +42,7 @@ export function registerTasksTools(server) {
|
|
|
38
42
|
},
|
|
39
43
|
}, async ({ account, tasklistId }) => {
|
|
40
44
|
try {
|
|
41
|
-
const auth = await
|
|
45
|
+
const auth = await getClientFn(account);
|
|
42
46
|
const tasks = tasksClient({ version: 'v1', auth });
|
|
43
47
|
const res = await tasks.tasklists.get({ tasklist: tasklistId });
|
|
44
48
|
return {
|
|
@@ -57,7 +61,7 @@ export function registerTasksTools(server) {
|
|
|
57
61
|
},
|
|
58
62
|
}, async ({ account, title }) => {
|
|
59
63
|
try {
|
|
60
|
-
const auth = await
|
|
64
|
+
const auth = await getClientFn(account);
|
|
61
65
|
const tasks = tasksClient({ version: 'v1', auth });
|
|
62
66
|
const res = await tasks.tasklists.insert({
|
|
63
67
|
requestBody: { title },
|
|
@@ -79,7 +83,7 @@ export function registerTasksTools(server) {
|
|
|
79
83
|
},
|
|
80
84
|
}, async ({ account, tasklistId, title }) => {
|
|
81
85
|
try {
|
|
82
|
-
const auth = await
|
|
86
|
+
const auth = await getClientFn(account);
|
|
83
87
|
const tasks = tasksClient({ version: 'v1', auth });
|
|
84
88
|
const res = await tasks.tasklists.patch({
|
|
85
89
|
tasklist: tasklistId,
|
|
@@ -101,7 +105,7 @@ export function registerTasksTools(server) {
|
|
|
101
105
|
},
|
|
102
106
|
}, async ({ account, tasklistId }) => {
|
|
103
107
|
try {
|
|
104
|
-
const auth = await
|
|
108
|
+
const auth = await getClientFn(account);
|
|
105
109
|
const tasks = tasksClient({ version: 'v1', auth });
|
|
106
110
|
await tasks.tasklists.delete({ tasklist: tasklistId });
|
|
107
111
|
return {
|
|
@@ -132,7 +136,7 @@ export function registerTasksTools(server) {
|
|
|
132
136
|
},
|
|
133
137
|
}, async ({ account, tasklistId, ...params }) => {
|
|
134
138
|
try {
|
|
135
|
-
const auth = await
|
|
139
|
+
const auth = await getClientFn(account);
|
|
136
140
|
const tasks = tasksClient({ version: 'v1', auth });
|
|
137
141
|
const res = await tasks.tasks.list({
|
|
138
142
|
tasklist: tasklistId,
|
|
@@ -155,7 +159,7 @@ export function registerTasksTools(server) {
|
|
|
155
159
|
},
|
|
156
160
|
}, async ({ account, tasklistId, taskId }) => {
|
|
157
161
|
try {
|
|
158
|
-
const auth = await
|
|
162
|
+
const auth = await getClientFn(account);
|
|
159
163
|
const tasks = tasksClient({ version: 'v1', auth });
|
|
160
164
|
const res = await tasks.tasks.get({ tasklist: tasklistId, task: taskId });
|
|
161
165
|
return {
|
|
@@ -180,7 +184,7 @@ export function registerTasksTools(server) {
|
|
|
180
184
|
},
|
|
181
185
|
}, async ({ account, tasklistId, title, notes, due, status, parent, previous }) => {
|
|
182
186
|
try {
|
|
183
|
-
const auth = await
|
|
187
|
+
const auth = await getClientFn(account);
|
|
184
188
|
const tasks = tasksClient({ version: 'v1', auth });
|
|
185
189
|
const requestBody = { title };
|
|
186
190
|
if (notes !== undefined)
|
|
@@ -216,7 +220,7 @@ export function registerTasksTools(server) {
|
|
|
216
220
|
},
|
|
217
221
|
}, async ({ account, tasklistId, taskId, title, notes, due, status }) => {
|
|
218
222
|
try {
|
|
219
|
-
const auth = await
|
|
223
|
+
const auth = await getClientFn(account);
|
|
220
224
|
const tasks = tasksClient({ version: 'v1', auth });
|
|
221
225
|
const requestBody = {};
|
|
222
226
|
if (title !== undefined)
|
|
@@ -252,7 +256,7 @@ export function registerTasksTools(server) {
|
|
|
252
256
|
},
|
|
253
257
|
}, async ({ account, tasklistId, taskId }) => {
|
|
254
258
|
try {
|
|
255
|
-
const auth = await
|
|
259
|
+
const auth = await getClientFn(account);
|
|
256
260
|
const tasks = tasksClient({ version: 'v1', auth });
|
|
257
261
|
await tasks.tasks.delete({ tasklist: tasklistId, task: taskId });
|
|
258
262
|
return {
|
|
@@ -275,7 +279,7 @@ export function registerTasksTools(server) {
|
|
|
275
279
|
},
|
|
276
280
|
}, async ({ account, tasklistId, taskId, parent, previous, destinationTasklist }) => {
|
|
277
281
|
try {
|
|
278
|
-
const auth = await
|
|
282
|
+
const auth = await getClientFn(account);
|
|
279
283
|
const tasks = tasksClient({ version: 'v1', auth });
|
|
280
284
|
const res = await tasks.tasks.move({
|
|
281
285
|
tasklist: tasklistId,
|
|
@@ -300,7 +304,7 @@ export function registerTasksTools(server) {
|
|
|
300
304
|
},
|
|
301
305
|
}, async ({ account, tasklistId }) => {
|
|
302
306
|
try {
|
|
303
|
-
const auth = await
|
|
307
|
+
const auth = await getClientFn(account);
|
|
304
308
|
const tasks = tasksClient({ version: 'v1', auth });
|
|
305
309
|
await tasks.tasks.clear({ tasklist: tasklistId });
|
|
306
310
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-google-multi",
|
|
3
|
-
"version": "6.0.0-alpha.
|
|
3
|
+
"version": "6.0.0-alpha.50",
|
|
4
4
|
"mcpName": "io.github.bakissation/mcp-google-multi",
|
|
5
5
|
"description": "Local MCP server for Google Workspace (Gmail, Drive, Calendar, Sheets, Docs, Contacts, Tasks, Meet, Search Console, +Forms/Chat/Admin) across multiple accounts — OAuth-only, encrypted token storage, deny-by-default writes.",
|
|
6
6
|
"type": "module",
|