mcp-scraper 0.2.19 → 0.2.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/README.md +36 -5
  2. package/dist/bin/api-server.cjs +1072 -349
  3. package/dist/bin/api-server.cjs.map +1 -1
  4. package/dist/bin/api-server.js +3 -3
  5. package/dist/bin/browser-agent-stdio-server.cjs +1274 -75
  6. package/dist/bin/browser-agent-stdio-server.cjs.map +1 -1
  7. package/dist/bin/browser-agent-stdio-server.js +4 -2
  8. package/dist/bin/browser-agent-stdio-server.js.map +1 -1
  9. package/dist/bin/mcp-scraper-cli.cjs +659 -210
  10. package/dist/bin/mcp-scraper-cli.cjs.map +1 -1
  11. package/dist/bin/mcp-scraper-cli.js +108 -9
  12. package/dist/bin/mcp-scraper-cli.js.map +1 -1
  13. package/dist/bin/mcp-scraper-combined-stdio-server.cjs +2104 -566
  14. package/dist/bin/mcp-scraper-combined-stdio-server.cjs.map +1 -1
  15. package/dist/bin/mcp-scraper-combined-stdio-server.js +7 -4
  16. package/dist/bin/mcp-scraper-combined-stdio-server.js.map +1 -1
  17. package/dist/bin/mcp-scraper-install.cjs +3 -3
  18. package/dist/bin/mcp-scraper-install.cjs.map +1 -1
  19. package/dist/bin/mcp-scraper-install.js +2 -2
  20. package/dist/bin/mcp-stdio-server.cjs +726 -387
  21. package/dist/bin/mcp-stdio-server.cjs.map +1 -1
  22. package/dist/bin/mcp-stdio-server.js +3 -2
  23. package/dist/bin/mcp-stdio-server.js.map +1 -1
  24. package/dist/bin/paa-harvest.cjs +5 -3
  25. package/dist/bin/paa-harvest.cjs.map +1 -1
  26. package/dist/bin/paa-harvest.js +5 -2
  27. package/dist/bin/paa-harvest.js.map +1 -1
  28. package/dist/{chunk-TL7YTFLH.js → chunk-DBQDG7EH.js} +99 -27
  29. package/dist/chunk-DBQDG7EH.js.map +1 -0
  30. package/dist/chunk-DUEW4EOO.js +214 -0
  31. package/dist/chunk-DUEW4EOO.js.map +1 -0
  32. package/dist/{chunk-F44RBOJ5.js → chunk-H2R232HK.js} +216 -108
  33. package/dist/chunk-H2R232HK.js.map +1 -0
  34. package/dist/chunk-HS6OKELW.js +1786 -0
  35. package/dist/chunk-HS6OKELW.js.map +1 -0
  36. package/dist/{chunk-CQTAKXBN.js → chunk-IPW4LFOT.js} +11 -116
  37. package/dist/chunk-IPW4LFOT.js.map +1 -0
  38. package/dist/chunk-LFATOGDF.js +111 -0
  39. package/dist/chunk-LFATOGDF.js.map +1 -0
  40. package/dist/{chunk-MCBOZ2JF.js → chunk-MLNCKQ2B.js} +3 -3
  41. package/dist/chunk-MLNCKQ2B.js.map +1 -0
  42. package/dist/{chunk-4UEVYYDW.js → chunk-O5J7E4VX.js} +394 -57
  43. package/dist/chunk-O5J7E4VX.js.map +1 -0
  44. package/dist/{chunk-BSYPATSM.js → chunk-SXTXMFEQ.js} +2 -2
  45. package/dist/chunk-WN7PBKMV.js +28 -0
  46. package/dist/chunk-WN7PBKMV.js.map +1 -0
  47. package/dist/chunk-XKUDVN2E.js +7 -0
  48. package/dist/chunk-XKUDVN2E.js.map +1 -0
  49. package/dist/{db-P5X6UQ3E.js → db-BE4JVB3V.js} +8 -2
  50. package/dist/index.cjs +5 -3
  51. package/dist/index.cjs.map +1 -1
  52. package/dist/index.d.cts +2 -2
  53. package/dist/index.d.ts +2 -2
  54. package/dist/index.js +3 -1
  55. package/dist/index.js.map +1 -1
  56. package/dist/{server-CRUSZA2Q.js → server-24XIQ6W6.js} +248 -40
  57. package/dist/server-24XIQ6W6.js.map +1 -0
  58. package/dist/{worker-OZSWIS3F.js → worker-SLQ375UG.js} +8 -5
  59. package/dist/{worker-OZSWIS3F.js.map → worker-SLQ375UG.js.map} +1 -1
  60. package/docs/adr/0001-in-page-graphql-interception-for-anti-bot-scraping.md +2 -2
  61. package/docs/mcp-tool-craft-lint.generated.md +51 -0
  62. package/docs/mcp-tool-manifest.generated.json +1534 -0
  63. package/docs/specs/local-competitive-audit-spec.md +1 -2
  64. package/docs/specs/mcp-tool-definition-quality-audit-spec.md +1602 -0
  65. package/package.json +4 -1
  66. package/dist/chunk-4UEVYYDW.js.map +0 -1
  67. package/dist/chunk-76P4DKWR.js +0 -793
  68. package/dist/chunk-76P4DKWR.js.map +0 -1
  69. package/dist/chunk-CQTAKXBN.js.map +0 -1
  70. package/dist/chunk-F44RBOJ5.js.map +0 -1
  71. package/dist/chunk-MCBOZ2JF.js.map +0 -1
  72. package/dist/chunk-RU2HZD55.js +0 -7
  73. package/dist/chunk-RU2HZD55.js.map +0 -1
  74. package/dist/chunk-TL7YTFLH.js.map +0 -1
  75. package/dist/server-CRUSZA2Q.js.map +0 -1
  76. /package/dist/{chunk-BSYPATSM.js.map → chunk-SXTXMFEQ.js.map} +0 -0
  77. /package/dist/{db-P5X6UQ3E.js.map → db-BE4JVB3V.js.map} +0 -0
@@ -0,0 +1,1602 @@
1
+ # MCP Tool Definition Quality Audit Spec
2
+
3
+ Audit date: 2026-06-17
4
+
5
+ Repo reviewed: `/Users/vilovieta/Desktop/mcp-scraper`
6
+
7
+ Quality bar: the user's gold-standard MCP definition example, especially:
8
+
9
+ - names must make tool choice obvious
10
+ - descriptions must include what to use it for, the symptom/user phrasing that should trigger it, when not to use it, sibling tools, defaults, caps, cost, and recovery paths
11
+ - parameters must act as micro-runbooks, not labels
12
+ - parameter examples must silently teach exact accepted format, casing, units, and granularity
13
+ - outputs must be structured, high-signal, bounded, and aligned with descriptions
14
+ - responses must close the loop with resolved inputs, counts, cursors, truncation, diagnostics, and URLs
15
+ - write-like tools must state side effects and use suitable annotations
16
+ - every tool must stand alone because models often read one tool in isolation
17
+
18
+ Additional context reviewed:
19
+
20
+ - `/tmp/codex-remote-attachments/019ed213-92c4-7410-85f0-c616946ea57f/01E59EB1-700F-4535-9328-43B05F2A82AF/1-mcp-craft-vercel-linear-2026-06-17.pdf`
21
+ - The PDF adds emphasis on symptom-language descriptions, examples as format specifications, token economics, task-shaped tools, and the one-tool-isolation litmus test.
22
+
23
+ ## Executive Verdict
24
+
25
+ This MCP is operationally useful and has several strong tool definitions, especially `harvest_paa`, `maps_search`, `maps_place_intel`, `directory_workflow`, `credits_info`, and parts of the workflow layer.
26
+
27
+ It is not yet gold-standard. The biggest issue is not one weak description. It is that the full MCP surface is hard to identify and inconsistent across local combined stdio, main stdio, Browser Agent stdio, and hosted HTTP. After manual review, I found 41 unique public tool names across all local and hosted surfaces, while repo docs and tests still refer to 13, 23, 24, and 39 in different places.
28
+
29
+ There is also a systematic Browser Agent gap: Browser Agent returns JSON as text and registers no output schemas. That violates the "data as data" requirement across all 17 Browser Agent tools.
30
+
31
+ ## Surfaces Reviewed
32
+
33
+ ### Local MCP Scraper stdio
34
+
35
+ Entrypoint:
36
+
37
+ - `package.json` bin `mcp-scraper` -> `dist/bin/mcp-stdio-server.js`
38
+ - source server: `src/mcp/paa-mcp-server.ts`
39
+ - tool schemas: `src/mcp/mcp-tool-schemas.ts`
40
+ - response formatting: `src/mcp/mcp-response-formatter.ts`
41
+
42
+ Tool count found in source: 22.
43
+
44
+ ### Browser Agent stdio
45
+
46
+ Entrypoint:
47
+
48
+ - `package.json` bin `browser-agent` -> `dist/bin/browser-agent-stdio-server.js`
49
+ - source server: `src/mcp/browser-agent-mcp-server.ts`
50
+ - tool schemas: `src/mcp/browser-agent-tool-schemas.ts`
51
+
52
+ Tool count found in source: 17.
53
+
54
+ ### Combined stdio
55
+
56
+ Entrypoint:
57
+
58
+ - `package.json` bin `mcp-scraper-combined` -> `dist/bin/mcp-scraper-combined-stdio-server.js`
59
+
60
+ Tool count found in source: 39.
61
+
62
+ ### Hosted HTTP MCP
63
+
64
+ Source executor:
65
+
66
+ - `src/mcp/http-mcp-tool-executor.ts`
67
+
68
+ Tool count found in source path: 24.
69
+
70
+ The hosted surface appears to expose the main 22 tools plus 2 hosted-only SERP Intelligence capture tools.
71
+
72
+ ### Unique public tool names found
73
+
74
+ I found 41 unique public tool names when including the local main tools, Browser Agent tools, and hosted-only capture tools.
75
+
76
+ ## Inventory Drift Finding
77
+
78
+ Severity: P0
79
+
80
+ The repo does not have one canonical MCP manifest that answers "what is the full MCP?" without reverse-engineering multiple files.
81
+
82
+ Observed drift:
83
+
84
+ - `README.md` says the hosted MCP exposes 21 web-intelligence/workflow tools plus 2 SERP Intelligence capture tools, for 23 total.
85
+ - `tests/live/mcp/mcp-http-protocol.live.test.ts` expects 23 hosted tools.
86
+ - `tests/live/mcp/mcp-stdio-protocol.live.test.ts` still refers to `ALL_13_TOOLS`.
87
+ - `tests/unit/install-terminal.test.ts` references "39 MCP tools", which matches the local combined stdio surface.
88
+ - Source review found 22 main stdio tools, 17 Browser Agent tools, 39 combined stdio tools, 24 hosted HTTP tools, and 41 unique local plus hosted names.
89
+
90
+ What is wrong:
91
+
92
+ - A developer, user, or LLM cannot easily identify the complete MCP surface.
93
+ - Tests are not a reliable source of truth.
94
+ - Docs are not a reliable source of truth.
95
+ - Hosted and local surfaces are different, but the difference is not explicitly documented as a first-class contract.
96
+
97
+ What is needed:
98
+
99
+ - Add a canonical generated manifest, for example `docs/mcp-tool-manifest.generated.json`, produced from the same registration code used by the servers.
100
+ - Split the manifest by surface:
101
+ - `main_stdio`
102
+ - `browser_agent_stdio`
103
+ - `combined_stdio`
104
+ - `hosted_http`
105
+ - `hosted_only`
106
+ - Include name, description, input schema, output schema presence, annotations, formatter name, side effects, and sample prompts.
107
+ - Include `symptomTriggers`, `formatExamples`, `negativeSpace`, `tokenBudgetClass`, and `producesHandlesFor` metadata.
108
+ - Make tests assert against this generated manifest instead of hard-coded old counts.
109
+ - Add a short human doc page that says exactly:
110
+ - local main MCP exposes 22 tools
111
+ - Browser Agent exposes 17 tools
112
+ - combined local MCP exposes 39 tools
113
+ - hosted HTTP exposes 24 tools
114
+ - 41 unique names exist across all public surfaces
115
+
116
+ Why:
117
+
118
+ For an MCP, tool discoverability is part of the product. If the operator cannot easily tell whether there are 13, 23, 24, 39, or 41 tools, model-side tool selection and human-side support will both degrade.
119
+
120
+ ## Global Findings
121
+
122
+ ### G1. Browser Agent returns JSON as text
123
+
124
+ Severity: P0
125
+
126
+ Evidence:
127
+
128
+ - `src/mcp/browser-agent-mcp-server.ts` uses `textResult(value)` to return `JSON.stringify(value)` inside a text block.
129
+ - No Browser Agent tool registration includes `outputSchema`.
130
+
131
+ What is wrong:
132
+
133
+ - The model receives escaped JSON as text instead of structured data.
134
+ - Every Browser Agent tool requires ad hoc parsing by the model.
135
+ - Tool outputs cannot be validated or reasoned about by schema-aware clients.
136
+
137
+ What is needed:
138
+
139
+ - Add output schemas for all Browser Agent tools.
140
+ - Return `structuredContent` for every Browser Agent tool.
141
+ - Keep human-readable text only as a compact summary, not the primary data surface.
142
+ - For screenshot tools, return image content plus structured metadata.
143
+
144
+ Why:
145
+
146
+ The gold-standard requirement is explicit: do not return stringified JSON inside a text blob. Browser automation is perception-heavy; ambiguous string outputs create unnecessary failure modes.
147
+
148
+ ### G2. Several transcript and capture tools lack structured outputs
149
+
150
+ Severity: P1
151
+
152
+ Affected tools:
153
+
154
+ - `youtube_transcribe`
155
+ - `facebook_ad_transcribe`
156
+ - `capture_serp_snapshot`
157
+ - `capture_serp_page_snapshots`
158
+
159
+ What is wrong:
160
+
161
+ - These tools are high-value read tools, but their schema contracts are incomplete or absent.
162
+ - Transcript output is one of the most reusable MCP results, but the structured content path is missing.
163
+ - Capture tools intentionally skipped output schemas while payloads were evolving, but that leaves the model without a stable contract.
164
+
165
+ What is needed:
166
+
167
+ - Add stable envelopes even if nested payloads remain flexible:
168
+ - `source`
169
+ - `resolvedInput`
170
+ - `status`
171
+ - `transcript` or `captures`
172
+ - `summary`
173
+ - `artifact`
174
+ - `diagnostics`
175
+ - `errors`
176
+ - `schemaVersion`
177
+ - Keep volatile provider payloads under a namespaced `raw` or `providerPayload` field.
178
+
179
+ Why:
180
+
181
+ A stable envelope lets the model perform reliable next steps even while internal payloads evolve.
182
+
183
+ ### G3. Some descriptions promise fields that structured outputs omit
184
+
185
+ Severity: P1
186
+
187
+ Examples:
188
+
189
+ - `youtube_harvest` description promises dates and thumbnails, but the structured output omits them.
190
+ - `facebook_page_intel` description promises ad copy and landing URLs, but the structured output omits primary ad text and landing URL/domain fields.
191
+ - `extract_url` description promises markdown, metadata, Schema.org, media, visual styling, and downloads, but the structured output contains only a small summary.
192
+ - `maps_place_intel` description promises reviews, hours, menus, attributes, categories, posts, photos, and historical snapshots, but the structured output only exposes a subset.
193
+
194
+ What is wrong:
195
+
196
+ - The model cannot trust the description as an output contract.
197
+ - The user-facing text report may contain information that is invisible to schema-aware clients.
198
+
199
+ What is needed:
200
+
201
+ - For every promised output category, either add a compact structured field or remove the promise from the description.
202
+ - Add `truncated` flags and counts where returning the full category would be too large.
203
+ - Include artifact URLs or file paths when the full report contains more than the structured summary.
204
+
205
+ Why:
206
+
207
+ Gold-standard tool definitions align name, description, parameters, and return shape. Mismatches force the model to infer, parse prose, or make false assumptions.
208
+
209
+ ### G4. Too many generic workflow schemas
210
+
211
+ Severity: P1
212
+
213
+ Affected tools:
214
+
215
+ - `workflow_run`
216
+ - `workflow_step`
217
+ - `workflow_status`
218
+ - `workflow_artifact_read`
219
+
220
+ What is wrong:
221
+
222
+ - `workflow_run.input` is a broad `record(unknown)`.
223
+ - Workflow outputs use broad records for artifacts, summaries, diagnostics, and status details.
224
+ - The model gets good prose but weak schema boundaries.
225
+
226
+ What is needed:
227
+
228
+ - Add workflow-specific input contracts or a discriminated union keyed by workflow ID.
229
+ - Add `resolvedWorkflow`, `expectedNextTool`, `requiredInputFields`, `missingFields`, and `artifactManifest` to outputs.
230
+ - Add do-not-invent guards for run IDs, artifact IDs, and cursors.
231
+
232
+ Why:
233
+
234
+ Workflow orchestration is exactly where agents need the most guardrails. Prose alone is not enough.
235
+
236
+ ### G5. Proxy default documentation is stale
237
+
238
+ Severity: P1
239
+
240
+ What is wrong:
241
+
242
+ - README guidance still describes US local SERP defaults as location-based, while current schema defaults for `harvest_paa` and `search_serp` are `configured`.
243
+ - The user explicitly asked for API and MCP defaults to avoid setting proxy location except where needed, with Maps as the default-location exception. The tool schemas now mostly reflect that, but docs do not.
244
+
245
+ What is needed:
246
+
247
+ - Update README and any install/help text to say:
248
+ - default proxy mode is `configured` for general search/extract/social/video tools
249
+ - use explicit location only when the user asks for geographic SERP behavior
250
+ - Maps defaults to location-based proxying because Maps locality is intrinsic to the task
251
+ - Add regression tests that inspect schema defaults.
252
+
253
+ Why:
254
+
255
+ Proxy behavior is part of the semantic contract. Stale docs cause wrong calls, wrong location assumptions, and worse search success.
256
+
257
+ ### G6. Missing sample prompts as first-class schema/docs content
258
+
259
+ Severity: P2
260
+
261
+ What is wrong:
262
+
263
+ - Some descriptions include example request shapes inline.
264
+ - There is no consistent `samplePrompts` catalog per tool.
265
+
266
+ What is needed:
267
+
268
+ - Add 2 to 3 sample prompts for every tool in the generated manifest.
269
+ - Use realistic user phrasing, not internal API phrasing.
270
+ - Keep examples short and tied to the tool's highest-value use cases.
271
+
272
+ Why:
273
+
274
+ Sample prompts are cheap few-shot routing hints. They improve model tool selection before parameters are even considered.
275
+
276
+ ### G7. Missing negative space in many tool descriptions
277
+
278
+ Severity: P2
279
+
280
+ What is wrong:
281
+
282
+ Strong tools name sibling tools. Weak tools do not tell the model when not to use them.
283
+
284
+ What is needed:
285
+
286
+ Every description should include one or two sentences of negative space:
287
+
288
+ - use `extract_url` for one page, `map_site_urls` before crawling a site, `extract_site` after selecting URLs
289
+ - use `youtube_harvest` to discover videos, `youtube_transcribe` once you have one video ID or URL
290
+ - use `facebook_ad_search` to find advertisers, `facebook_page_intel` to inspect one advertiser, `facebook_ad_transcribe` or `facebook_video_transcribe` when video/audio text is needed
291
+ - use `browser_screenshot` or `browser_read` before clicking if the target is not known
292
+
293
+ Why:
294
+
295
+ Most model tool mistakes are tool-selection mistakes, not syntax mistakes.
296
+
297
+ ### G8. File-writing side effects are under-annotated
298
+
299
+ Severity: P2
300
+
301
+ Affected examples:
302
+
303
+ - `browser_replay_download`
304
+ - `browser_replay_annotate`
305
+ - `extract_url` when screenshots or media downloads are enabled
306
+ - possibly report-saving formatter behavior
307
+
308
+ What is wrong:
309
+
310
+ - Several tools can write local files while still being marked read-only or described mainly as read tools.
311
+
312
+ What is needed:
313
+
314
+ - Descriptions should state local file side effects.
315
+ - Annotations should distinguish external service mutations from local filesystem writes.
316
+ - Output schemas should return `artifactPath`, `artifactUrl`, `mimeType`, and `bytes` where applicable.
317
+
318
+ Why:
319
+
320
+ The user should not be surprised by files written to disk, and the model needs handles for follow-up work.
321
+
322
+ ### G9. Descriptions often name functions, not user symptoms
323
+
324
+ Severity: P2
325
+
326
+ What is wrong:
327
+
328
+ - Stronger descriptions explain the user problem that should trigger the tool, not only the API function.
329
+ - Several tools still read like implementation labels:
330
+ - `browser_goto`: navigate to a URL
331
+ - `browser_click`: click something
332
+ - `youtube_transcribe`: transcribe a video
333
+ - `workflow_status`: get status
334
+ - The model rarely thinks in those labels. It thinks "the page changed", "I need the transcript", "the workflow may still be running", or "I need to inspect the current screen."
335
+
336
+ What is needed:
337
+
338
+ - Add `symptomTriggers` to each manifest entry.
339
+ - Rewrite thin descriptions to include user-language triggers:
340
+ - "Use this when the user says the page failed to load, asks you to go to another URL, or you need to continue in an existing browser session."
341
+ - "Use this when the user asks what was said in a YouTube video or asks for claims, offers, or lessons from a video."
342
+ - "Use this when you started a workflow and need to know whether to poll, read an artifact, or report a failure."
343
+
344
+ Why:
345
+
346
+ The Vercel teardown point is direct: models route from the user's symptom, not the internal function name. Symptom phrasing raises first-call selection accuracy.
347
+
348
+ ### G10. Parameter examples do not consistently teach exact format
349
+
350
+ Severity: P2
351
+
352
+ What is wrong:
353
+
354
+ - Some parameters have examples, but the style is inconsistent.
355
+ - Format examples are missing for many fields where exact shape matters:
356
+ - YouTube video URL versus video ID
357
+ - Facebook page ID, ad archive ID, and video URL
358
+ - browser key combinations
359
+ - workflow IDs and artifact IDs
360
+ - country and language codes
361
+ - proxy modes and location strings
362
+
363
+ What is needed:
364
+
365
+ - Every parameter where the model could format incorrectly should include one concrete example in the accepted shape.
366
+ - Examples should encode exact casing, separators, ID prefixes, URL shape, units, and granularity.
367
+ - If aliases are accepted, examples should show both strict and human-friendly forms.
368
+
369
+ Why:
370
+
371
+ Models mimic examples. A parameter description without a concrete example leaves casing, units, and granularity to chance.
372
+
373
+ ### G11. The tool surface needs token-economics governance
374
+
375
+ Severity: P2
376
+
377
+ What is wrong:
378
+
379
+ - The MCP has grown to 39 combined local tools and 41 unique public names across all surfaces.
380
+ - The repo lacks a declared policy for when to add a new tool versus extend an existing task-shaped tool.
381
+ - Tool definitions are paid as context rent before any work begins.
382
+
383
+ What is needed:
384
+
385
+ - Add `tokenBudgetClass` to the manifest:
386
+ - `core`: high-frequency tools worth detailed descriptions
387
+ - `specialized`: lower-frequency tools that still need complete runbooks
388
+ - `hosted_only`: tools exposed only on hosted HTTP
389
+ - `internal_or_legacy`: tools that should not be prominent in docs
390
+ - Add a tool-addition rule:
391
+ - add a tool only when it represents a recurring user task that existing tools cannot serve cleanly
392
+ - otherwise improve the existing tool's parameters, negative space, or output schema
393
+ - Add an audit command that totals tool-description token cost by surface.
394
+
395
+ Why:
396
+
397
+ The PDF's token-economics point matters here because the surface is already large and hard to identify. A bigger MCP is only better if each added tool improves task routing more than it costs in always-loaded context.
398
+
399
+ ### G12. The one-tool-isolation litmus test is not enforced
400
+
401
+ Severity: P2
402
+
403
+ What is wrong:
404
+
405
+ - Some shared concepts are explained well in one tool but not repeated in related tools.
406
+ - Examples:
407
+ - Browser session ID guidance is repeated in schemas, but the action tools still lack full recovery and do-not-guess guidance.
408
+ - Proxy default behavior is clearer in schemas than in docs.
409
+ - Facebook discovery paths are implicit across several tools rather than repeated in each tool that needs them.
410
+
411
+ What is needed:
412
+
413
+ - Add a testable lint rule for tool descriptions:
414
+ - if a parameter accepts an opaque handle, the description must say where to get it
415
+ - if a tool overlaps with a sibling, the description must name that sibling
416
+ - if a parameter has an enum, the description must include the enum values
417
+ - if a parameter has a default, the description must state the default
418
+ - Treat repetition as correct, not redundant.
419
+
420
+ Why:
421
+
422
+ Models often evaluate one tool at a time. A tool description that depends on remembering another tool's docs is not self-contained enough.
423
+
424
+ ## Tool-by-Tool Spec
425
+
426
+ Priority scale:
427
+
428
+ - P0: Blocks reliable discovery or structured use.
429
+ - P1: Major model failure risk or contract mismatch.
430
+ - P2: Important improvement for routing, recovery, or boundedness.
431
+ - P3: Polish, consistency, or docs quality.
432
+
433
+ ### 1. `harvest_paa`
434
+
435
+ Surface: main stdio, combined stdio, hosted HTTP.
436
+
437
+ Current quality: strong.
438
+
439
+ What is wrong:
440
+
441
+ - Description is one of the best in the MCP, but structured output does not fully close the loop.
442
+ - PAA questions omit source URL/citation-level fields.
443
+ - Description mentions local pack data when present, but the output schema does not expose a dedicated local pack object.
444
+ - No explicit `resolvedInputs` object with proxy mode, requested location, resolved location, query, and cap.
445
+ - No consistent `truncated` or `hitLimit` signal when `maxQuestions` is reached.
446
+
447
+ Needed spec:
448
+
449
+ - Add `resolvedInputs`.
450
+ - Add `questions[].sourceUrl`, `questions[].sourceTitle`, `questions[].sourceSite`, and optional `questions[].answerExcerpt`.
451
+ - Add `localPack` or remove local-pack language from the description.
452
+ - Add `count`, `requestedMaxQuestions`, `truncated`, and `artifact`.
453
+ - Keep `proxyMode` default documented as `configured`.
454
+
455
+ Why:
456
+
457
+ This is a high-traffic search tool. It should be the reference implementation for structured search output.
458
+
459
+ ### 2. `search_serp`
460
+
461
+ Surface: main stdio, combined stdio, hosted HTTP.
462
+
463
+ Current quality: strong input schema, useful output.
464
+
465
+ What is wrong:
466
+
467
+ - Local pack structured entries are too thin for follow-up actions.
468
+ - Missing consistent `resolvedInputs`.
469
+ - Missing `truncated` or page/cap completion signal.
470
+ - Search diagnostics are not consistently structured unless debug paths are used.
471
+
472
+ Needed spec:
473
+
474
+ - Add `resolvedInputs` with query, search type, language, country, location, proxy mode, requested pages, and result caps.
475
+ - Expand local pack entries with address, phone, place URL, website URL, CID/place ID where available.
476
+ - Add `resultCounts` by block type: organic, local, ads, aiOverview, peopleAlsoAsk.
477
+ - Add `truncated`, `pagesFetched`, `nextRecommendedTool`, and `diagnostics`.
478
+
479
+ Why:
480
+
481
+ SERP outputs are branching points. The model needs enough structured detail to choose between extraction, Maps lookup, or another SERP pass.
482
+
483
+ ### 3. `extract_url`
484
+
485
+ Surface: main stdio, combined stdio, hosted HTTP.
486
+
487
+ Current quality: useful, but output contract is underbuilt.
488
+
489
+ What is wrong:
490
+
491
+ - Description promises markdown, metadata, Schema.org blocks, media, visual styling, screenshots, and downloads.
492
+ - Structured output exposes only a compact summary and omits most promised categories.
493
+ - `allowLocal` is documented, but the tool can also write screenshots/media locally and that side effect is not prominent enough.
494
+ - No structured `truncated` or `artifact` handle for the full extraction.
495
+
496
+ Needed spec:
497
+
498
+ - Add structured fields:
499
+ - `url`, `finalUrl`, `statusCode`, `title`, `description`, `canonicalUrl`
500
+ - `bodyMarkdown`, `bodyTextExcerpt`, `wordCount`, `headings`
501
+ - `schemaOrg`
502
+ - `links`
503
+ - `images`, `video`, `mediaAssets`
504
+ - `styles`, `colors`, `fonts`
505
+ - `screenshot`
506
+ - `downloads`
507
+ - `artifact`
508
+ - `truncated`
509
+ - State clearly when to use `map_site_urls` and `extract_site` instead.
510
+ - Add sample prompts for page extraction, competitor page capture, and visual asset extraction.
511
+
512
+ Why:
513
+
514
+ This is a core research primitive. If the report has the data but structured output hides it, downstream agents cannot reliably use it.
515
+
516
+ ### 4. `map_site_urls`
517
+
518
+ Surface: main stdio, combined stdio, hosted HTTP.
519
+
520
+ Current quality: good.
521
+
522
+ What is wrong:
523
+
524
+ - It is named as a mapping tool, but the description could better distinguish discovery from extraction.
525
+ - `maxUrls` lacks a strong default/cap explanation in the schema.
526
+ - Output has `truncated`, but not enough explanation of excluded URLs or crawl boundaries.
527
+
528
+ Needed spec:
529
+
530
+ - Add description sentence: "Use this before `extract_site` when you need to choose pages; use `extract_url` for a single known URL."
531
+ - Add `resolvedInputs` with start URL, final URL, same-domain policy, limit, depth, and exclusions.
532
+ - Add `excludedCounts` by reason, such as off-domain, duplicate, unsupported scheme, blocked, too deep.
533
+ - Add sample prompts for sitemap discovery, competitor page inventory, and choosing pages for extraction.
534
+
535
+ Why:
536
+
537
+ URL mapping is a planning tool. The output should explain what it did not include as much as what it did include.
538
+
539
+ ### 5. `extract_site`
540
+
541
+ Surface: main stdio, combined stdio, hosted HTTP.
542
+
543
+ Current quality: useful but underspecified.
544
+
545
+ What is wrong:
546
+
547
+ - The structured output is too small for site-level extraction.
548
+ - Description does not fully explain how it relates to `map_site_urls`.
549
+ - Output lacks per-page status, word counts, canonical URLs, extraction errors, and truncation detail.
550
+
551
+ Needed spec:
552
+
553
+ - Add `resolvedInputs` and `crawlPlan`.
554
+ - Return `pages[]` with URL, final URL, title, status, word count, schema types, headings, canonical URL, and artifact references.
555
+ - Add `failedPages[]` with errors.
556
+ - Add `truncated`, `pagesRequested`, `pagesExtracted`, and `nextRecommendedTool`.
557
+ - Add examples for "extract these selected URLs" and "crawl a small site".
558
+
559
+ Why:
560
+
561
+ Site extraction should create a reliable corpus manifest, not just a prose report.
562
+
563
+ ### 6. `youtube_harvest`
564
+
565
+ Surface: main stdio, combined stdio, hosted HTTP.
566
+
567
+ Current quality: medium.
568
+
569
+ What is wrong:
570
+
571
+ - Description promises titles, views, dates, durations, URLs, thumbnails, and video IDs.
572
+ - Structured output omits publish dates and thumbnails.
573
+ - `maxVideos` allows up to 500 without a clear cost/size warning.
574
+ - Description should more clearly point to `youtube_transcribe` for one selected video.
575
+
576
+ Needed spec:
577
+
578
+ - Add `videos[].publishedAt`, `videos[].thumbnailUrl`, `videos[].channelUrl`, and `videos[].descriptionExcerpt`.
579
+ - Add `requestedMaxVideos`, `returnedCount`, `truncated`, and `resolvedInputs`.
580
+ - State that broad channel/search harvests can be large and should use narrower queries or smaller limits.
581
+ - Add negative space: use `youtube_transcribe` for transcript extraction after selecting a video.
582
+
583
+ Why:
584
+
585
+ Harvest is a discovery tool. Missing dates and thumbnails reduce ranking and selection quality.
586
+
587
+ ### 7. `youtube_transcribe`
588
+
589
+ Surface: main stdio, combined stdio, hosted HTTP.
590
+
591
+ Current quality: weak relative to importance.
592
+
593
+ What is wrong:
594
+
595
+ - No output schema.
596
+ - No `structuredContent`.
597
+ - Formatter returns one text block.
598
+ - Input schema only accepts `videoId`, while the description says the model can infer from a URL if the user provided one.
599
+ - No structured transcript metadata such as language, duration, source URL, word count, or chunk count.
600
+
601
+ Needed spec:
602
+
603
+ - Accept `videoId` or `url` explicitly.
604
+ - Add recovery text: "If the user gave a YouTube URL, pass it as `url`; do not manually strip parameters unless needed."
605
+ - Add output schema:
606
+ - `videoId`
607
+ - `url`
608
+ - `title`
609
+ - `channelName`
610
+ - `duration`
611
+ - `language`
612
+ - `transcript`
613
+ - `segments`
614
+ - `wordCount`
615
+ - `artifact`
616
+ - `resolvedInputs`
617
+ - `errors`
618
+ - Add `truncated` if transcript text is capped in content.
619
+
620
+ Why:
621
+
622
+ Transcripts are often reused for summaries, quotes, outlines, and extraction. Text-only JSON/report output is not enough.
623
+
624
+ ### 8. `facebook_page_intel`
625
+
626
+ Surface: main stdio, combined stdio, hosted HTTP.
627
+
628
+ Current quality: medium-low.
629
+
630
+ What is wrong:
631
+
632
+ - Several parameter descriptions are labels rather than runbooks.
633
+ - `pageId`, `libraryId`, `country`, and `maxAds` need clearer accepted formats and recovery paths.
634
+ - Description promises page metadata, ad copy, landing URLs, media, and Page Transparency.
635
+ - Structured output omits important ad copy and landing URL fields.
636
+
637
+ Needed spec:
638
+
639
+ - Add parameter runbooks:
640
+ - `pageId`: explain numeric page ID and how to get it from `facebook_ad_search`
641
+ - `libraryId`: explain ad library ID and when to use it
642
+ - `country`: include ISO examples and default
643
+ - `maxAds`: default, max, and filtering advice
644
+ - Add output fields:
645
+ - `page`
646
+ - `transparency`
647
+ - `ads[].libraryId`
648
+ - `ads[].primaryText`
649
+ - `ads[].headline`
650
+ - `ads[].cta`
651
+ - `ads[].landingUrl`
652
+ - `ads[].domain`
653
+ - `ads[].media`
654
+ - `ads[].startedAt`
655
+ - `ads[].isActive`
656
+ - `resolvedInputs`
657
+ - `truncated`
658
+ - Add negative space: use `facebook_ad_search` when you do not know the page; use transcript tools for video text.
659
+
660
+ Why:
661
+
662
+ Facebook workflows are ID-heavy. The tool must teach discovery and provide enough structured ad data for competitive research.
663
+
664
+ ### 9. `facebook_ad_search`
665
+
666
+ Surface: main stdio, combined stdio, hosted HTTP.
667
+
668
+ Current quality: medium.
669
+
670
+ What is wrong:
671
+
672
+ - `country` and `maxResults` descriptions are too thin.
673
+ - Output does not fully close the loop for the next tool call.
674
+ - Description should name `facebook_page_intel` as the next step more explicitly.
675
+
676
+ Needed spec:
677
+
678
+ - Add parameter descriptions with defaults, examples, cap, and country behavior.
679
+ - Return `pages[]` with page ID, page name, page URL, matched ad library IDs, active ad count, country, and confidence.
680
+ - Add `nextRecommendedTool` with ready-to-pass args for `facebook_page_intel`.
681
+ - Add `resolvedInputs`, `count`, and `truncated`.
682
+
683
+ Why:
684
+
685
+ This is a discovery tool. Its main job is to produce correct handles for page-level inspection.
686
+
687
+ ### 10. `facebook_ad_transcribe`
688
+
689
+ Surface: main stdio, combined stdio, hosted HTTP.
690
+
691
+ Current quality: weak.
692
+
693
+ What is wrong:
694
+
695
+ - No output schema.
696
+ - No `structuredContent`.
697
+ - Formatter returns only text.
698
+ - The input schema is decent, but it should clarify accepted URL forms and what to do if the user only has a library ID.
699
+
700
+ Needed spec:
701
+
702
+ - Add output schema:
703
+ - `adArchiveId`
704
+ - `adUrl`
705
+ - `videoUrl`
706
+ - `transcript`
707
+ - `segments`
708
+ - `language`
709
+ - `duration`
710
+ - `wordCount`
711
+ - `artifact`
712
+ - `resolvedInputs`
713
+ - `errors`
714
+ - Add negative space: use `facebook_page_intel` first if the user has only an advertiser or page.
715
+ - Add sample prompts for transcribing one Facebook ad, extracting claims, and comparing ad angles.
716
+
717
+ Why:
718
+
719
+ Ad transcription is a high-value competitive-intelligence output. It should be directly machine-readable.
720
+
721
+ ### 11. `facebook_video_transcribe`
722
+
723
+ Surface: main stdio, combined stdio, hosted HTTP.
724
+
725
+ Current quality: strong relative to neighboring Facebook tools.
726
+
727
+ What is wrong:
728
+
729
+ - Output schema is present, but it could expose more download and media-selection detail.
730
+ - Quality fallback behavior should be reflected in `resolvedInputs`.
731
+ - The description should make clearer when to choose this over `facebook_ad_transcribe`.
732
+
733
+ Needed spec:
734
+
735
+ - Add `resolvedInputs` with requested quality, selected quality, and whether fallback occurred.
736
+ - Add `media` with source URL, downloaded bytes, mime type, and extraction method.
737
+ - Add negative space: use this for organic Facebook videos; use `facebook_ad_transcribe` for Ads Library creatives.
738
+ - Add `truncated` and `artifact`.
739
+
740
+ Why:
741
+
742
+ Video transcription depends on media resolution and fallback behavior. The model should know which asset was actually transcribed.
743
+
744
+ ### 12. `maps_place_intel`
745
+
746
+ Surface: main stdio, combined stdio, hosted HTTP.
747
+
748
+ Current quality: strong.
749
+
750
+ What is wrong:
751
+
752
+ - Description promises reviews, hours, menus, attributes, categories, posts, photos, and historical snapshots.
753
+ - Structured output exposes some but not all of those categories.
754
+ - Review output is too summary-oriented for tasks that need exact review evidence.
755
+ - No explicit `resolvedInputs` object.
756
+
757
+ Needed spec:
758
+
759
+ - Add `resolvedInputs` with place ID, Maps URL, query, location, and selected place.
760
+ - Add compact structured fields for:
761
+ - reviews
762
+ - reviewHistogram
763
+ - hours
764
+ - attributes
765
+ - serviceOptions
766
+ - categories
767
+ - posts
768
+ - photos
769
+ - menu
770
+ - historicalSnapshots
771
+ - Include counts and `truncated` per section.
772
+ - Add `artifact` for the full report.
773
+
774
+ Why:
775
+
776
+ Maps intelligence is one of the highest-value tools. It should preserve evidence, not only conclusions.
777
+
778
+ ### 13. `maps_search`
779
+
780
+ Surface: main stdio, combined stdio, hosted HTTP.
781
+
782
+ Current quality: strong.
783
+
784
+ What is wrong:
785
+
786
+ - This is correctly treated as a default-location tool, but that exception should be documented consistently.
787
+ - Output could better indicate cap hits and next steps.
788
+ - The tool does not use pagination, so limit handling must be explicit.
789
+
790
+ Needed spec:
791
+
792
+ - Add `resolvedInputs` with query, requested location, proxy mode, resolved proxy, and limit.
793
+ - Add `truncated` when result count reaches the requested max.
794
+ - Add `nextRecommendedTool` with ready-to-pass `maps_place_intel` args for top candidates.
795
+ - Add sample prompts for local competitor lookup, category search, and place discovery.
796
+
797
+ Why:
798
+
799
+ Maps search is inherently location-sensitive. It is the right exception to the no-default-location proxy policy, but it needs to say so everywhere.
800
+
801
+ ### 14. `directory_workflow`
802
+
803
+ Surface: main stdio, combined stdio, hosted HTTP.
804
+
805
+ Current quality: strong but dense.
806
+
807
+ What is wrong:
808
+
809
+ - Description is useful but long.
810
+ - Output is strong, but per-city partial failures and cap hits should be more explicit.
811
+ - Credit/cost expectations are not as explicit as they are in `harvest_paa`.
812
+
813
+ Needed spec:
814
+
815
+ - Add `estimatedCredits` or a cost note in the description.
816
+ - Add `cities[]` fields for requested ZIP/city, resolved city, attempt count, status, result count, and errors.
817
+ - Add `failedCityCount`, `partial`, and `truncated`.
818
+ - Add negative space: use `maps_search` for one city/category; use this for scaled directory builds.
819
+
820
+ Why:
821
+
822
+ Directory workflows can be expensive and multi-step. The model needs clear partial-success handling.
823
+
824
+ ### 15. `workflow_list`
825
+
826
+ Surface: main stdio, combined stdio, hosted HTTP.
827
+
828
+ Current quality: good.
829
+
830
+ What is wrong:
831
+
832
+ - It is a list tool, but this is acceptable because it lists available workflows rather than user data.
833
+ - Description could better name the follow-up path.
834
+ - Sample prompts are missing.
835
+
836
+ Needed spec:
837
+
838
+ - Add sample prompts for "what workflows are available" and "show workflows for local SEO."
839
+ - Return `workflows[]` with ID, title, goal, required inputs, estimated cost, expected duration, and next tool.
840
+ - Add `nextRecommendedTool: workflow_suggest` or `workflow_run` depending on context.
841
+
842
+ Why:
843
+
844
+ Workflow discovery should quickly transition into either suggestion or execution.
845
+
846
+ ### 16. `workflow_suggest`
847
+
848
+ Surface: main stdio, combined stdio, hosted HTTP.
849
+
850
+ Current quality: good.
851
+
852
+ What is wrong:
853
+
854
+ - Suggestions need stronger confidence/rationale fields.
855
+ - Input goal is free-text without examples or supported workflow categories.
856
+
857
+ Needed spec:
858
+
859
+ - Add input examples for local SEO, competitor research, PAA harvesting, SERP capture, and directory building.
860
+ - Return `suggestions[]` with workflow ID, confidence, why, required inputs, missing inputs, estimated cost, and ready-to-run args.
861
+ - Add negative space: use `workflow_list` if the user simply asks what exists.
862
+
863
+ Why:
864
+
865
+ Suggestion tools must make the next call easy and must expose why a workflow was selected.
866
+
867
+ ### 17. `workflow_run`
868
+
869
+ Surface: main stdio, combined stdio, hosted HTTP.
870
+
871
+ Current quality: medium.
872
+
873
+ What is wrong:
874
+
875
+ - `input` is an unrestricted record.
876
+ - The description has examples, but the schema does not enforce workflow-specific required fields.
877
+ - There is no `idempotencyKey`, even though workflow starts can be retried.
878
+ - Cost and duration expectations are not consistently explicit.
879
+
880
+ Needed spec:
881
+
882
+ - Add workflow-specific schemas or a discriminated union keyed by `workflowId`.
883
+ - Add `idempotencyKey` to prevent duplicate workflow runs on retry.
884
+ - Add `dryRun` or `validateOnly` if feasible.
885
+ - Return `runId`, `status`, `createdAt`, `estimatedCost`, `estimatedDuration`, `artifactManifest`, and `nextRecommendedTool`.
886
+ - Include do-not-invent guidance for workflow IDs.
887
+
888
+ Why:
889
+
890
+ This is the main write-like orchestration tool. It needs write-side guardrails even if it only writes internal job state.
891
+
892
+ ### 18. `workflow_step`
893
+
894
+ Surface: main stdio, combined stdio, hosted HTTP.
895
+
896
+ Current quality: medium.
897
+
898
+ What is wrong:
899
+
900
+ - Requires a valid run ID, but the parameter description should explicitly say not to invent it.
901
+ - Output should better distinguish completed, waiting, failed, and still-running states.
902
+
903
+ Needed spec:
904
+
905
+ - Add parameter text: "Use only a `runId` returned by `workflow_run`, `workflow_status`, or a prior workflow tool response."
906
+ - Add output fields:
907
+ - `runId`
908
+ - `currentStep`
909
+ - `status`
910
+ - `completedSteps`
911
+ - `remainingSteps`
912
+ - `nextPollAfterMs`
913
+ - `nextRecommendedTool`
914
+ - `errors`
915
+
916
+ Why:
917
+
918
+ Step tools are recovery tools. They should tell the model exactly whether to poll, read an artifact, or ask the user.
919
+
920
+ ### 19. `workflow_status`
921
+
922
+ Surface: main stdio, combined stdio, hosted HTTP.
923
+
924
+ Current quality: medium.
925
+
926
+ What is wrong:
927
+
928
+ - Similar run-ID hallucination risk as `workflow_step`.
929
+ - Output status needs a closed enum and next action.
930
+
931
+ Needed spec:
932
+
933
+ - Add do-not-invent run-ID guard.
934
+ - Add status enum: `queued`, `running`, `waiting`, `completed`, `failed`, `canceled`.
935
+ - Add `terminal`, `nextPollAfterMs`, `artifactManifest`, and `nextRecommendedTool`.
936
+
937
+ Why:
938
+
939
+ Status tools should prevent model-side uncertainty about whether work is done.
940
+
941
+ ### 20. `workflow_artifact_read`
942
+
943
+ Surface: main stdio, combined stdio, hosted HTTP.
944
+
945
+ Current quality: medium-good.
946
+
947
+ What is wrong:
948
+
949
+ - Artifact IDs need a do-not-invent guard.
950
+ - Large artifact reading needs clearer continuation semantics.
951
+ - Output should expose artifact metadata more explicitly.
952
+
953
+ Needed spec:
954
+
955
+ - Add parameter text: "Use only artifact IDs returned by workflow status/run/step responses."
956
+ - Add `cursor` or `offset` continuation if artifacts can be large.
957
+ - Return `artifactId`, `runId`, `name`, `mimeType`, `bytes`, `downloadUrl` or local path, `content`, `truncated`, and `nextCursor`.
958
+
959
+ Why:
960
+
961
+ Artifacts are the durable output of workflows. They need stable handles and pagination.
962
+
963
+ ### 21. `rank_tracker_blueprint`
964
+
965
+ Surface: main stdio, combined stdio, hosted HTTP.
966
+
967
+ Current quality: good.
968
+
969
+ What is wrong:
970
+
971
+ - The output is planning-heavy and may include large prompt-like content.
972
+ - Description should make explicit that this is a planning/blueprint tool, not a live rank tracker.
973
+ - Sample prompts are missing.
974
+
975
+ Needed spec:
976
+
977
+ - Add `blueprintVersion`.
978
+ - Add `implementationSteps[]`, `schema`, `schedule`, `metrics`, `dataSources`, and `limitations`.
979
+ - Add negative space: use `search_serp` or capture tools for live SERP data.
980
+ - Add sample prompts for building a tracker, designing a local SEO tracker, and estimating data needs.
981
+
982
+ Why:
983
+
984
+ The tool name is clear, but the return should be easier to consume as a structured build plan.
985
+
986
+ ### 22. `credits_info`
987
+
988
+ Surface: main stdio, combined stdio, hosted HTTP.
989
+
990
+ Current quality: strong.
991
+
992
+ What is wrong:
993
+
994
+ - This is close to gold-standard, but could expose upgrade/top-up paths more explicitly.
995
+ - The description should mention when to call it before expensive workflows.
996
+
997
+ Needed spec:
998
+
999
+ - Add `billingUrl` or `topUpUrl` if available.
1000
+ - Add `concurrency`, `plan`, `remainingCredits`, `resetAt`, and `recommendedAction`.
1001
+ - Add description sentence: "Use this before large harvests or workflows when credit availability matters."
1002
+
1003
+ Why:
1004
+
1005
+ This is a safety and planning tool. It should help the model avoid starting work that cannot complete.
1006
+
1007
+ ### 23. `browser_open`
1008
+
1009
+ Surface: Browser Agent stdio, combined stdio.
1010
+
1011
+ Current quality: good description, weak output contract.
1012
+
1013
+ What is wrong:
1014
+
1015
+ - No output schema.
1016
+ - Returns JSON text.
1017
+ - Parameter descriptions do not explain default proxy behavior.
1018
+ - It can create a billable session but does not return a typed session envelope.
1019
+
1020
+ Needed spec:
1021
+
1022
+ - Add output schema with:
1023
+ - `sessionId`
1024
+ - `watchUrl`
1025
+ - `url`
1026
+ - `proxy`
1027
+ - `profile`
1028
+ - `status`
1029
+ - `screenshot`
1030
+ - `createdAt`
1031
+ - `expiresAt`
1032
+ - `billing`
1033
+ - Return structuredContent.
1034
+ - Add parameter guidance for proxy/location defaults and when to use a persistent profile.
1035
+
1036
+ Why:
1037
+
1038
+ This tool creates the browser session used by every other Browser Agent tool. Its output must be a reliable handle.
1039
+
1040
+ ### 24. `browser_screenshot`
1041
+
1042
+ Surface: Browser Agent stdio, combined stdio.
1043
+
1044
+ Current quality: good concept, weak contract.
1045
+
1046
+ What is wrong:
1047
+
1048
+ - No output schema.
1049
+ - Output mixes image content with JSON text.
1050
+ - Element metadata is not contractually described.
1051
+
1052
+ Needed spec:
1053
+
1054
+ - Add output schema with:
1055
+ - `sessionId`
1056
+ - `url`
1057
+ - `title`
1058
+ - `screenshot`
1059
+ - `viewport`
1060
+ - `elements[]`
1061
+ - `timestamp`
1062
+ - Return image content plus structuredContent.
1063
+ - Add guidance to use this before click/type when target location is uncertain.
1064
+
1065
+ Why:
1066
+
1067
+ This is the primary visual perception tool. It must give the model stable references for interaction.
1068
+
1069
+ ### 25. `browser_read`
1070
+
1071
+ Surface: Browser Agent stdio, combined stdio.
1072
+
1073
+ Current quality: useful, weak contract.
1074
+
1075
+ What is wrong:
1076
+
1077
+ - No output schema.
1078
+ - Description does not explain how it differs from screenshot.
1079
+ - Returns JSON text.
1080
+
1081
+ Needed spec:
1082
+
1083
+ - Add output schema with `sessionId`, `url`, `title`, `text`, `links`, `forms`, `buttons`, `headings`, `truncated`.
1084
+ - Add description: use this for DOM text; use `browser_screenshot` for visual layout or CAPTCHA.
1085
+
1086
+ Why:
1087
+
1088
+ DOM reading and visual perception are different. The model should choose the right one.
1089
+
1090
+ ### 26. `browser_locate`
1091
+
1092
+ Surface: Browser Agent stdio, combined stdio.
1093
+
1094
+ Current quality: medium.
1095
+
1096
+ What is wrong:
1097
+
1098
+ - No output schema.
1099
+ - Needs clearer recovery guidance when the target is not found.
1100
+ - Returns JSON text.
1101
+
1102
+ Needed spec:
1103
+
1104
+ - Add output schema with matches, confidence, bounding boxes, selectors, labels, and suggested next action.
1105
+ - Add parameter examples for natural language targets.
1106
+ - Add description: use this before `browser_click` when a user describes an element but coordinates are unknown.
1107
+
1108
+ Why:
1109
+
1110
+ Locate is a bridge from language to UI action. It should return click-ready references.
1111
+
1112
+ ### 27. `browser_goto`
1113
+
1114
+ Surface: Browser Agent stdio, combined stdio.
1115
+
1116
+ Current quality: thin.
1117
+
1118
+ What is wrong:
1119
+
1120
+ - No output schema.
1121
+ - Description is too short for a navigation tool.
1122
+ - Missing guidance for redirects, login walls, and follow-up screenshot/read.
1123
+
1124
+ Needed spec:
1125
+
1126
+ - Add output schema with `sessionId`, `requestedUrl`, `finalUrl`, `status`, `title`, `redirects`, `blocked`, `captchaDetected`, and `nextRecommendedTool`.
1127
+ - Add description: use an existing session ID from `browser_open`; call `browser_screenshot` after navigation if visual state matters.
1128
+
1129
+ Why:
1130
+
1131
+ Navigation often changes state in ways the model must inspect before acting.
1132
+
1133
+ ### 28. `browser_click`
1134
+
1135
+ Surface: Browser Agent stdio, combined stdio.
1136
+
1137
+ Current quality: thin.
1138
+
1139
+ What is wrong:
1140
+
1141
+ - No output schema.
1142
+ - Needs stronger "do not guess coordinates" guidance.
1143
+ - Description does not explain preferred selector/element-reference path.
1144
+
1145
+ Needed spec:
1146
+
1147
+ - Add parameter guidance: prefer a selector or located element reference; use coordinates only from a recent screenshot/locate result.
1148
+ - Add output schema with clicked target, navigation/change detection, URL before/after, and suggested next tool.
1149
+ - Add errors with recovery suggestions.
1150
+
1151
+ Why:
1152
+
1153
+ Click mistakes are costly in browser automation. The tool should bias toward grounded actions.
1154
+
1155
+ ### 29. `browser_type`
1156
+
1157
+ Surface: Browser Agent stdio, combined stdio.
1158
+
1159
+ Current quality: thin.
1160
+
1161
+ What is wrong:
1162
+
1163
+ - No output schema.
1164
+ - Needs clearer guidance on target selection and sensitive text.
1165
+ - Description does not say whether it clears existing content or appends.
1166
+
1167
+ Needed spec:
1168
+
1169
+ - Add parameter `clearFirst` if supported, or describe current behavior.
1170
+ - Add output schema with target, text length, URL, focused element, and errors.
1171
+ - Add guidance to locate or click the field first if target is ambiguous.
1172
+
1173
+ Why:
1174
+
1175
+ Typing into the wrong field is a common browser-agent failure.
1176
+
1177
+ ### 30. `browser_scroll`
1178
+
1179
+ Surface: Browser Agent stdio, combined stdio.
1180
+
1181
+ Current quality: thin.
1182
+
1183
+ What is wrong:
1184
+
1185
+ - No output schema.
1186
+ - Direction/amount semantics need examples.
1187
+ - Output should state resulting scroll position.
1188
+
1189
+ Needed spec:
1190
+
1191
+ - Add output schema with direction, amount, page position, reachedTop, reachedBottom, and nextRecommendedTool.
1192
+ - Add parameter examples such as `down 800` or `to bottom` if supported.
1193
+
1194
+ Why:
1195
+
1196
+ Scrolling is perception setup. The model needs to know whether it reached the desired region.
1197
+
1198
+ ### 31. `browser_press`
1199
+
1200
+ Surface: Browser Agent stdio, combined stdio.
1201
+
1202
+ Current quality: thin.
1203
+
1204
+ What is wrong:
1205
+
1206
+ - No output schema.
1207
+ - Key names and combinations need examples.
1208
+ - Output should indicate focus and page changes.
1209
+
1210
+ Needed spec:
1211
+
1212
+ - Add parameter examples: `Enter`, `Escape`, `Tab`, `Meta+L`, `ArrowDown`.
1213
+ - Add output schema with key, focused element, URL before/after, navigation detected, and errors.
1214
+
1215
+ Why:
1216
+
1217
+ Keyboard automation is brittle unless accepted key syntax is explicit.
1218
+
1219
+ ### 32. `browser_replay_start`
1220
+
1221
+ Surface: Browser Agent stdio, combined stdio.
1222
+
1223
+ Current quality: medium.
1224
+
1225
+ What is wrong:
1226
+
1227
+ - No output schema.
1228
+ - Description should explain the relationship between session ID and replay ID.
1229
+
1230
+ Needed spec:
1231
+
1232
+ - Add output schema with `sessionId`, `replayId`, `startedAt`, `status`, and `artifact`.
1233
+ - Add do-not-invent guard for session IDs.
1234
+
1235
+ Why:
1236
+
1237
+ Replay tools create handles used by later tools. Those handles must be structured.
1238
+
1239
+ ### 33. `browser_replay_stop`
1240
+
1241
+ Surface: Browser Agent stdio, combined stdio.
1242
+
1243
+ Current quality: medium.
1244
+
1245
+ What is wrong:
1246
+
1247
+ - No output schema.
1248
+ - Needs clearer next-step guidance for downloading or annotating replay.
1249
+
1250
+ Needed spec:
1251
+
1252
+ - Add output schema with `sessionId`, `replayId`, `stoppedAt`, `durationMs`, `status`, and `nextRecommendedTool`.
1253
+
1254
+ Why:
1255
+
1256
+ Stopping a replay should naturally hand off to list/download/annotate.
1257
+
1258
+ ### 34. `browser_list_replays`
1259
+
1260
+ Surface: Browser Agent stdio, combined stdio.
1261
+
1262
+ Current quality: medium.
1263
+
1264
+ What is wrong:
1265
+
1266
+ - No output schema.
1267
+ - It is a list tool, but acceptable because it lists session artifacts.
1268
+ - Output should be paginated or capped.
1269
+
1270
+ Needed spec:
1271
+
1272
+ - Add output schema with `replays[]`, `count`, `nextCursor`, and `resolvedInputs`.
1273
+ - Add parameter cursor if replay history can grow.
1274
+
1275
+ Why:
1276
+
1277
+ Replay lists can grow over time and should not flood context.
1278
+
1279
+ ### 35. `browser_replay_download`
1280
+
1281
+ Surface: Browser Agent stdio, combined stdio.
1282
+
1283
+ Current quality: medium-low.
1284
+
1285
+ What is wrong:
1286
+
1287
+ - No output schema.
1288
+ - This writes a local file but is annotated like a read tool.
1289
+ - Description should state destination behavior and file type.
1290
+
1291
+ Needed spec:
1292
+
1293
+ - Add output schema with `replayId`, `filePath`, `mimeType`, `bytes`, `downloadedAt`, and `sourceUrl`.
1294
+ - State local filesystem side effect in the description.
1295
+ - Revisit annotations to indicate local write behavior.
1296
+
1297
+ Why:
1298
+
1299
+ Downloaded replay artifacts need stable paths for follow-up analysis.
1300
+
1301
+ ### 36. `browser_replay_mark`
1302
+
1303
+ Surface: Browser Agent stdio, combined stdio.
1304
+
1305
+ Current quality: medium-good.
1306
+
1307
+ What is wrong:
1308
+
1309
+ - No output schema.
1310
+ - Annotation semantics need to say whether the mark mutates remote replay metadata, local metadata, or only the current session.
1311
+
1312
+ Needed spec:
1313
+
1314
+ - Add output schema with `replayId`, `markId`, `timestampMs`, `label`, `createdAt`, and `scope`.
1315
+ - Add side-effect description.
1316
+
1317
+ Why:
1318
+
1319
+ Marks are workflow state. The model needs to know where that state lives.
1320
+
1321
+ ### 37. `browser_replay_annotate`
1322
+
1323
+ Surface: Browser Agent stdio, combined stdio.
1324
+
1325
+ Current quality: medium-good parameters, weak side-effect contract.
1326
+
1327
+ What is wrong:
1328
+
1329
+ - No output schema.
1330
+ - This may write annotated artifacts locally, but side effects are not strongly annotated.
1331
+ - Description should clarify expected input file/path and output artifact.
1332
+
1333
+ Needed spec:
1334
+
1335
+ - Add output schema with `replayId`, `inputPath`, `outputPath`, `annotations`, `bytes`, `mimeType`, and `createdAt`.
1336
+ - State local file write behavior.
1337
+ - Revisit read-only annotations.
1338
+
1339
+ Why:
1340
+
1341
+ Annotated replay artifacts are files the user will want to open or attach elsewhere.
1342
+
1343
+ ### 38. `browser_close`
1344
+
1345
+ Surface: Browser Agent stdio, combined stdio.
1346
+
1347
+ Current quality: decent.
1348
+
1349
+ What is wrong:
1350
+
1351
+ - No output schema.
1352
+ - It is correctly destructive, but output should prove the session is closed.
1353
+
1354
+ Needed spec:
1355
+
1356
+ - Add output schema with `sessionId`, `closed`, `closedAt`, `durationMs`, and `billingStopped`.
1357
+
1358
+ Why:
1359
+
1360
+ Closing sessions is part of cost control. The model should get an unambiguous success signal.
1361
+
1362
+ ### 39. `browser_list_sessions`
1363
+
1364
+ Surface: Browser Agent stdio, combined stdio.
1365
+
1366
+ Current quality: medium.
1367
+
1368
+ What is wrong:
1369
+
1370
+ - No output schema.
1371
+ - Needs cap/pagination if many sessions exist.
1372
+ - Could better distinguish active, idle, closing, and closed sessions.
1373
+
1374
+ Needed spec:
1375
+
1376
+ - Add output schema with `sessions[]`, `count`, `nextCursor`, and status enum.
1377
+ - Include `sessionId`, `url`, `createdAt`, `lastActivityAt`, `status`, `watchUrl`, and billing state.
1378
+
1379
+ Why:
1380
+
1381
+ Session listing is a recovery tool. It should help the model reuse or close the right session.
1382
+
1383
+ ### 40. `capture_serp_snapshot`
1384
+
1385
+ Surface: hosted HTTP only.
1386
+
1387
+ Current quality: strong input schema, weak output contract.
1388
+
1389
+ What is wrong:
1390
+
1391
+ - Output schema was deliberately deferred while payloads evolved.
1392
+ - Current contract does not expose a stable, gold-standard return surface.
1393
+ - No formatter-specific high-signal summary.
1394
+
1395
+ Needed spec:
1396
+
1397
+ - Add a stable output envelope:
1398
+ - `schemaVersion`
1399
+ - `snapshotId`
1400
+ - `query`
1401
+ - `resolvedInputs`
1402
+ - `status`
1403
+ - `capturedAt`
1404
+ - `blocks`
1405
+ - `organic`
1406
+ - `localPack`
1407
+ - `aiOverview`
1408
+ - `citations`
1409
+ - `artifacts`
1410
+ - `diagnostics`
1411
+ - `providerPayload`
1412
+ - Keep volatile provider fields inside `providerPayload`.
1413
+ - Add `truncated` and `errors`.
1414
+
1415
+ Why:
1416
+
1417
+ Hosted capture is a premium research surface. Even evolving payloads need a stable summary contract.
1418
+
1419
+ ### 41. `capture_serp_page_snapshots`
1420
+
1421
+ Surface: hosted HTTP only.
1422
+
1423
+ Current quality: strong input schema, weak output contract.
1424
+
1425
+ What is wrong:
1426
+
1427
+ - No output schema.
1428
+ - No stable structured summary of per-page capture status.
1429
+ - Target handling is strong on input but not mirrored on output.
1430
+
1431
+ Needed spec:
1432
+
1433
+ - Add output schema:
1434
+ - `schemaVersion`
1435
+ - `snapshotId`
1436
+ - `resolvedInputs`
1437
+ - `captures[]`
1438
+ - `captures[].url`
1439
+ - `captures[].sourceKind`
1440
+ - `captures[].status`
1441
+ - `captures[].title`
1442
+ - `captures[].screenshot`
1443
+ - `captures[].htmlArtifact`
1444
+ - `captures[].textArtifact`
1445
+ - `captures[].error`
1446
+ - `count`
1447
+ - `failedCount`
1448
+ - `truncated`
1449
+ - Add formatter that summarizes successes and failures.
1450
+
1451
+ Why:
1452
+
1453
+ Page snapshot capture often feeds downstream audits. The model needs exact URLs, statuses, and artifacts.
1454
+
1455
+ ## Required Remediation Plan
1456
+
1457
+ ### Phase 1: Make the MCP surface knowable
1458
+
1459
+ Priority: P0
1460
+
1461
+ Deliverables:
1462
+
1463
+ - Generated manifest for all surfaces.
1464
+ - Tests generated from manifest or asserting manifest consistency.
1465
+ - README section with exact surface counts and hosted/local differences.
1466
+ - CI check that fails when a registered tool lacks a manifest entry.
1467
+ - Manifest fields for symptom triggers, format examples, token-budget class, produced handles, consumed handles, output schema presence, and structuredContent presence.
1468
+
1469
+ Acceptance criteria:
1470
+
1471
+ - One command prints the exact current tool inventory by surface.
1472
+ - Tests no longer reference stale counts like 13 or 23 unless they are correct for a named legacy surface.
1473
+ - The manifest marks each tool as having or missing `outputSchema` and `structuredContent`.
1474
+
1475
+ ### Phase 2: Fix structured output gaps
1476
+
1477
+ Priority: P0/P1
1478
+
1479
+ Deliverables:
1480
+
1481
+ - Browser Agent output schemas and structuredContent for all 17 tools.
1482
+ - Structured outputs for `youtube_transcribe`, `facebook_ad_transcribe`, and hosted capture tools.
1483
+ - Side-effect metadata for local file-writing tools.
1484
+
1485
+ Acceptance criteria:
1486
+
1487
+ - No tool returns only stringified JSON when it has structured data.
1488
+ - Browser screenshots return image content plus structured metadata.
1489
+ - Transcript tools return transcript text, segments, metadata, artifact, and resolved input as structured data.
1490
+
1491
+ ### Phase 3: Align descriptions with return shapes
1492
+
1493
+ Priority: P1
1494
+
1495
+ Deliverables:
1496
+
1497
+ - `youtube_harvest` includes dates/thumbnails or stops promising them.
1498
+ - `facebook_page_intel` includes ad copy/landing URL/domain or stops promising them.
1499
+ - `extract_url` includes the promised extraction categories or narrows its description.
1500
+ - `maps_place_intel` exposes promised evidence categories with counts/truncation.
1501
+
1502
+ Acceptance criteria:
1503
+
1504
+ - For every noun promised in a tool description, there is a matching structured field, artifact reference, or explicit truncation note.
1505
+
1506
+ ### Phase 4: Upgrade parameters into micro-runbooks
1507
+
1508
+ Priority: P2
1509
+
1510
+ Deliverables:
1511
+
1512
+ - Recovery paths for Facebook IDs, YouTube URLs, workflow IDs, artifact IDs, replay IDs, and session IDs.
1513
+ - Do-not-invent guards for cursors, workflow IDs, artifact IDs, replay IDs, and browser session IDs.
1514
+ - Explicit defaults/caps for all limit parameters.
1515
+ - Consistent proxy default language.
1516
+
1517
+ Acceptance criteria:
1518
+
1519
+ - A model can recover from not knowing an ID by following the parameter description.
1520
+ - Every free-text ID-like parameter says how to obtain a valid value.
1521
+
1522
+ ### Phase 5: Add sample prompts and negative space
1523
+
1524
+ Priority: P2
1525
+
1526
+ Deliverables:
1527
+
1528
+ - 2 to 3 sample prompts per tool in the generated manifest.
1529
+ - Description updates naming sibling tools and when not to use the current one.
1530
+
1531
+ Acceptance criteria:
1532
+
1533
+ - Each tool can be routed from natural user phrasing without relying on the tool name alone.
1534
+
1535
+ ### Phase 6: Add craft linting
1536
+
1537
+ Priority: P2
1538
+
1539
+ Deliverables:
1540
+
1541
+ - A tool-description lint script that checks every registered tool for:
1542
+ - sibling/negative-space sentence
1543
+ - sample prompts
1544
+ - symptom triggers
1545
+ - examples for format-sensitive params
1546
+ - enum values in prose
1547
+ - default and cap language
1548
+ - do-not-invent guards for opaque handles
1549
+ - output schema and structuredContent
1550
+ - A report that scores each tool against the 17-point checklist.
1551
+
1552
+ Acceptance criteria:
1553
+
1554
+ - CI can show why a tool is below gold-standard without another manual reverse-engineering pass.
1555
+ - The lint output includes one row per tool and one row per principle.
1556
+
1557
+ ## Naming Assessment
1558
+
1559
+ Mostly good:
1560
+
1561
+ - Names are snake_case.
1562
+ - Names use verbs or clear action nouns.
1563
+ - Resources are generally clear.
1564
+
1565
+ Not gold-standard:
1566
+
1567
+ - No namespace prefix such as `mcpscraper_` or `browser_` for main tools. Browser tools do use `browser_`, but main tools like `extract_url` and `search_serp` could collide in clients that combine servers.
1568
+ - `workflow_list` is acceptable because it lists workflows, not user data.
1569
+ - `rank_tracker_blueprint` is clear but should be described as a planning tool.
1570
+
1571
+ Recommendation:
1572
+
1573
+ - Do not rename existing public tools abruptly.
1574
+ - Add aliases only if the MCP framework supports stable aliases.
1575
+ - Use namespacing in docs and generated manifest.
1576
+ - Consider namespaced v2 names only in a future breaking release, for example `mcpscraper_search_serp`.
1577
+
1578
+ ## Done Definition For Gold-Standard MCP Quality
1579
+
1580
+ This MCP reaches the requested quality bar when:
1581
+
1582
+ - The exact active tool inventory is generated from source and documented by surface.
1583
+ - Every tool has:
1584
+ - clear description
1585
+ - symptom triggers written in user language
1586
+ - negative space
1587
+ - sample prompts
1588
+ - complete parameter descriptions
1589
+ - examples that teach exact format for format-sensitive params
1590
+ - defaults and caps
1591
+ - recovery paths for ID-like inputs
1592
+ - do-not-invent guards for cursors and handles
1593
+ - repeated enum/runbook language where the tool must stand alone
1594
+ - output schema
1595
+ - structuredContent
1596
+ - high-signal return fields only
1597
+ - resolved inputs
1598
+ - count and truncation metadata where relevant
1599
+ - artifact URLs or paths where relevant
1600
+ - correct annotations for side effects
1601
+ - No tool relies on escaped JSON in text as its primary data output.
1602
+ - README, live tests, unit tests, and install/help text all agree on tool counts and proxy defaults.