posterly-mcp-server 0.62.0 → 0.63.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 +15 -2
- package/dist/lib/api-client.d.ts +13 -0
- package/dist/lib/api-client.js +25 -0
- package/dist/lib/gbp-location-preview.d.ts +39 -3
- package/dist/lib/gbp-location-preview.js +418 -3
- package/dist/lib/tool-runtime.d.ts +3 -1
- package/dist/lib/tool-runtime.js +7 -2
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/tools/list-google-business-locations.d.ts +32 -0
- package/dist/tools/list-google-business-locations.js +31 -21
- package/dist/tools/manage-google-business-location.d.ts +193 -4
- package/dist/tools/manage-google-business-location.js +278 -20
- package/package.json +1 -1
- package/server.json +11 -2
- package/tool-registry.json +114 -6
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { code, mdKeyValue, mdSection } from '../lib/format.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { parsePreviewToken, previewFailureMessage } from '../lib/preview-token-core.js';
|
|
4
|
+
import { omitKeys, previewThenConfirm, readForPreview, validateArgs } from '../lib/tool-runtime.js';
|
|
5
|
+
import { formatGbpLocationUpdateOutcome, GBP_CLEAR_SERVICES_WARNING, GBP_CLOSED_DAYS_NOTE, GBP_LIVE_LISTING_CHANGED_ERROR, GBP_PRIMARY_CATEGORY_SUSPENSION_WARNING, GBP_TITLE_SUSPENSION_WARNING, gbpAttributeLines, gbpCategoriesLines, gbpCurrentAttributesFor, gbpPeriodLines, gbpPhoneNumbersLines, gbpProposedCategoriesLines, gbpProposedPhoneNumbersLines, gbpProposedServiceItemLines, gbpServiceItemLines, gbpTextValueLine, hasExplicitAdditionalCategories, hasExplicitAdditionalPhones, resolveGbpCategoriesForWrite, resolveGbpPhoneNumbersForWrite, } from '../lib/gbp-location-preview.js';
|
|
5
6
|
const LOCATION_ID_DESCRIPTION = 'Google Business numeric location id (the location_id/platform_user_id from list_accounts, e.g. "197940849675145390"). NOT the ChIJ... Place ID from list_google_business_reviews view=review_link. Prefer account_id.';
|
|
6
7
|
const periodSchema = z.object({
|
|
7
8
|
open_day: z.string(),
|
|
@@ -14,6 +15,33 @@ const attributeSchema = z.object({
|
|
|
14
15
|
value_type: z.enum(['BOOL', 'URL', 'ENUM']),
|
|
15
16
|
values: z.array(z.union([z.boolean(), z.string()])).min(1).max(5),
|
|
16
17
|
});
|
|
18
|
+
const categoriesSchema = z.object({
|
|
19
|
+
primary_category: z.string(),
|
|
20
|
+
additional_categories: z.array(z.string()).max(9).optional(),
|
|
21
|
+
});
|
|
22
|
+
const phoneNumbersSchema = z.object({
|
|
23
|
+
primary_phone: z.string(),
|
|
24
|
+
additional_phones: z.array(z.string()).max(2).optional(),
|
|
25
|
+
});
|
|
26
|
+
const serviceItemSchema = z.object({
|
|
27
|
+
structured_service_item: z.object({
|
|
28
|
+
service_type_id: z.string(),
|
|
29
|
+
description: z.string().max(300).optional(),
|
|
30
|
+
}).optional(),
|
|
31
|
+
free_form_service_item: z.object({
|
|
32
|
+
category: z.string(),
|
|
33
|
+
label: z.object({
|
|
34
|
+
display_name: z.string().max(250),
|
|
35
|
+
description: z.string().max(300).optional(),
|
|
36
|
+
language_code: z.string().optional(),
|
|
37
|
+
}),
|
|
38
|
+
}).optional(),
|
|
39
|
+
price: z.object({
|
|
40
|
+
currency_code: z.string(),
|
|
41
|
+
units: z.union([z.string(), z.number()]).optional(),
|
|
42
|
+
nanos: z.number().int().optional(),
|
|
43
|
+
}).optional(),
|
|
44
|
+
});
|
|
17
45
|
function locationRows(input) {
|
|
18
46
|
return [
|
|
19
47
|
['Account ID', input.account_id !== undefined ? code(input.account_id) : undefined],
|
|
@@ -21,34 +49,64 @@ function locationRows(input) {
|
|
|
21
49
|
['Workspace', input.workspace_id ? code(input.workspace_id) : undefined],
|
|
22
50
|
];
|
|
23
51
|
}
|
|
24
|
-
async function
|
|
25
|
-
|
|
52
|
+
async function readCurrentLocationOrThrow(client, input) {
|
|
53
|
+
const read = await readForPreview(() => client.listGoogleBusinessLocation({
|
|
26
54
|
workspace_id: input.workspace_id,
|
|
27
55
|
account_id: input.account_id,
|
|
28
56
|
location_id: input.location_id,
|
|
29
57
|
}));
|
|
58
|
+
if (!read.ok) {
|
|
59
|
+
if (/switched off/i.test(read.error)) {
|
|
60
|
+
throw new Error('Google Business location edits are switched off, so no confirmable preview was issued and nothing was read from Google.');
|
|
61
|
+
}
|
|
62
|
+
throw new Error(`posterly could not read the current Google Business location (${read.error}), so no confirmable preview was issued.`);
|
|
63
|
+
}
|
|
64
|
+
if (read.data?.enabled !== true) {
|
|
65
|
+
throw new Error('Google Business location edits are switched off, so no confirmable preview was issued and nothing was read from Google.');
|
|
66
|
+
}
|
|
67
|
+
return read.data;
|
|
30
68
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
69
|
+
function assertPreviewTokenPresentForConfirm(input, ctx) {
|
|
70
|
+
if (ctx.legacyConfirm)
|
|
71
|
+
return;
|
|
72
|
+
const token = input.preview_id;
|
|
73
|
+
if (typeof token !== 'string' || !token)
|
|
74
|
+
throw new Error(previewFailureMessage('missing'));
|
|
75
|
+
if (!parsePreviewToken(token))
|
|
76
|
+
throw new Error(previewFailureMessage('malformed'));
|
|
35
77
|
}
|
|
36
78
|
export const manageGoogleBusinessLocationTool = {
|
|
37
79
|
name: 'manage_google_business_location',
|
|
38
|
-
description: '
|
|
80
|
+
description: 'Update a Google Business location profile, hours, or attributes (one field group per call). Actions: update_hours (regular_hours.periods), update_attributes (attributes), update_description (description, max 750 chars, no URLs or phone numbers), update_categories (categories with primary_category and up to 9 additional_categories; carries over existing additional categories when omitted), update_services (service_items, replaces the full list or clears services when empty; free-form categories must belong to the location), update_title (title), update_phones (phone_numbers with primary_phone and up to 2 additional_phones; carries over existing additional phones when omitted), update_website (website_uri). Every action uses preview then confirm with a one-time token: call without confirm to get a preview and preview_id, show it to the user, then call again with confirm=true and that preview_id. Title and primary category edits warn that Google may hold the change for review and that an inaccurate name or category can get the listing suspended. Stays off until location edits are switched on; a confirm while it is off changes nothing and does not call Google.',
|
|
39
81
|
inputSchema: z.object({
|
|
40
|
-
action: z.enum([
|
|
82
|
+
action: z.enum([
|
|
83
|
+
'update_hours',
|
|
84
|
+
'update_attributes',
|
|
85
|
+
'update_description',
|
|
86
|
+
'update_categories',
|
|
87
|
+
'update_services',
|
|
88
|
+
'update_title',
|
|
89
|
+
'update_phones',
|
|
90
|
+
'update_website',
|
|
91
|
+
]).describe('Which location field group to update.'),
|
|
41
92
|
workspace_id: z.string().optional().describe('Filter to a workspace ID from whoami.'),
|
|
42
93
|
account_id: z.number().int().positive().optional().describe('Google Business account ID from list_accounts.'),
|
|
43
94
|
location_id: z.string().optional().describe(LOCATION_ID_DESCRIPTION),
|
|
44
95
|
regular_hours: z.object({ periods: z.array(periodSchema).min(1).max(14) }).optional().describe('update_hours: opening periods. Days are MONDAY-SUNDAY. Times are HH:MM.'),
|
|
45
96
|
attributes: z.array(attributeSchema).min(1).max(20).optional().describe('update_attributes: attributes to set. URL values must be https. Names look like attributes/has_wifi.'),
|
|
97
|
+
description: z.string().min(1).max(750).optional().describe('update_description: business description (max 750 chars, no URLs or phone numbers).'),
|
|
98
|
+
categories: categoriesSchema.optional().describe('update_categories: { primary_category, additional_categories? } with categories/gcid:... resource names (max 9 additional; existing additional categories are carried over when omitted).'),
|
|
99
|
+
service_items: z.array(serviceItemSchema).max(100).optional().describe('update_services: full replacement list of structured_service_item or free_form_service_item entries (pass [] to clear all services).'),
|
|
100
|
+
title: z.string().min(1).max(300).optional().describe('update_title: public business title on Google.'),
|
|
101
|
+
phone_numbers: phoneNumbersSchema.optional().describe('update_phones: { primary_phone, additional_phones? } (up to 2 additional; existing additional phones are carried over when omitted).'),
|
|
102
|
+
website_uri: z.string().min(1).max(2048).optional().describe('update_website: public website URL (http or https).'),
|
|
46
103
|
confirm: z.boolean().optional().describe('Leave out to get a preview; true only with the preview_id after the user approved it.'),
|
|
47
104
|
preview_id: z.string().optional().describe('The preview_id from the preview call. Required with confirm: true.'),
|
|
48
105
|
}),
|
|
49
106
|
async execute(client, input, ctx) {
|
|
50
107
|
const { mode, args } = validateArgs(ctx, 'manage_google_business_location', input);
|
|
51
108
|
const call = args;
|
|
109
|
+
const payload = (source = call) => omitKeys(source, ['action', 'confirm', 'preview_id']);
|
|
52
110
|
if (mode === 'update_attributes') {
|
|
53
111
|
return previewThenConfirm({
|
|
54
112
|
tool: 'manage_google_business_location',
|
|
@@ -58,17 +116,217 @@ export const manageGoogleBusinessLocationTool = {
|
|
|
58
116
|
legacyRefusal: 'Refusing to change Google Business attributes without confirm=true after explicit user confirmation.',
|
|
59
117
|
ctx,
|
|
60
118
|
describe: async () => {
|
|
61
|
-
const
|
|
62
|
-
const current =
|
|
119
|
+
const data = await readCurrentLocationOrThrow(client, call);
|
|
120
|
+
const current = Array.isArray(data?.attributes) ? gbpCurrentAttributesFor(data.attributes, call.attributes) : [];
|
|
63
121
|
return [
|
|
64
|
-
mdSection('Current values',
|
|
122
|
+
mdSection('Current values', gbpAttributeLines(current, 'None of these attributes is set now.')),
|
|
65
123
|
mdSection('Attributes to set', [gbpAttributeLines(call.attributes, 'No attributes were sent.'), '', mdKeyValue(locationRows(call))].join('\n')),
|
|
66
124
|
'This replaces those attributes on the public Google Business profile. Other attributes are left as they are. Nothing is sent until you confirm.',
|
|
67
125
|
].join('\n\n');
|
|
68
126
|
},
|
|
69
127
|
run: async () => {
|
|
70
|
-
const result = await client.updateGoogleBusinessAttributes(
|
|
71
|
-
return
|
|
128
|
+
const result = await client.updateGoogleBusinessAttributes(payload());
|
|
129
|
+
return formatGbpLocationUpdateOutcome('attributes', result);
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
if (mode === 'update_description') {
|
|
134
|
+
return previewThenConfirm({
|
|
135
|
+
tool: 'manage_google_business_location',
|
|
136
|
+
action: 'update_description',
|
|
137
|
+
args,
|
|
138
|
+
nonce: true,
|
|
139
|
+
legacyRefusal: 'Refusing to change Google Business description without confirm=true after explicit user confirmation.',
|
|
140
|
+
ctx,
|
|
141
|
+
describe: async () => {
|
|
142
|
+
const data = await readCurrentLocationOrThrow(client, call);
|
|
143
|
+
const current = gbpTextValueLine(data?.profile?.description ?? data?.description, 'No description is saved now.');
|
|
144
|
+
return [
|
|
145
|
+
mdSection('Current description', current),
|
|
146
|
+
mdSection('Description to set', [gbpTextValueLine(call.description, 'No description was sent.'), '', mdKeyValue(locationRows(call))].join('\n')),
|
|
147
|
+
'This replaces the business description on the public Google Business profile (max 750 characters, no URLs or phone numbers). Nothing is sent until you confirm.',
|
|
148
|
+
].join('\n\n');
|
|
149
|
+
},
|
|
150
|
+
run: async () => {
|
|
151
|
+
const result = await client.updateGoogleBusinessLocation(payload());
|
|
152
|
+
return formatGbpLocationUpdateOutcome('description', result);
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
if (mode === 'update_categories') {
|
|
157
|
+
const explicitAdditional = hasExplicitAdditionalCategories(call.categories) && !call.categories?.carried_over_additional_categories;
|
|
158
|
+
let currentData = null;
|
|
159
|
+
let resolvedArgs = args;
|
|
160
|
+
if (call.confirm !== true || !explicitAdditional) {
|
|
161
|
+
if (call.confirm === true)
|
|
162
|
+
assertPreviewTokenPresentForConfirm(call, ctx);
|
|
163
|
+
currentData = await readCurrentLocationOrThrow(client, call);
|
|
164
|
+
const resolved = resolveGbpCategoriesForWrite(call.categories, currentData.categories);
|
|
165
|
+
resolvedArgs = {
|
|
166
|
+
...args,
|
|
167
|
+
categories: {
|
|
168
|
+
primary_category: resolved.primary_category,
|
|
169
|
+
additional_categories: resolved.additional_categories,
|
|
170
|
+
...(resolved.explicit_additional_categories ? {} : { carried_over_additional_categories: true }),
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
const resolved = resolveGbpCategoriesForWrite(call.categories, null);
|
|
176
|
+
resolvedArgs = {
|
|
177
|
+
...args,
|
|
178
|
+
categories: {
|
|
179
|
+
primary_category: resolved.primary_category,
|
|
180
|
+
additional_categories: resolved.additional_categories,
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
return previewThenConfirm({
|
|
185
|
+
tool: 'manage_google_business_location',
|
|
186
|
+
action: 'update_categories',
|
|
187
|
+
args: resolvedArgs,
|
|
188
|
+
nonce: true,
|
|
189
|
+
legacyRefusal: 'Refusing to change Google Business categories without confirm=true after explicit user confirmation.',
|
|
190
|
+
mismatchMessage: !explicitAdditional ? GBP_LIVE_LISTING_CHANGED_ERROR : undefined,
|
|
191
|
+
ctx,
|
|
192
|
+
describe: async () => {
|
|
193
|
+
const data = currentData ?? (await readCurrentLocationOrThrow(client, call));
|
|
194
|
+
const current = gbpCategoriesLines(data?.categories, 'No categories are saved now.');
|
|
195
|
+
const proposed = gbpProposedCategoriesLines(call.categories, data?.categories);
|
|
196
|
+
return [
|
|
197
|
+
GBP_PRIMARY_CATEGORY_SUSPENSION_WARNING,
|
|
198
|
+
mdSection('Current categories', current),
|
|
199
|
+
mdSection('Categories to set', [proposed, '', mdKeyValue(locationRows(call))].join('\n')),
|
|
200
|
+
'This replaces the primary and additional categories on the public Google Business profile (existing additional categories are carried over unless explicitly changed). Nothing is sent until you confirm.',
|
|
201
|
+
].join('\n\n');
|
|
202
|
+
},
|
|
203
|
+
run: async () => {
|
|
204
|
+
const result = await client.updateGoogleBusinessLocation(payload(resolvedArgs));
|
|
205
|
+
return formatGbpLocationUpdateOutcome('categories', result);
|
|
206
|
+
},
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
if (mode === 'update_services') {
|
|
210
|
+
return previewThenConfirm({
|
|
211
|
+
tool: 'manage_google_business_location',
|
|
212
|
+
action: 'update_services',
|
|
213
|
+
args,
|
|
214
|
+
nonce: true,
|
|
215
|
+
legacyRefusal: 'Refusing to change Google Business services without confirm=true after explicit user confirmation.',
|
|
216
|
+
ctx,
|
|
217
|
+
describe: async () => {
|
|
218
|
+
const data = await readCurrentLocationOrThrow(client, call);
|
|
219
|
+
const current = gbpServiceItemLines(data?.service_items, 'No services are saved now.');
|
|
220
|
+
const clearingAll = Array.isArray(call.service_items) && call.service_items.length === 0;
|
|
221
|
+
return [
|
|
222
|
+
...(clearingAll ? [GBP_CLEAR_SERVICES_WARNING] : []),
|
|
223
|
+
mdSection('Current services', current),
|
|
224
|
+
mdSection('Services to set', [gbpProposedServiceItemLines(call.service_items, 'No services were sent.'), '', mdKeyValue(locationRows(call))].join('\n')),
|
|
225
|
+
'This replaces the entire service list on the public Google Business profile. Free-form service categories must belong to the location. Nothing is sent until you confirm.',
|
|
226
|
+
].join('\n\n');
|
|
227
|
+
},
|
|
228
|
+
run: async () => {
|
|
229
|
+
const result = await client.updateGoogleBusinessLocation(payload());
|
|
230
|
+
return formatGbpLocationUpdateOutcome('services', result);
|
|
231
|
+
},
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
if (mode === 'update_title') {
|
|
235
|
+
return previewThenConfirm({
|
|
236
|
+
tool: 'manage_google_business_location',
|
|
237
|
+
action: 'update_title',
|
|
238
|
+
args,
|
|
239
|
+
nonce: true,
|
|
240
|
+
legacyRefusal: 'Refusing to change Google Business title without confirm=true after explicit user confirmation.',
|
|
241
|
+
ctx,
|
|
242
|
+
describe: async () => {
|
|
243
|
+
const data = await readCurrentLocationOrThrow(client, call);
|
|
244
|
+
const current = gbpTextValueLine(data?.title, 'No business title is saved now.');
|
|
245
|
+
return [
|
|
246
|
+
GBP_TITLE_SUSPENSION_WARNING,
|
|
247
|
+
mdSection('Current title', current),
|
|
248
|
+
mdSection('Title to set', [gbpTextValueLine(call.title, 'No title was sent.'), '', mdKeyValue(locationRows(call))].join('\n')),
|
|
249
|
+
'This changes the business name on the public Google Business profile. Nothing is sent until you confirm.',
|
|
250
|
+
].join('\n\n');
|
|
251
|
+
},
|
|
252
|
+
run: async () => {
|
|
253
|
+
const result = await client.updateGoogleBusinessLocation(payload());
|
|
254
|
+
return formatGbpLocationUpdateOutcome('title', result);
|
|
255
|
+
},
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
if (mode === 'update_phones') {
|
|
259
|
+
const explicitAdditional = hasExplicitAdditionalPhones(call.phone_numbers) && !call.phone_numbers?.carried_over_additional_phones;
|
|
260
|
+
let currentData = null;
|
|
261
|
+
let resolvedArgs = args;
|
|
262
|
+
if (call.confirm !== true || !explicitAdditional) {
|
|
263
|
+
if (call.confirm === true)
|
|
264
|
+
assertPreviewTokenPresentForConfirm(call, ctx);
|
|
265
|
+
currentData = await readCurrentLocationOrThrow(client, call);
|
|
266
|
+
const resolved = resolveGbpPhoneNumbersForWrite(call.phone_numbers, currentData.phone_numbers);
|
|
267
|
+
resolvedArgs = {
|
|
268
|
+
...args,
|
|
269
|
+
phone_numbers: {
|
|
270
|
+
primary_phone: resolved.primary_phone,
|
|
271
|
+
additional_phones: resolved.additional_phones,
|
|
272
|
+
...(resolved.explicit_additional_phones ? {} : { carried_over_additional_phones: true }),
|
|
273
|
+
},
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
const resolved = resolveGbpPhoneNumbersForWrite(call.phone_numbers, null);
|
|
278
|
+
resolvedArgs = {
|
|
279
|
+
...args,
|
|
280
|
+
phone_numbers: {
|
|
281
|
+
primary_phone: resolved.primary_phone,
|
|
282
|
+
additional_phones: resolved.additional_phones,
|
|
283
|
+
},
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
return previewThenConfirm({
|
|
287
|
+
tool: 'manage_google_business_location',
|
|
288
|
+
action: 'update_phones',
|
|
289
|
+
args: resolvedArgs,
|
|
290
|
+
nonce: true,
|
|
291
|
+
legacyRefusal: 'Refusing to change Google Business phone numbers without confirm=true after explicit user confirmation.',
|
|
292
|
+
mismatchMessage: !explicitAdditional ? GBP_LIVE_LISTING_CHANGED_ERROR : undefined,
|
|
293
|
+
ctx,
|
|
294
|
+
describe: async () => {
|
|
295
|
+
const data = currentData ?? (await readCurrentLocationOrThrow(client, call));
|
|
296
|
+
const current = gbpPhoneNumbersLines(data?.phone_numbers, 'No phone numbers are saved now.');
|
|
297
|
+
const proposed = gbpProposedPhoneNumbersLines(call.phone_numbers, data?.phone_numbers);
|
|
298
|
+
return [
|
|
299
|
+
mdSection('Current phone numbers', current),
|
|
300
|
+
mdSection('Phone numbers to set', [proposed, '', mdKeyValue(locationRows(call))].join('\n')),
|
|
301
|
+
'This updates the phone numbers on the public Google Business profile (existing additional phones are carried over unless explicitly changed). Nothing is sent until you confirm.',
|
|
302
|
+
].join('\n\n');
|
|
303
|
+
},
|
|
304
|
+
run: async () => {
|
|
305
|
+
const result = await client.updateGoogleBusinessLocation(payload(resolvedArgs));
|
|
306
|
+
return formatGbpLocationUpdateOutcome('phone numbers', result);
|
|
307
|
+
},
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
if (mode === 'update_website') {
|
|
311
|
+
return previewThenConfirm({
|
|
312
|
+
tool: 'manage_google_business_location',
|
|
313
|
+
action: 'update_website',
|
|
314
|
+
args,
|
|
315
|
+
nonce: true,
|
|
316
|
+
legacyRefusal: 'Refusing to change Google Business website without confirm=true after explicit user confirmation.',
|
|
317
|
+
ctx,
|
|
318
|
+
describe: async () => {
|
|
319
|
+
const data = await readCurrentLocationOrThrow(client, call);
|
|
320
|
+
const current = gbpTextValueLine(data?.website_uri, 'No website URL is saved now.');
|
|
321
|
+
return [
|
|
322
|
+
mdSection('Current website', current),
|
|
323
|
+
mdSection('Website to set', [gbpTextValueLine(call.website_uri, 'No website URL was sent.'), '', mdKeyValue(locationRows(call))].join('\n')),
|
|
324
|
+
'This updates the website URL on the public Google Business profile. Nothing is sent until you confirm.',
|
|
325
|
+
].join('\n\n');
|
|
326
|
+
},
|
|
327
|
+
run: async () => {
|
|
328
|
+
const result = await client.updateGoogleBusinessLocation(payload());
|
|
329
|
+
return formatGbpLocationUpdateOutcome('website', result);
|
|
72
330
|
},
|
|
73
331
|
});
|
|
74
332
|
}
|
|
@@ -80,17 +338,17 @@ export const manageGoogleBusinessLocationTool = {
|
|
|
80
338
|
legacyRefusal: 'Refusing to change Google Business hours without confirm=true after explicit user confirmation.',
|
|
81
339
|
ctx,
|
|
82
340
|
describe: async () => {
|
|
83
|
-
const
|
|
84
|
-
const current =
|
|
341
|
+
const data = await readCurrentLocationOrThrow(client, call);
|
|
342
|
+
const current = Array.isArray(data?.regular_hours?.periods) ? data.regular_hours.periods : [];
|
|
85
343
|
return [
|
|
86
|
-
mdSection('Current regular hours',
|
|
344
|
+
mdSection('Current regular hours', gbpPeriodLines(current, 'No regular hours are saved now.')),
|
|
87
345
|
mdSection('Regular hours to set', [gbpPeriodLines(call.regular_hours?.periods, 'No opening periods were sent.'), '', GBP_CLOSED_DAYS_NOTE, '', mdKeyValue(locationRows(call))].join('\n')),
|
|
88
346
|
'This replaces the regular opening hours on the public Google Business profile. Nothing is sent until you confirm.',
|
|
89
347
|
].join('\n\n');
|
|
90
348
|
},
|
|
91
349
|
run: async () => {
|
|
92
|
-
const result = await client.updateGoogleBusinessHours(
|
|
93
|
-
return
|
|
350
|
+
const result = await client.updateGoogleBusinessHours(payload());
|
|
351
|
+
return formatGbpLocationUpdateOutcome('hours', result);
|
|
94
352
|
},
|
|
95
353
|
});
|
|
96
354
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "posterly-mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.63.0",
|
|
4
4
|
"mcpName": "io.github.awpthorp/posterly",
|
|
5
5
|
"description": "MCP server for posterly: schedule and publish social media posts across 18 platforms from any MCP client (Claude, ChatGPT, Cursor, Windsurf, Cline, and more)",
|
|
6
6
|
"license": "MIT",
|
package/server.json
CHANGED
|
@@ -3,8 +3,17 @@
|
|
|
3
3
|
"name": "io.github.awpthorp/posterly",
|
|
4
4
|
"title": "posterly",
|
|
5
5
|
"description": "Validate, schedule, publish, and analyze social content across 18 platforms with posterly.",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.63.0",
|
|
7
7
|
"websiteUrl": "https://www.poster.ly/mcp",
|
|
8
|
+
"icons": [
|
|
9
|
+
{
|
|
10
|
+
"src": "https://www.poster.ly/android-chrome-512x512.png",
|
|
11
|
+
"mimeType": "image/png",
|
|
12
|
+
"sizes": [
|
|
13
|
+
"512x512"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
],
|
|
8
17
|
"repository": {
|
|
9
18
|
"url": "https://github.com/awpthorp/posterly-mcp-server",
|
|
10
19
|
"source": "github"
|
|
@@ -13,7 +22,7 @@
|
|
|
13
22
|
{
|
|
14
23
|
"registryType": "npm",
|
|
15
24
|
"identifier": "posterly-mcp-server",
|
|
16
|
-
"version": "0.
|
|
25
|
+
"version": "0.63.0",
|
|
17
26
|
"transport": {
|
|
18
27
|
"type": "stdio"
|
|
19
28
|
},
|
package/tool-registry.json
CHANGED
|
@@ -1800,12 +1800,36 @@
|
|
|
1800
1800
|
},
|
|
1801
1801
|
"list_google_business_locations": {
|
|
1802
1802
|
"set": "google_business",
|
|
1803
|
-
"label": "Google location
|
|
1804
|
-
"
|
|
1805
|
-
"
|
|
1806
|
-
"
|
|
1807
|
-
|
|
1808
|
-
|
|
1803
|
+
"label": "Google location profile and categories",
|
|
1804
|
+
"selector": "view",
|
|
1805
|
+
"defaultMode": "profile",
|
|
1806
|
+
"views": {
|
|
1807
|
+
"profile": {
|
|
1808
|
+
"label": "Read a Google location profile, hours, and attributes",
|
|
1809
|
+
"openWorld": true,
|
|
1810
|
+
"params": {
|
|
1811
|
+
"workspace_id": { "type": "string" },
|
|
1812
|
+
"account_id": { "type": "integer", "min": 1 },
|
|
1813
|
+
"location_id": { "type": "string" },
|
|
1814
|
+
"include_google_updated": { "type": "boolean" }
|
|
1815
|
+
}
|
|
1816
|
+
},
|
|
1817
|
+
"categories": {
|
|
1818
|
+
"label": "Search Google Business categories",
|
|
1819
|
+
"openWorld": true,
|
|
1820
|
+
"params": {
|
|
1821
|
+
"workspace_id": { "type": "string" },
|
|
1822
|
+
"account_id": { "type": "integer", "min": 1 },
|
|
1823
|
+
"location_id": { "type": "string" },
|
|
1824
|
+
"region_code": { "type": "string", "required": true },
|
|
1825
|
+
"language_code": { "type": "string", "required": true },
|
|
1826
|
+
"category_view": { "type": "string", "enum": ["BASIC", "FULL"], "default": "BASIC" },
|
|
1827
|
+
"prefix": { "type": "string" },
|
|
1828
|
+
"page_size": { "type": "integer", "min": 1, "max": 100, "default": 50 },
|
|
1829
|
+
"page_token": { "type": "string" }
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1809
1833
|
},
|
|
1810
1834
|
"manage_google_business_location": {
|
|
1811
1835
|
"set": "google_business",
|
|
@@ -1839,6 +1863,90 @@
|
|
|
1839
1863
|
"location_id": { "type": "string" },
|
|
1840
1864
|
"attributes": { "type": "array", "required": true }
|
|
1841
1865
|
}
|
|
1866
|
+
},
|
|
1867
|
+
"update_description": {
|
|
1868
|
+
"label": "Update Google Business description",
|
|
1869
|
+
"destructive": true,
|
|
1870
|
+
"idempotent": true,
|
|
1871
|
+
"openWorld": true,
|
|
1872
|
+
"confirm": "preview",
|
|
1873
|
+
"nonce": true,
|
|
1874
|
+
"params": {
|
|
1875
|
+
"workspace_id": { "type": "string" },
|
|
1876
|
+
"account_id": { "type": "integer", "min": 1 },
|
|
1877
|
+
"location_id": { "type": "string" },
|
|
1878
|
+
"description": { "type": "string", "required": true }
|
|
1879
|
+
}
|
|
1880
|
+
},
|
|
1881
|
+
"update_categories": {
|
|
1882
|
+
"label": "Update Google Business categories",
|
|
1883
|
+
"destructive": true,
|
|
1884
|
+
"idempotent": true,
|
|
1885
|
+
"openWorld": true,
|
|
1886
|
+
"confirm": "preview",
|
|
1887
|
+
"nonce": true,
|
|
1888
|
+
"params": {
|
|
1889
|
+
"workspace_id": { "type": "string" },
|
|
1890
|
+
"account_id": { "type": "integer", "min": 1 },
|
|
1891
|
+
"location_id": { "type": "string" },
|
|
1892
|
+
"categories": { "type": "object", "required": true }
|
|
1893
|
+
}
|
|
1894
|
+
},
|
|
1895
|
+
"update_services": {
|
|
1896
|
+
"label": "Update Google Business services",
|
|
1897
|
+
"destructive": true,
|
|
1898
|
+
"idempotent": true,
|
|
1899
|
+
"openWorld": true,
|
|
1900
|
+
"confirm": "preview",
|
|
1901
|
+
"nonce": true,
|
|
1902
|
+
"params": {
|
|
1903
|
+
"workspace_id": { "type": "string" },
|
|
1904
|
+
"account_id": { "type": "integer", "min": 1 },
|
|
1905
|
+
"location_id": { "type": "string" },
|
|
1906
|
+
"service_items": { "type": "array", "required": true }
|
|
1907
|
+
}
|
|
1908
|
+
},
|
|
1909
|
+
"update_title": {
|
|
1910
|
+
"label": "Update Google Business title",
|
|
1911
|
+
"destructive": true,
|
|
1912
|
+
"idempotent": true,
|
|
1913
|
+
"openWorld": true,
|
|
1914
|
+
"confirm": "preview",
|
|
1915
|
+
"nonce": true,
|
|
1916
|
+
"params": {
|
|
1917
|
+
"workspace_id": { "type": "string" },
|
|
1918
|
+
"account_id": { "type": "integer", "min": 1 },
|
|
1919
|
+
"location_id": { "type": "string" },
|
|
1920
|
+
"title": { "type": "string", "required": true }
|
|
1921
|
+
}
|
|
1922
|
+
},
|
|
1923
|
+
"update_phones": {
|
|
1924
|
+
"label": "Update Google Business phone numbers",
|
|
1925
|
+
"destructive": true,
|
|
1926
|
+
"idempotent": true,
|
|
1927
|
+
"openWorld": true,
|
|
1928
|
+
"confirm": "preview",
|
|
1929
|
+
"nonce": true,
|
|
1930
|
+
"params": {
|
|
1931
|
+
"workspace_id": { "type": "string" },
|
|
1932
|
+
"account_id": { "type": "integer", "min": 1 },
|
|
1933
|
+
"location_id": { "type": "string" },
|
|
1934
|
+
"phone_numbers": { "type": "object", "required": true }
|
|
1935
|
+
}
|
|
1936
|
+
},
|
|
1937
|
+
"update_website": {
|
|
1938
|
+
"label": "Update Google Business website",
|
|
1939
|
+
"destructive": true,
|
|
1940
|
+
"idempotent": true,
|
|
1941
|
+
"openWorld": true,
|
|
1942
|
+
"confirm": "preview",
|
|
1943
|
+
"nonce": true,
|
|
1944
|
+
"params": {
|
|
1945
|
+
"workspace_id": { "type": "string" },
|
|
1946
|
+
"account_id": { "type": "integer", "min": 1 },
|
|
1947
|
+
"location_id": { "type": "string" },
|
|
1948
|
+
"website_uri": { "type": "string", "required": true }
|
|
1949
|
+
}
|
|
1842
1950
|
}
|
|
1843
1951
|
}
|
|
1844
1952
|
},
|