posterly-mcp-server 0.44.0 → 0.45.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 +310 -111
- package/dist/index.js +190 -894
- package/dist/lib/alias-transport.d.ts +84 -0
- package/dist/lib/alias-transport.js +193 -0
- package/dist/lib/api-client.d.ts +18 -0
- package/dist/lib/api-client.js +55 -0
- package/dist/lib/preview-token-core.d.ts +62 -0
- package/dist/lib/preview-token-core.js +131 -0
- package/dist/lib/preview-token.d.ts +23 -0
- package/dist/lib/preview-token.js +44 -0
- package/dist/lib/tool-registry.d.ts +246 -0
- package/dist/lib/tool-registry.js +394 -0
- package/dist/lib/tool-runtime.d.ts +68 -0
- package/dist/lib/tool-runtime.js +85 -0
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/tools/audit-google-business-profile.js +1 -1
- package/dist/tools/connect-account.d.ts +4 -4
- package/dist/tools/connect-account.js +2 -2
- package/dist/tools/create-connect-session.d.ts +2 -2
- package/dist/tools/create-connect-session.js +2 -2
- package/dist/tools/create-post.d.ts +6 -6
- package/dist/tools/create-post.js +3 -3
- package/dist/tools/create-posts-batch.d.ts +4 -4
- package/dist/tools/create-webhook.d.ts +2 -2
- package/dist/tools/delete-post.d.ts +34 -10
- package/dist/tools/delete-post.js +52 -16
- package/dist/tools/generate-captions.d.ts +2 -2
- package/dist/tools/generate-image.d.ts +4 -4
- package/dist/tools/generate-image.js +2 -2
- package/dist/tools/generate-video.d.ts +6 -6
- package/dist/tools/generate-video.js +1 -1
- package/dist/tools/get-agent-signup-info.js +2 -2
- package/dist/tools/get-post.d.ts +16 -1
- package/dist/tools/get-post.js +35 -19
- package/dist/tools/list-accounts.d.ts +49 -3
- package/dist/tools/list-accounts.js +148 -33
- package/dist/tools/list-analytics.d.ts +111 -0
- package/dist/tools/list-analytics.js +393 -0
- package/dist/tools/list-brands.d.ts +38 -3
- package/dist/tools/list-brands.js +138 -20
- package/dist/tools/list-comments.d.ts +29 -9
- package/dist/tools/list-comments.js +75 -34
- package/dist/tools/list-conversations.d.ts +32 -9
- package/dist/tools/list-conversations.js +63 -27
- package/dist/tools/list-google-business-media.js +1 -1
- package/dist/tools/list-google-business-reviews.d.ts +32 -9
- package/dist/tools/list-google-business-reviews.js +77 -52
- package/dist/tools/list-jobs.d.ts +60 -0
- package/dist/tools/list-jobs.js +81 -0
- package/dist/tools/list-platforms.d.ts +62 -3
- package/dist/tools/list-platforms.js +118 -9
- package/dist/tools/list-posts.d.ts +2 -2
- package/dist/tools/manage-comment.d.ts +102 -0
- package/dist/tools/manage-comment.js +125 -0
- package/dist/tools/manage-conversation.d.ts +79 -0
- package/dist/tools/manage-conversation.js +75 -0
- package/dist/tools/manage-google-business-media.d.ts +103 -0
- package/dist/tools/manage-google-business-media.js +126 -0
- package/dist/tools/manage-google-business-review.d.ts +146 -0
- package/dist/tools/manage-google-business-review.js +115 -0
- package/dist/tools/manage-oauth-client.d.ts +121 -0
- package/dist/tools/manage-oauth-client.js +94 -0
- package/dist/tools/manage-webhook.d.ts +99 -0
- package/dist/tools/manage-webhook.js +87 -0
- package/dist/tools/start-signup.d.ts +2 -2
- package/dist/tools/submit-agent-feedback.d.ts +4 -4
- package/dist/tools/trigger-platform-helper.d.ts +2 -2
- package/dist/tools/update-post.d.ts +62 -11
- package/dist/tools/update-post.js +79 -26
- package/dist/tools/upload-media.d.ts +32 -9
- package/dist/tools/upload-media.js +54 -18
- package/dist/tools/validate-post.d.ts +4 -4
- package/dist/tools/whoami.d.ts +15 -2
- package/dist/tools/whoami.js +221 -25
- package/package.json +5 -3
- package/scripts/test-alias-transport.mjs +368 -0
- package/scripts/test-client-header-sanitization.mjs +78 -0
- package/scripts/test-tool-annotations.mjs +38 -17
- package/server.json +9 -2
- package/src/index.ts +227 -1443
- package/src/lib/alias-transport.ts +233 -0
- package/src/lib/api-client.ts +65 -0
- package/src/lib/preview-token-core.ts +157 -0
- package/src/lib/preview-token.ts +54 -0
- package/src/lib/tool-registry.ts +538 -0
- package/src/lib/tool-runtime.ts +117 -0
- package/src/lib/version.ts +1 -1
- package/src/tools/audit-google-business-profile.ts +1 -1
- package/src/tools/connect-account.ts +2 -2
- package/src/tools/create-connect-session.ts +2 -2
- package/src/tools/create-post.ts +3 -3
- package/src/tools/delete-post.ts +60 -19
- package/src/tools/generate-image.ts +2 -2
- package/src/tools/generate-video.ts +1 -1
- package/src/tools/get-agent-signup-info.ts +2 -2
- package/src/tools/get-post.ts +35 -21
- package/src/tools/list-accounts.ts +187 -39
- package/src/tools/list-analytics.ts +444 -0
- package/src/tools/list-brands.ts +162 -26
- package/src/tools/list-comments.ts +86 -43
- package/src/tools/list-conversations.ts +81 -39
- package/src/tools/list-google-business-media.ts +1 -1
- package/src/tools/list-google-business-reviews.ts +93 -64
- package/src/tools/list-jobs.ts +91 -0
- package/src/tools/list-platforms.ts +135 -11
- package/src/tools/manage-comment.ts +142 -0
- package/src/tools/manage-conversation.ts +89 -0
- package/src/tools/manage-google-business-media.ts +147 -0
- package/src/tools/manage-google-business-review.ts +139 -0
- package/src/tools/manage-oauth-client.ts +116 -0
- package/src/tools/manage-webhook.ts +103 -0
- package/src/tools/update-post.ts +106 -39
- package/src/tools/upload-media.ts +76 -28
- package/src/tools/whoami.ts +253 -30
- package/tool-annotations.json +76 -149
- package/tool-registry.json +2085 -0
- package/src/tools/add-google-business-media.ts +0 -50
- package/src/tools/create-oauth-client.ts +0 -36
- package/src/tools/delete-comment.ts +0 -29
- package/src/tools/delete-google-business-media.ts +0 -30
- package/src/tools/delete-google-business-review-reply.ts +0 -30
- package/src/tools/delete-oauth-client.ts +0 -23
- package/src/tools/delete-post-group.ts +0 -17
- package/src/tools/delete-webhook.ts +0 -17
- package/src/tools/get-account-analytics.ts +0 -171
- package/src/tools/get-brand-profile.ts +0 -86
- package/src/tools/get-brand.ts +0 -34
- package/src/tools/get-comment.ts +0 -47
- package/src/tools/get-connect-link.ts +0 -61
- package/src/tools/get-connect-session.ts +0 -63
- package/src/tools/get-conversation.ts +0 -44
- package/src/tools/get-google-business-review-link.ts +0 -30
- package/src/tools/get-image-job.ts +0 -36
- package/src/tools/get-learned-voice.ts +0 -31
- package/src/tools/get-mcp-status.ts +0 -212
- package/src/tools/get-performance-profile.ts +0 -47
- package/src/tools/get-platform-schema.ts +0 -56
- package/src/tools/get-post-analytics.ts +0 -243
- package/src/tools/get-post-insights.ts +0 -60
- package/src/tools/get-post-missing.ts +0 -16
- package/src/tools/get-video-job.ts +0 -36
- package/src/tools/list-brand-accounts.ts +0 -36
- package/src/tools/reply-google-business-review.ts +0 -32
- package/src/tools/reply-to-comment.ts +0 -30
- package/src/tools/send-message.ts +0 -28
- package/src/tools/suggest-google-business-review-reply.ts +0 -44
- package/src/tools/sync-inbox.ts +0 -28
- package/src/tools/test-webhook.ts +0 -18
- package/src/tools/update-comment.ts +0 -31
- package/src/tools/update-oauth-client.ts +0 -38
- package/src/tools/update-post-release-id.ts +0 -25
- package/src/tools/update-post-status.ts +0 -31
- package/src/tools/update-webhook.ts +0 -36
- package/src/tools/upload-media-from-url.ts +0 -33
|
@@ -0,0 +1,538 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure, dependency-free helpers over the MCP tool registry
|
|
3
|
+
* (mcp-server/tool-registry.json). Shared by BOTH surfaces:
|
|
4
|
+
* - the npm stdio package (mcp-server/src/index.ts, alias-transport.ts)
|
|
5
|
+
* - the hosted endpoint (lib/mcp/tool-registry.ts re-exports these with the
|
|
6
|
+
* registry bound)
|
|
7
|
+
*
|
|
8
|
+
* This module never imports the JSON itself: each surface loads the registry
|
|
9
|
+
* its own way (createRequire on stdio, a static JSON import on hosted) and
|
|
10
|
+
* passes it in. Keep it free of Node, Next, and zod imports so it compiles
|
|
11
|
+
* unchanged under both the package tsconfig and the app tsconfig.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export type ToolsetName = string;
|
|
15
|
+
export type ConfirmLevel = 'none' | 'confirm' | 'preview';
|
|
16
|
+
export type ToolSurface = 'hosted' | 'stdio';
|
|
17
|
+
export type ModeSelector = 'view' | 'action' | 'type' | 'params';
|
|
18
|
+
|
|
19
|
+
export type ExceptionCategory =
|
|
20
|
+
| 'money'
|
|
21
|
+
| 'secret'
|
|
22
|
+
| 'signup'
|
|
23
|
+
| 'publishing'
|
|
24
|
+
| 'ai_generation'
|
|
25
|
+
| 'feedback'
|
|
26
|
+
| 'connect'
|
|
27
|
+
| 'single_action'
|
|
28
|
+
| 'session'
|
|
29
|
+
| 'dispatcher'
|
|
30
|
+
| 'report';
|
|
31
|
+
|
|
32
|
+
export interface ModeParamSpec {
|
|
33
|
+
type?: 'string' | 'integer' | 'number' | 'boolean' | 'array' | 'object';
|
|
34
|
+
required?: boolean;
|
|
35
|
+
default?: unknown;
|
|
36
|
+
min?: number;
|
|
37
|
+
max?: number;
|
|
38
|
+
enum?: Array<string | number>;
|
|
39
|
+
/** Keep an explicit null (for example workspace_id: null clears a webhook's workspace). */
|
|
40
|
+
nullable?: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** One view (read) or action (write) inside a multi-mode tool. */
|
|
44
|
+
export interface ToolModeEntry {
|
|
45
|
+
label: string;
|
|
46
|
+
destructive?: boolean;
|
|
47
|
+
idempotent?: boolean;
|
|
48
|
+
openWorld?: boolean;
|
|
49
|
+
confirm?: ConfirmLevel;
|
|
50
|
+
/** Preview actions whose confirm may be used once only (public writes). */
|
|
51
|
+
nonce?: boolean;
|
|
52
|
+
/** When present, the only params this mode accepts (besides the selector, confirm, preview_id). */
|
|
53
|
+
params?: Record<string, ModeParamSpec>;
|
|
54
|
+
/**
|
|
55
|
+
* Param-driven tools (selector "params") only: this mode is chosen when any
|
|
56
|
+
* of these params is present. The one mode without `when` is the default.
|
|
57
|
+
*/
|
|
58
|
+
when?: string[];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface ToolRegistryTool {
|
|
62
|
+
set: ToolsetName;
|
|
63
|
+
label: string;
|
|
64
|
+
/** Surfaces that register this tool. Defaults to both. */
|
|
65
|
+
surfaces?: ToolSurface[];
|
|
66
|
+
exception?: { category: ExceptionCategory; reason: string };
|
|
67
|
+
/** Single-mode tools carry their hints here; multi-mode tools derive them from views/actions. */
|
|
68
|
+
readOnly?: boolean;
|
|
69
|
+
destructive?: boolean;
|
|
70
|
+
idempotent?: boolean;
|
|
71
|
+
openWorld?: boolean;
|
|
72
|
+
confirm?: ConfirmLevel;
|
|
73
|
+
/**
|
|
74
|
+
* How a multi-mode tool picks its mode: an enum param (view/action/type), or
|
|
75
|
+
* "params" when the mode follows from which params are present (for example
|
|
76
|
+
* update_post with status vs content fields). Param-driven modes are still
|
|
77
|
+
* recorded as views/actions so the action count is derived from the registry.
|
|
78
|
+
*/
|
|
79
|
+
selector?: ModeSelector;
|
|
80
|
+
/** Default view/action when the selector param is omitted. */
|
|
81
|
+
defaultMode?: string;
|
|
82
|
+
views?: Record<string, ToolModeEntry>;
|
|
83
|
+
actions?: Record<string, ToolModeEntry>;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface ToolRegistryAlias {
|
|
87
|
+
target: string;
|
|
88
|
+
/** Params forced onto the translated call (inject wins over caller args). */
|
|
89
|
+
inject?: Record<string, unknown>;
|
|
90
|
+
/** Old param name -> new param name. */
|
|
91
|
+
rename?: Record<string, string>;
|
|
92
|
+
/** Accept confirm:true without preview_id until sunset (per call, never stored on shared context). */
|
|
93
|
+
legacyConfirm?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Param-driven targets (selector "params") only: the mode the old tool
|
|
96
|
+
* always ran in, so for example get_comment without comment_id is still
|
|
97
|
+
* rejected instead of silently listing every comment.
|
|
98
|
+
*/
|
|
99
|
+
mode?: string;
|
|
100
|
+
added: string;
|
|
101
|
+
sunset: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface ToolRegistry {
|
|
105
|
+
$comment?: string;
|
|
106
|
+
version: number;
|
|
107
|
+
designRules: 'off' | 'on';
|
|
108
|
+
budgets: { maxTotal: number; maxCore: number };
|
|
109
|
+
sunset: string | null;
|
|
110
|
+
toolsets: Record<ToolsetName, { label: string; description: string; alwaysOn?: boolean; surfaces?: ToolSurface[] }>;
|
|
111
|
+
tools: Record<string, ToolRegistryTool>;
|
|
112
|
+
aliases: Record<string, ToolRegistryAlias>;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface ResolvedAlias extends ToolRegistryAlias {
|
|
116
|
+
name: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** The alias entry for `name`, or null when `name` is not an alias. */
|
|
120
|
+
export function resolveAlias(registry: ToolRegistry, name: string): ResolvedAlias | null {
|
|
121
|
+
if (!Object.prototype.hasOwnProperty.call(registry.aliases, name)) return null;
|
|
122
|
+
return { name, ...registry.aliases[name] };
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function isPlainObject(value: unknown): value is Record<string, unknown> {
|
|
126
|
+
return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Translates an alias call's arguments into the target tool's arguments.
|
|
131
|
+
* Always returns a fresh object (never mutates the caller's args): renames
|
|
132
|
+
* first, then injected params, which win over anything the caller passed.
|
|
133
|
+
*/
|
|
134
|
+
export function translateArgs(alias: ToolRegistryAlias, args: unknown): Record<string, unknown> {
|
|
135
|
+
const source = isPlainObject(args) ? args : {};
|
|
136
|
+
const out: Record<string, unknown> = {};
|
|
137
|
+
for (const [key, value] of Object.entries(source)) {
|
|
138
|
+
const renamed = alias.rename && Object.prototype.hasOwnProperty.call(alias.rename, key) ? alias.rename[key] : key;
|
|
139
|
+
out[renamed] = value;
|
|
140
|
+
}
|
|
141
|
+
for (const [key, value] of Object.entries(alias.inject ?? {})) {
|
|
142
|
+
out[key] = value;
|
|
143
|
+
}
|
|
144
|
+
return out;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export type ValidateModeResult =
|
|
148
|
+
| { ok: true; mode: string | null; args: Record<string, unknown> }
|
|
149
|
+
| { ok: false; error: string };
|
|
150
|
+
|
|
151
|
+
const MODE_COMMON_PARAMS = new Set(['confirm', 'preview_id']);
|
|
152
|
+
|
|
153
|
+
function modeEntries(tool: ToolRegistryTool): Record<string, ToolModeEntry> | null {
|
|
154
|
+
return tool.views ?? tool.actions ?? null;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function normalizeParam(name: string, value: unknown, spec: ModeParamSpec, where: string): { ok: true; value: unknown } | { ok: false; error: string } {
|
|
158
|
+
switch (spec.type) {
|
|
159
|
+
case 'integer':
|
|
160
|
+
case 'number': {
|
|
161
|
+
let n: unknown = value;
|
|
162
|
+
if (typeof value === 'string' && value.trim() !== '' && /^-?\d+(\.\d+)?$/.test(value.trim())) n = Number(value.trim());
|
|
163
|
+
if (typeof n !== 'number' || !Number.isFinite(n)) return { ok: false, error: `${name} must be a number${where}.` };
|
|
164
|
+
if (spec.type === 'integer' && !Number.isInteger(n)) return { ok: false, error: `${name} must be a whole number${where}.` };
|
|
165
|
+
if (spec.min != null && n < spec.min) return { ok: false, error: `${name} must be at least ${spec.min}${where}.` };
|
|
166
|
+
if (spec.max != null && n > spec.max) return { ok: false, error: `${name} must be at most ${spec.max}${where}.` };
|
|
167
|
+
if (spec.enum && !spec.enum.includes(n)) return { ok: false, error: `${name} must be one of ${spec.enum.join(', ')}${where}.` };
|
|
168
|
+
return { ok: true, value: n };
|
|
169
|
+
}
|
|
170
|
+
case 'string': {
|
|
171
|
+
if (typeof value === 'number' && Number.isFinite(value)) value = String(value);
|
|
172
|
+
if (typeof value !== 'string') return { ok: false, error: `${name} must be a string${where}.` };
|
|
173
|
+
if (spec.enum && !spec.enum.includes(value)) return { ok: false, error: `${name} must be one of ${spec.enum.join(', ')}${where}.` };
|
|
174
|
+
return { ok: true, value };
|
|
175
|
+
}
|
|
176
|
+
case 'boolean':
|
|
177
|
+
if (typeof value !== 'boolean') return { ok: false, error: `${name} must be true or false${where}.` };
|
|
178
|
+
return { ok: true, value };
|
|
179
|
+
case 'array':
|
|
180
|
+
if (!Array.isArray(value)) return { ok: false, error: `${name} must be a list${where}.` };
|
|
181
|
+
return { ok: true, value };
|
|
182
|
+
case 'object':
|
|
183
|
+
if (!isPlainObject(value)) return { ok: false, error: `${name} must be an object${where}.` };
|
|
184
|
+
return { ok: true, value };
|
|
185
|
+
default:
|
|
186
|
+
return { ok: true, value };
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function isPresent(value: unknown): boolean {
|
|
191
|
+
return value !== undefined && value !== null && value !== '';
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* The mode a param-driven tool (selector "params") runs in for these args:
|
|
196
|
+
* the first mode whose `when` params are present, otherwise the tool's
|
|
197
|
+
* default mode (the one without `when`). Undefined for other tools.
|
|
198
|
+
*/
|
|
199
|
+
export function detectParamsMode(tool: ToolRegistryTool, args: unknown): string | undefined {
|
|
200
|
+
if (tool.selector !== 'params') return undefined;
|
|
201
|
+
const entries = modeEntries(tool);
|
|
202
|
+
if (!entries) return undefined;
|
|
203
|
+
const source = isPlainObject(args) ? args : {};
|
|
204
|
+
for (const [mode, entry] of Object.entries(entries)) {
|
|
205
|
+
if (entry.when?.some((key) => isPresent(source[key]))) return mode;
|
|
206
|
+
}
|
|
207
|
+
if (tool.defaultMode !== undefined) return tool.defaultMode;
|
|
208
|
+
return Object.entries(entries).find(([, entry]) => !entry.when)?.[0];
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Validates and normalises a call's arguments against the registry's per-mode
|
|
213
|
+
* rules, BEFORE any request is made. It is the normaliser on both surfaces
|
|
214
|
+
* (the hosted endpoint has no zod), so a preview call and its confirm call
|
|
215
|
+
* hash identically: numeric strings become numbers, defaults are applied, and
|
|
216
|
+
* params outside the selected mode are rejected with a plain error.
|
|
217
|
+
*
|
|
218
|
+
* `explicitMode` forces a mode for param-driven tools (selector "params"), for
|
|
219
|
+
* example an alias of the old get_comment tool always runs in the comment
|
|
220
|
+
* mode. Without it, a param-driven tool's mode is detected from which params
|
|
221
|
+
* are present (see detectParamsMode).
|
|
222
|
+
*
|
|
223
|
+
* Tools without views/actions, and modes without a `params` spec, pass
|
|
224
|
+
* through unchanged (a fresh copy).
|
|
225
|
+
*/
|
|
226
|
+
export function validateMode(
|
|
227
|
+
registry: ToolRegistry,
|
|
228
|
+
toolName: string,
|
|
229
|
+
args: unknown,
|
|
230
|
+
explicitMode?: string,
|
|
231
|
+
): ValidateModeResult {
|
|
232
|
+
const tool = registry.tools[toolName];
|
|
233
|
+
const source = isPlainObject(args) ? { ...args } : {};
|
|
234
|
+
if (!tool) return { ok: false, error: `Unknown tool: ${toolName}` };
|
|
235
|
+
const entries = modeEntries(tool);
|
|
236
|
+
if (!entries || !tool.selector) return { ok: true, mode: null, args: source };
|
|
237
|
+
|
|
238
|
+
const selector = tool.selector;
|
|
239
|
+
let mode: string | undefined = explicitMode;
|
|
240
|
+
if (selector === 'params' && mode === undefined) {
|
|
241
|
+
mode = detectParamsMode(tool, source);
|
|
242
|
+
} else if (selector !== 'params') {
|
|
243
|
+
const raw = source[selector];
|
|
244
|
+
if (raw === undefined || raw === null || raw === '') {
|
|
245
|
+
mode = tool.defaultMode;
|
|
246
|
+
if (mode === undefined) {
|
|
247
|
+
return { ok: false, error: `${selector} is required. Use one of: ${Object.keys(entries).join(', ')}.` };
|
|
248
|
+
}
|
|
249
|
+
source[selector] = mode;
|
|
250
|
+
} else if (typeof raw !== 'string' || !Object.prototype.hasOwnProperty.call(entries, raw)) {
|
|
251
|
+
return { ok: false, error: `${selector} must be one of: ${Object.keys(entries).join(', ')}.` };
|
|
252
|
+
} else {
|
|
253
|
+
mode = raw;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
if (mode === undefined) return { ok: true, mode: null, args: source };
|
|
257
|
+
const entry = entries[mode];
|
|
258
|
+
if (!entry) return { ok: false, error: `Unknown ${selector === 'params' ? 'mode' : selector} ${mode} for ${toolName}.` };
|
|
259
|
+
if (!entry.params) return { ok: true, mode, args: source };
|
|
260
|
+
|
|
261
|
+
const where = selector === 'params' ? '' : ` with ${selector}=${mode}`;
|
|
262
|
+
const notAllowedWhere = selector === 'params'
|
|
263
|
+
? (entry.when?.length ? ` together with ${entry.when.join(' or ')}` : '')
|
|
264
|
+
: where;
|
|
265
|
+
for (const key of Object.keys(source)) {
|
|
266
|
+
if (key === selector || MODE_COMMON_PARAMS.has(key)) continue;
|
|
267
|
+
if (!Object.prototype.hasOwnProperty.call(entry.params, key)) {
|
|
268
|
+
// Many clients send every optional field, unset ones as null or "".
|
|
269
|
+
// Those carry no value, so they are dropped (never rejected), which
|
|
270
|
+
// also keeps a preview call and its confirm call hashing identically.
|
|
271
|
+
if (!isPresent(source[key])) {
|
|
272
|
+
delete source[key];
|
|
273
|
+
continue;
|
|
274
|
+
}
|
|
275
|
+
return { ok: false, error: `${key} is not allowed${notAllowedWhere}.` };
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
for (const [name, spec] of Object.entries(entry.params)) {
|
|
279
|
+
// The old hosted tools skipped falsy values (`if (input?.limit)`), so an
|
|
280
|
+
// empty string for a non-string param still means "not given".
|
|
281
|
+
if (source[name] === '' && spec.type && spec.type !== 'string') delete source[name];
|
|
282
|
+
const value = source[name];
|
|
283
|
+
if (value === null && spec.nullable) continue;
|
|
284
|
+
if (value === undefined || value === null) {
|
|
285
|
+
if (spec.required) return { ok: false, error: `${name} is required${where}.` };
|
|
286
|
+
if (spec.default !== undefined) source[name] = spec.default;
|
|
287
|
+
else delete source[name];
|
|
288
|
+
continue;
|
|
289
|
+
}
|
|
290
|
+
const normalized = normalizeParam(name, value, spec, where);
|
|
291
|
+
if (!normalized.ok) return normalized;
|
|
292
|
+
source[name] = normalized.value;
|
|
293
|
+
}
|
|
294
|
+
return { ok: true, mode, args: source };
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
function sortKeysDeep(value: unknown): unknown {
|
|
298
|
+
if (Array.isArray(value)) return value.map((item) => (item === undefined ? null : sortKeysDeep(item)));
|
|
299
|
+
if (isPlainObject(value)) {
|
|
300
|
+
const out: Record<string, unknown> = {};
|
|
301
|
+
for (const key of Object.keys(value).sort()) {
|
|
302
|
+
const item = value[key];
|
|
303
|
+
if (item === undefined) continue;
|
|
304
|
+
out[key] = sortKeysDeep(item);
|
|
305
|
+
}
|
|
306
|
+
return out;
|
|
307
|
+
}
|
|
308
|
+
return value;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* The canonical form of a call's arguments for hashing: `confirm` and
|
|
313
|
+
* `preview_id` removed, undefined dropped, object keys sorted recursively,
|
|
314
|
+
* arrays kept in order. Pass args AFTER validateMode so defaults and number
|
|
315
|
+
* coercion are already applied.
|
|
316
|
+
*/
|
|
317
|
+
export function canonicalArgs(args: unknown): Record<string, unknown> {
|
|
318
|
+
const source = isPlainObject(args) ? args : {};
|
|
319
|
+
const stripped: Record<string, unknown> = {};
|
|
320
|
+
for (const [key, value] of Object.entries(source)) {
|
|
321
|
+
if (key === 'confirm' || key === 'preview_id') continue;
|
|
322
|
+
stripped[key] = value;
|
|
323
|
+
}
|
|
324
|
+
return sortKeysDeep(stripped) as Record<string, unknown>;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export interface DeprecationInfo {
|
|
328
|
+
old: string;
|
|
329
|
+
new: string;
|
|
330
|
+
action: string | null;
|
|
331
|
+
sunset: string;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
function injectedMode(alias: ToolRegistryAlias): { key: string; value: string } | null {
|
|
335
|
+
const inject = alias.inject ?? {};
|
|
336
|
+
for (const key of ['action', 'view', 'type'] as const) {
|
|
337
|
+
const value = inject[key];
|
|
338
|
+
if (typeof value === 'string') return { key, value };
|
|
339
|
+
}
|
|
340
|
+
return null;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* The note appended (as a final text content item, never touching content[0])
|
|
345
|
+
* to every alias call's result, plus the matching _meta payload. `action` in
|
|
346
|
+
* the payload is the injected view/action/type value (null when none).
|
|
347
|
+
*/
|
|
348
|
+
export function deprecationNote(alias: ResolvedAlias): { text: string; meta: DeprecationInfo } {
|
|
349
|
+
const mode = injectedMode(alias);
|
|
350
|
+
const target = mode ? `${alias.target} with ${mode.key}=${mode.value}` : alias.target;
|
|
351
|
+
return {
|
|
352
|
+
text: `Renamed: ${alias.name} is now ${target}. The old name may stop working after ${alias.sunset}.`,
|
|
353
|
+
meta: { old: alias.name, new: alias.target, action: mode ? mode.value : null, sunset: alias.sunset },
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export const DEPRECATION_META_KEY = 'posterly/deprecation';
|
|
358
|
+
|
|
359
|
+
export interface ParsedToolsets {
|
|
360
|
+
/** Enabled set names, or every set when "all" (the default). */
|
|
361
|
+
enabled: ToolsetName[];
|
|
362
|
+
/** Requested names that are not known sets (ignored). */
|
|
363
|
+
unknown: string[];
|
|
364
|
+
/** True when every set is enabled. */
|
|
365
|
+
all: boolean;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Parses a toolset selection such as "core,inbox" or "all". Empty, missing,
|
|
370
|
+
* or all-unknown input means every set (nobody loses tools by mistake).
|
|
371
|
+
* With a surface, sets not available on it (for example signup, stdio only,
|
|
372
|
+
* on the hosted endpoint) are treated as unknown.
|
|
373
|
+
*/
|
|
374
|
+
export function parseToolsets(
|
|
375
|
+
registry: ToolRegistry,
|
|
376
|
+
value: string | null | undefined,
|
|
377
|
+
surface?: ToolSurface,
|
|
378
|
+
): ParsedToolsets {
|
|
379
|
+
const available = Object.entries(registry.toolsets)
|
|
380
|
+
.filter(([, set]) => !surface || !set.surfaces || set.surfaces.includes(surface))
|
|
381
|
+
.map(([name]) => name);
|
|
382
|
+
const requested = String(value ?? '')
|
|
383
|
+
.split(',')
|
|
384
|
+
.map((part) => part.trim().toLowerCase())
|
|
385
|
+
.filter(Boolean);
|
|
386
|
+
if (requested.length === 0 || requested.includes('all')) {
|
|
387
|
+
return { enabled: available, unknown: requested.filter((name) => name !== 'all' && !available.includes(name)), all: true };
|
|
388
|
+
}
|
|
389
|
+
const enabled = available.filter((name) => requested.includes(name));
|
|
390
|
+
const unknown = requested.filter((name) => !available.includes(name));
|
|
391
|
+
if (enabled.length === 0) return { enabled: available, unknown, all: true };
|
|
392
|
+
return { enabled, unknown, all: enabled.length === available.length };
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Names of the canonical tools visible on `surface` for the enabled sets.
|
|
397
|
+
* Aliases are never listed. Sets marked alwaysOn (signup on stdio) are always
|
|
398
|
+
* visible. Surfaces keep their own registration order by filtering with this.
|
|
399
|
+
*/
|
|
400
|
+
export function visibleTools(registry: ToolRegistry, sets: ToolsetName[], surface: ToolSurface): Set<string> {
|
|
401
|
+
const enabled = new Set(sets);
|
|
402
|
+
const visible = new Set<string>();
|
|
403
|
+
for (const [name, tool] of Object.entries(registry.tools)) {
|
|
404
|
+
const surfaces = tool.surfaces ?? ['hosted', 'stdio'];
|
|
405
|
+
if (!surfaces.includes(surface)) continue;
|
|
406
|
+
const set = registry.toolsets[tool.set];
|
|
407
|
+
if (enabled.has(tool.set) || set?.alwaysOn) visible.add(name);
|
|
408
|
+
}
|
|
409
|
+
return visible;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export interface DerivedAnnotations {
|
|
413
|
+
readOnlyHint: boolean;
|
|
414
|
+
destructiveHint: boolean;
|
|
415
|
+
idempotentHint: boolean;
|
|
416
|
+
openWorldHint: boolean;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Annotation hints derived from the registry: a multi-action tool is
|
|
421
|
+
* destructive if any action is, idempotent only if all are, openWorld if any
|
|
422
|
+
* is; multi-view reads are readOnly + idempotent, openWorld if any view is.
|
|
423
|
+
*/
|
|
424
|
+
export function deriveAnnotations(tool: ToolRegistryTool): DerivedAnnotations {
|
|
425
|
+
if (tool.views && !tool.actions) {
|
|
426
|
+
const views = Object.values(tool.views);
|
|
427
|
+
return {
|
|
428
|
+
readOnlyHint: true,
|
|
429
|
+
destructiveHint: false,
|
|
430
|
+
idempotentHint: true,
|
|
431
|
+
openWorldHint: views.some((view) => view.openWorld === true),
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
if (tool.actions) {
|
|
435
|
+
const actions = Object.values(tool.actions);
|
|
436
|
+
return {
|
|
437
|
+
readOnlyHint: false,
|
|
438
|
+
destructiveHint: actions.some((action) => action.destructive === true),
|
|
439
|
+
idempotentHint: actions.length > 0 && actions.every((action) => action.idempotent === true),
|
|
440
|
+
openWorldHint: actions.some((action) => action.openWorld === true),
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
const readOnly = tool.readOnly === true;
|
|
444
|
+
return {
|
|
445
|
+
readOnlyHint: readOnly,
|
|
446
|
+
destructiveHint: !readOnly && tool.destructive === true,
|
|
447
|
+
idempotentHint: readOnly || tool.idempotent === true,
|
|
448
|
+
openWorldHint: tool.openWorld === true,
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/** Actions (sub tools) a tool counts for: its views/actions, otherwise 1. */
|
|
453
|
+
export function countActions(tool: ToolRegistryTool): number {
|
|
454
|
+
const entries = modeEntries(tool);
|
|
455
|
+
return entries ? Math.max(1, Object.keys(entries).length) : 1;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
export interface ToolListingAction {
|
|
459
|
+
key: string;
|
|
460
|
+
label: string;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
export interface ToolListingTool {
|
|
464
|
+
name: string;
|
|
465
|
+
label: string;
|
|
466
|
+
/** The view/action/type param name, or null for param-driven or single-mode tools. */
|
|
467
|
+
selector: string | null;
|
|
468
|
+
/** Views/actions (the "sub tools") with plain-English labels; empty for single-mode tools. */
|
|
469
|
+
actions: ToolListingAction[];
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
export interface ToolListingSet {
|
|
473
|
+
set: ToolsetName;
|
|
474
|
+
label: string;
|
|
475
|
+
description: string;
|
|
476
|
+
tools: ToolListingTool[];
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Every canonical tool on `surface`, grouped by tool set in registry order,
|
|
481
|
+
* each with its views/actions and their labels. This is what every tool list
|
|
482
|
+
* in the docs, marketing pages, and server card renders from, so the "sub
|
|
483
|
+
* tools" inside a merged tool are always shown. Aliases are never listed.
|
|
484
|
+
*/
|
|
485
|
+
export function listToolsBySet(registry: ToolRegistry, surface: ToolSurface): ToolListingSet[] {
|
|
486
|
+
const groups: ToolListingSet[] = [];
|
|
487
|
+
for (const [set, info] of Object.entries(registry.toolsets)) {
|
|
488
|
+
if (info.surfaces && !info.surfaces.includes(surface)) continue;
|
|
489
|
+
const tools: ToolListingTool[] = [];
|
|
490
|
+
for (const [name, tool] of Object.entries(registry.tools)) {
|
|
491
|
+
if (tool.set !== set) continue;
|
|
492
|
+
if (!(tool.surfaces ?? ['hosted', 'stdio']).includes(surface)) continue;
|
|
493
|
+
const entries = modeEntries(tool);
|
|
494
|
+
tools.push({
|
|
495
|
+
name,
|
|
496
|
+
label: tool.label,
|
|
497
|
+
selector: entries && tool.selector && tool.selector !== 'params' ? tool.selector : null,
|
|
498
|
+
actions: entries ? Object.entries(entries).map(([key, entry]) => ({ key, label: entry.label })) : [],
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
if (tools.length > 0) groups.push({ set, label: info.label, description: info.description, tools });
|
|
502
|
+
}
|
|
503
|
+
return groups;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* What a called name resolves to: the canonical tool plus the view/action it
|
|
508
|
+
* runs (for an alias), or the name itself. Used by /admin/mcp to show old
|
|
509
|
+
* names next to the tool they now reach, without any new telemetry column.
|
|
510
|
+
*/
|
|
511
|
+
export function resolveCalledTool(
|
|
512
|
+
registry: ToolRegistry,
|
|
513
|
+
calledName: string,
|
|
514
|
+
): { called: string; tool: string; mode: string | null; alias: boolean } {
|
|
515
|
+
const alias = resolveAlias(registry, calledName);
|
|
516
|
+
if (!alias) return { called: calledName, tool: calledName, mode: null, alias: false };
|
|
517
|
+
const injected = injectedMode(alias);
|
|
518
|
+
return { called: calledName, tool: alias.target, mode: injected?.value ?? alias.mode ?? null, alias: true };
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* The initialize `instructions` text: which tool sets exist, that they are
|
|
523
|
+
* all on by default, how to load fewer, and how preview then confirm works.
|
|
524
|
+
*/
|
|
525
|
+
export function toolsetInstructions(registry: ToolRegistry, surface: ToolSurface): string {
|
|
526
|
+
const sets = Object.entries(registry.toolsets)
|
|
527
|
+
.filter(([, set]) => !set.surfaces || set.surfaces.includes(surface))
|
|
528
|
+
.map(([name, set]) => `${name} (${set.description.split('. ')[0].replace(/\.$/, '')})`);
|
|
529
|
+
const howTo = surface === 'hosted'
|
|
530
|
+
? 'To load fewer tools with an API key in the Authorization header, add ?toolsets=core,inbox to the endpoint URL. OAuth connectors always get every set.'
|
|
531
|
+
: 'To load fewer tools, set POSTERLY_TOOLSETS=core,inbox (or pass --toolsets=core,inbox). The signup tools are always on.';
|
|
532
|
+
return [
|
|
533
|
+
`posterly groups its tools into sets: ${sets.join('; ')}.`,
|
|
534
|
+
`Every set is on by default. ${howTo} Sets only change which tools are listed; any tool can still be called by name.`,
|
|
535
|
+
'Merged tools pick what to do with a view, action, or type param; each tool description names every option.',
|
|
536
|
+
'Tools that post publicly or delete things use preview then confirm: call once without confirm to get a preview and a preview_id, show it to the user, then call again with confirm: true and that preview_id.',
|
|
537
|
+
].join(' ');
|
|
538
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-call context and shared helpers for the npm stdio tools that merge
|
|
3
|
+
* several old tools (MCP tool consolidation, 0.45.0).
|
|
4
|
+
*
|
|
5
|
+
* - validateArgs(): the registry's per-mode rules (mcp-server/tool-registry.json)
|
|
6
|
+
* run before any request, same as the hosted endpoint
|
|
7
|
+
* - previewThenConfirm(): preview then confirm for public or destructive
|
|
8
|
+
* actions; alias calls (ctx.legacyConfirm) keep their old one-step confirm
|
|
9
|
+
* until the alias sunset date
|
|
10
|
+
*
|
|
11
|
+
* The context is built per call in index.ts from the transport's request map,
|
|
12
|
+
* never stored in the arguments or on shared state.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { canonicalArgs, validateMode, type ToolRegistry } from './tool-registry.js';
|
|
16
|
+
import { previewFailureMessage } from './preview-token-core.js';
|
|
17
|
+
import type { StdioPreviewTokens } from './preview-token.js';
|
|
18
|
+
import { code, mdSection, mdTitle } from './format.js';
|
|
19
|
+
|
|
20
|
+
export interface ToolContext {
|
|
21
|
+
/** The name the client called: an alias or the canonical tool. */
|
|
22
|
+
calledName: string;
|
|
23
|
+
/** True for alias calls: confirm: true alone still runs preview actions until the sunset date. */
|
|
24
|
+
legacyConfirm: boolean;
|
|
25
|
+
registry: ToolRegistry;
|
|
26
|
+
previews: StdioPreviewTokens;
|
|
27
|
+
/** The tool sets listed in this process (POSTERLY_TOOLSETS); every set when all is true. */
|
|
28
|
+
toolsets?: { enabled: string[]; all: boolean };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** The local process serves one user; preview tokens are bound to this process's key anyway. */
|
|
32
|
+
const STDIO_PREVIEW_USER = 'stdio-local';
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Validates a merged tool's args against the registry's per-mode rules and
|
|
36
|
+
* returns the normalised args and mode. Throws a plain error before any request.
|
|
37
|
+
*/
|
|
38
|
+
export function validateArgs(
|
|
39
|
+
ctx: ToolContext,
|
|
40
|
+
tool: string,
|
|
41
|
+
input: unknown,
|
|
42
|
+
): { mode: string | null; args: Record<string, any> } {
|
|
43
|
+
const validated = validateMode(ctx.registry, tool, input);
|
|
44
|
+
if (!validated.ok) throw new Error(validated.error);
|
|
45
|
+
return { mode: validated.mode, args: validated.args };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** A shallow copy of args without the given keys. */
|
|
49
|
+
export function omitKeys(args: Record<string, any>, keys: string[]): Record<string, any> {
|
|
50
|
+
const out: Record<string, any> = {};
|
|
51
|
+
for (const [key, value] of Object.entries(args || {})) {
|
|
52
|
+
if (!keys.includes(key)) out[key] = value;
|
|
53
|
+
}
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function formatPreview(body: string, previewId: string, tool: string): string {
|
|
58
|
+
return [
|
|
59
|
+
mdTitle('Preview only: nothing has changed yet'),
|
|
60
|
+
body,
|
|
61
|
+
mdSection('Preview ID', `${code(previewId)} (expires in 10 minutes)`),
|
|
62
|
+
mdSection('Next step', `Show this preview to the user. Only after they explicitly approve, call ${tool} again with the same fields plus confirm: true and this preview_id.`),
|
|
63
|
+
].filter(Boolean).join('\n\n');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface PreviewStep {
|
|
67
|
+
tool: string;
|
|
68
|
+
action: string;
|
|
69
|
+
/** Validated (normalised) args: the preview and the confirm call must hash identically. */
|
|
70
|
+
args: Record<string, any>;
|
|
71
|
+
/** Public writes: a preview_id can be confirmed once only. */
|
|
72
|
+
nonce: boolean;
|
|
73
|
+
/** The old tool's refusal when confirm is missing, for alias calls. */
|
|
74
|
+
legacyRefusal: string;
|
|
75
|
+
ctx: ToolContext;
|
|
76
|
+
/** What will change (may make one read request; must not throw). */
|
|
77
|
+
describe: () => Promise<string>;
|
|
78
|
+
run: () => Promise<string>;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Preview then confirm (docs/mcp-tool-design.md section 4). Canonical calls:
|
|
83
|
+
* no confirm returns a preview and a preview_id bound to this tool, action,
|
|
84
|
+
* and exact args; confirm needs that preview_id. Alias calls keep the old
|
|
85
|
+
* contract until the sunset: confirm: true alone runs the action.
|
|
86
|
+
*/
|
|
87
|
+
export async function previewThenConfirm(step: PreviewStep): Promise<string> {
|
|
88
|
+
const { ctx, args } = step;
|
|
89
|
+
if (ctx.legacyConfirm) {
|
|
90
|
+
if (args.confirm !== true) throw new Error(step.legacyRefusal);
|
|
91
|
+
return step.run();
|
|
92
|
+
}
|
|
93
|
+
const binding = { userId: STDIO_PREVIEW_USER, tool: step.tool, action: step.action, args: canonicalArgs(args) };
|
|
94
|
+
if (args.confirm !== true) {
|
|
95
|
+
const previewId = ctx.previews.create(binding);
|
|
96
|
+
return formatPreview(await step.describe(), previewId, step.tool);
|
|
97
|
+
}
|
|
98
|
+
const token = args.preview_id;
|
|
99
|
+
if (typeof token !== 'string' || !token) throw new Error(previewFailureMessage('missing'));
|
|
100
|
+
const verified = ctx.previews.verify(token, binding);
|
|
101
|
+
if (!verified.ok) throw new Error(previewFailureMessage(verified.reason));
|
|
102
|
+
if (step.nonce && !ctx.previews.claimOnce(token, verified.exp)) throw new Error(previewFailureMessage('used'));
|
|
103
|
+
return step.run();
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Runs one read for a preview; a failed read (for example a 403 on a narrower key) falls back to echoing the request. */
|
|
107
|
+
export async function readForPreview<T>(read: () => Promise<T>): Promise<{ ok: true; data: T } | { ok: false; error: string }> {
|
|
108
|
+
try {
|
|
109
|
+
return { ok: true, data: await read() };
|
|
110
|
+
} catch (error: any) {
|
|
111
|
+
return { ok: false, error: error?.message || String(error) };
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function readFailedNote(error: string): string {
|
|
116
|
+
return `_posterly could not read the current item (${error}), so the preview shows the request as given._`;
|
|
117
|
+
}
|
package/src/lib/version.ts
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
// tool set (minus the intentional pre-auth signup tools that only this stdio
|
|
6
6
|
// package exposes). `npm run check:mcp-parity` enforces both the version match
|
|
7
7
|
// and the tool-list match, and runs in the pre-commit hook.
|
|
8
|
-
export const POSTERLY_MCP_VERSION = '0.
|
|
8
|
+
export const POSTERLY_MCP_VERSION = '0.45.0';
|
|
@@ -8,7 +8,7 @@ export const auditGoogleBusinessProfileTool = {
|
|
|
8
8
|
inputSchema: z.object({
|
|
9
9
|
workspace_id: z.string().optional().describe('Filter to a workspace ID from whoami.'),
|
|
10
10
|
account_id: z.number().int().positive().optional().describe('Google Business account ID from list_accounts.'),
|
|
11
|
-
location_id: z.string().optional().describe('Google Business numeric location id (the location_id/platform_user_id from list_accounts, e.g. "197940849675145390"). NOT the ChIJ... Place ID
|
|
11
|
+
location_id: z.string().optional().describe('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.'),
|
|
12
12
|
}),
|
|
13
13
|
|
|
14
14
|
async execute(
|