@onlyflows/servicenow-mcp 2.2.0-dev.5 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/.env.example +6 -3
  2. package/CHANGELOG.md +312 -0
  3. package/README.md +504 -101
  4. package/dist/atf-form.d.ts +3 -15
  5. package/dist/atf-form.d.ts.map +1 -1
  6. package/dist/atf-result-cache.d.ts +23 -59
  7. package/dist/atf-result-cache.d.ts.map +1 -1
  8. package/dist/auth.d.ts +1 -0
  9. package/dist/auth.d.ts.map +1 -1
  10. package/dist/auth.js +17 -0
  11. package/dist/auth.js.map +1 -1
  12. package/dist/batch-limits.d.ts +18 -0
  13. package/dist/batch-limits.d.ts.map +1 -0
  14. package/dist/batch-limits.js +21 -0
  15. package/dist/batch-limits.js.map +1 -0
  16. package/dist/bounded-input.d.ts +49 -0
  17. package/dist/bounded-input.d.ts.map +1 -0
  18. package/dist/bounded-input.js +81 -0
  19. package/dist/bounded-input.js.map +1 -0
  20. package/dist/client.d.ts +25 -0
  21. package/dist/client.d.ts.map +1 -1
  22. package/dist/client.js +92 -18
  23. package/dist/client.js.map +1 -1
  24. package/dist/command-resolution.d.ts +53 -0
  25. package/dist/command-resolution.d.ts.map +1 -0
  26. package/dist/command-resolution.js +154 -0
  27. package/dist/command-resolution.js.map +1 -0
  28. package/dist/encoded-query-policy.d.ts +11 -0
  29. package/dist/encoded-query-policy.d.ts.map +1 -1
  30. package/dist/encoded-query-policy.js +10 -1
  31. package/dist/encoded-query-policy.js.map +1 -1
  32. package/dist/field-policy.d.ts +82 -3
  33. package/dist/field-policy.d.ts.map +1 -1
  34. package/dist/field-policy.js +609 -80
  35. package/dist/field-policy.js.map +1 -1
  36. package/dist/html-response.d.ts +34 -0
  37. package/dist/html-response.d.ts.map +1 -0
  38. package/dist/html-response.js +72 -0
  39. package/dist/html-response.js.map +1 -0
  40. package/dist/http-runtime.d.ts.map +1 -1
  41. package/dist/http-runtime.js +8 -0
  42. package/dist/http-runtime.js.map +1 -1
  43. package/dist/incident-journal-policy.d.ts +27 -5
  44. package/dist/incident-journal-policy.d.ts.map +1 -1
  45. package/dist/incident-journal-policy.js +34 -21
  46. package/dist/incident-journal-policy.js.map +1 -1
  47. package/dist/json-shape-limits.d.ts +71 -0
  48. package/dist/json-shape-limits.d.ts.map +1 -0
  49. package/dist/json-shape-limits.js +131 -0
  50. package/dist/json-shape-limits.js.map +1 -0
  51. package/dist/metadata-cache.d.ts +46 -21
  52. package/dist/metadata-cache.d.ts.map +1 -1
  53. package/dist/metadata-cache.js +228 -195
  54. package/dist/metadata-cache.js.map +1 -1
  55. package/dist/policy-card.d.ts +131 -0
  56. package/dist/policy-card.d.ts.map +1 -0
  57. package/dist/policy-card.js +409 -0
  58. package/dist/policy-card.js.map +1 -0
  59. package/dist/profile-admin.d.ts.map +1 -1
  60. package/dist/profile-admin.js +3 -0
  61. package/dist/profile-admin.js.map +1 -1
  62. package/dist/profile-manager.d.ts +17 -3
  63. package/dist/profile-manager.d.ts.map +1 -1
  64. package/dist/profile-manager.js +98 -6
  65. package/dist/profile-manager.js.map +1 -1
  66. package/dist/record-identifier-policy.d.ts +2 -8
  67. package/dist/record-identifier-policy.d.ts.map +1 -1
  68. package/dist/risky-grants.d.ts +25 -0
  69. package/dist/risky-grants.d.ts.map +1 -0
  70. package/dist/risky-grants.js +77 -0
  71. package/dist/risky-grants.js.map +1 -0
  72. package/dist/server.d.ts.map +1 -1
  73. package/dist/server.js +74 -0
  74. package/dist/server.js.map +1 -1
  75. package/dist/setup-prompts.js +1 -0
  76. package/dist/setup-prompts.js.map +1 -1
  77. package/dist/setup.d.ts +8 -1
  78. package/dist/setup.d.ts.map +1 -1
  79. package/dist/setup.js +492 -111
  80. package/dist/setup.js.map +1 -1
  81. package/dist/stdio-runtime.d.ts +15 -0
  82. package/dist/stdio-runtime.d.ts.map +1 -1
  83. package/dist/stdio-runtime.js +60 -0
  84. package/dist/stdio-runtime.js.map +1 -1
  85. package/dist/structured-query.d.ts +100 -115
  86. package/dist/structured-query.d.ts.map +1 -1
  87. package/dist/structured-query.js +132 -16
  88. package/dist/structured-query.js.map +1 -1
  89. package/dist/table-policy.d.ts +10 -4
  90. package/dist/table-policy.d.ts.map +1 -1
  91. package/dist/table-policy.js +1 -1
  92. package/dist/table-policy.js.map +1 -1
  93. package/dist/tool-error.d.ts +18 -0
  94. package/dist/tool-error.d.ts.map +1 -1
  95. package/dist/tool-error.js +69 -0
  96. package/dist/tool-error.js.map +1 -1
  97. package/dist/tool-table-access.d.ts.map +1 -1
  98. package/dist/tool-table-access.js +32 -2
  99. package/dist/tool-table-access.js.map +1 -1
  100. package/dist/tools/aggregate.d.ts +13 -19
  101. package/dist/tools/aggregate.d.ts.map +1 -1
  102. package/dist/tools/aggregate.js +2 -3
  103. package/dist/tools/aggregate.js.map +1 -1
  104. package/dist/tools/all-fields-cap.d.ts.map +1 -1
  105. package/dist/tools/all-fields-cap.js +3 -38
  106. package/dist/tools/all-fields-cap.js.map +1 -1
  107. package/dist/tools/atf-author-module.d.ts +28 -7
  108. package/dist/tools/atf-author-module.d.ts.map +1 -1
  109. package/dist/tools/atf-author-module.js +4 -2
  110. package/dist/tools/atf-author-module.js.map +1 -1
  111. package/dist/tools/atf-contracts.d.ts +135 -829
  112. package/dist/tools/atf-contracts.d.ts.map +1 -1
  113. package/dist/tools/atf-shared.js +2 -2
  114. package/dist/tools/atf-shared.js.map +1 -1
  115. package/dist/tools/atf-step-catalog.d.ts +3 -7
  116. package/dist/tools/atf-step-catalog.d.ts.map +1 -1
  117. package/dist/tools/atf-step-catalog.js +12 -5
  118. package/dist/tools/atf-step-catalog.js.map +1 -1
  119. package/dist/tools/atf.d.ts +8 -24
  120. package/dist/tools/atf.d.ts.map +1 -1
  121. package/dist/tools/atf.js +2 -2
  122. package/dist/tools/atf.js.map +1 -1
  123. package/dist/tools/attach.d.ts +6 -22
  124. package/dist/tools/attach.d.ts.map +1 -1
  125. package/dist/tools/batch.d.ts +18 -71
  126. package/dist/tools/batch.d.ts.map +1 -1
  127. package/dist/tools/batch.js +544 -96
  128. package/dist/tools/batch.js.map +1 -1
  129. package/dist/tools/catalog.d.ts +2 -2
  130. package/dist/tools/catalog.d.ts.map +1 -1
  131. package/dist/tools/catalog.js +7 -1
  132. package/dist/tools/catalog.js.map +1 -1
  133. package/dist/tools/codesearch.d.ts +1 -13
  134. package/dist/tools/codesearch.d.ts.map +1 -1
  135. package/dist/tools/create-module.d.ts +9 -14
  136. package/dist/tools/create-module.d.ts.map +1 -1
  137. package/dist/tools/create-module.js +4 -8
  138. package/dist/tools/create-module.js.map +1 -1
  139. package/dist/tools/delete.d.ts +1 -9
  140. package/dist/tools/delete.d.ts.map +1 -1
  141. package/dist/tools/delete.js +2 -3
  142. package/dist/tools/delete.js.map +1 -1
  143. package/dist/tools/discover.d.ts +6 -14
  144. package/dist/tools/discover.d.ts.map +1 -1
  145. package/dist/tools/flow-view-contracts.d.ts +1023 -0
  146. package/dist/tools/flow-view-contracts.d.ts.map +1 -0
  147. package/dist/tools/flow-view-contracts.js +570 -0
  148. package/dist/tools/flow-view-contracts.js.map +1 -0
  149. package/dist/tools/flow-view-graph.d.ts +86 -0
  150. package/dist/tools/flow-view-graph.d.ts.map +1 -0
  151. package/dist/tools/flow-view-graph.js +993 -0
  152. package/dist/tools/flow-view-graph.js.map +1 -0
  153. package/dist/tools/flow-view-gzip.d.ts +52 -0
  154. package/dist/tools/flow-view-gzip.d.ts.map +1 -0
  155. package/dist/tools/flow-view-gzip.js +179 -0
  156. package/dist/tools/flow-view-gzip.js.map +1 -0
  157. package/dist/tools/flow-view-mermaid.d.ts +37 -0
  158. package/dist/tools/flow-view-mermaid.d.ts.map +1 -0
  159. package/dist/tools/flow-view-mermaid.js +337 -0
  160. package/dist/tools/flow-view-mermaid.js.map +1 -0
  161. package/dist/tools/flow-view-module.d.ts +61 -0
  162. package/dist/tools/flow-view-module.d.ts.map +1 -0
  163. package/dist/tools/flow-view-module.js +378 -0
  164. package/dist/tools/flow-view-module.js.map +1 -0
  165. package/dist/tools/flow-view-policy.d.ts +106 -0
  166. package/dist/tools/flow-view-policy.d.ts.map +1 -0
  167. package/dist/tools/flow-view-policy.js +461 -0
  168. package/dist/tools/flow-view-policy.js.map +1 -0
  169. package/dist/tools/flow-view-renderers.d.ts +68 -0
  170. package/dist/tools/flow-view-renderers.d.ts.map +1 -0
  171. package/dist/tools/flow-view-renderers.js +513 -0
  172. package/dist/tools/flow-view-renderers.js.map +1 -0
  173. package/dist/tools/flow-view-table.d.ts +115 -0
  174. package/dist/tools/flow-view-table.d.ts.map +1 -0
  175. package/dist/tools/flow-view-table.js +1002 -0
  176. package/dist/tools/flow-view-table.js.map +1 -0
  177. package/dist/tools/get-module.d.ts +36 -42
  178. package/dist/tools/get-module.d.ts.map +1 -1
  179. package/dist/tools/health.d.ts +9 -6
  180. package/dist/tools/health.d.ts.map +1 -1
  181. package/dist/tools/incident-journal-module.d.ts +8 -7
  182. package/dist/tools/incident-journal-module.d.ts.map +1 -1
  183. package/dist/tools/index.d.ts +4 -4
  184. package/dist/tools/index.d.ts.map +1 -1
  185. package/dist/tools/index.js +43 -6
  186. package/dist/tools/index.js.map +1 -1
  187. package/dist/tools/markdown.d.ts +27 -0
  188. package/dist/tools/markdown.d.ts.map +1 -1
  189. package/dist/tools/markdown.js +104 -1
  190. package/dist/tools/markdown.js.map +1 -1
  191. package/dist/tools/nl.d.ts +1 -11
  192. package/dist/tools/nl.d.ts.map +1 -1
  193. package/dist/tools/profile.d.ts +1 -1
  194. package/dist/tools/profile.d.ts.map +1 -1
  195. package/dist/tools/profile.js +19 -1
  196. package/dist/tools/profile.js.map +1 -1
  197. package/dist/tools/query-module.d.ts +59 -71
  198. package/dist/tools/query-module.d.ts.map +1 -1
  199. package/dist/tools/query-module.js +2 -2
  200. package/dist/tools/query-module.js.map +1 -1
  201. package/dist/tools/record-write-shared.d.ts.map +1 -1
  202. package/dist/tools/record-write-shared.js +19 -2
  203. package/dist/tools/record-write-shared.js.map +1 -1
  204. package/dist/tools/relationships.d.ts +6 -22
  205. package/dist/tools/relationships.d.ts.map +1 -1
  206. package/dist/tools/result-envelope.d.ts +2255 -1357
  207. package/dist/tools/result-envelope.d.ts.map +1 -1
  208. package/dist/tools/result-envelope.js +24 -2
  209. package/dist/tools/result-envelope.js.map +1 -1
  210. package/dist/tools/schema-module.d.ts +36 -21
  211. package/dist/tools/schema-module.d.ts.map +1 -1
  212. package/dist/tools/schema-module.js +106 -65
  213. package/dist/tools/schema-module.js.map +1 -1
  214. package/dist/tools/script.d.ts +1 -11
  215. package/dist/tools/script.d.ts.map +1 -1
  216. package/dist/tools/syslog.d.ts +11 -18
  217. package/dist/tools/syslog.d.ts.map +1 -1
  218. package/dist/tools/syslog.js +2 -3
  219. package/dist/tools/syslog.js.map +1 -1
  220. package/dist/tools/table-hierarchy.d.ts +35 -0
  221. package/dist/tools/table-hierarchy.d.ts.map +1 -0
  222. package/dist/tools/table-hierarchy.js +74 -0
  223. package/dist/tools/table-hierarchy.js.map +1 -0
  224. package/dist/tools/tool-module.d.ts +40 -15
  225. package/dist/tools/tool-module.d.ts.map +1 -1
  226. package/dist/tools/tool-module.js +755 -205
  227. package/dist/tools/tool-module.js.map +1 -1
  228. package/dist/tools/update-module.d.ts +11 -17
  229. package/dist/tools/update-module.d.ts.map +1 -1
  230. package/dist/tools/update-module.js +10 -12
  231. package/dist/tools/update-module.js.map +1 -1
  232. package/dist/version.d.ts +1 -1
  233. package/dist/version.d.ts.map +1 -1
  234. package/dist/version.js +1 -1
  235. package/dist/version.js.map +1 -1
  236. package/dist/write-value-policy.d.ts +20 -12
  237. package/dist/write-value-policy.d.ts.map +1 -1
  238. package/dist/write-value-policy.js +179 -67
  239. package/dist/write-value-policy.js.map +1 -1
  240. package/docs/ADDING-TOOLS.md +22 -13
  241. package/docs/CLIENT-SETUP.md +110 -52
  242. package/docs/CROSS-CLIENT-RELEASE-MATRIX.md +2 -2
  243. package/docs/FLOW-VIEW.md +214 -0
  244. package/docs/PRODUCTION-SECURITY.md +154 -25
  245. package/docs/RELEASE-VALIDATION.md +2 -2
  246. package/docs/TESTING-OAUTH.md +1 -1
  247. package/docs/V2-MIGRATION.md +404 -30
  248. package/package.json +21 -6
  249. package/scripts/release-validate.mjs +56 -0
  250. package/server.json +22 -0
  251. package/tools/inspector/package-lock.json +163 -201
@@ -290,34 +290,39 @@ SN_METADATA_CACHE_TTL_MS=86400000
290
290
  SN_METADATA_CACHE_TABLES=sys_glide_object,sys_dictionary,sys_db_object,sys_app,sys_plugins,sys_metadata*,sys_flow*
291
291
  ```
292
292
 
293
- Metadata caching additionally requires a resolvable ServiceNow session
294
- timezone: the freshness probe compares `sys_updated_on`, which the instance
295
- evaluates in the session user's timezone. The zone is read from
296
- `sys_user.time_zone` for the authenticating account, falling back to the
297
- `glide.sys.default.tz` property, so the profile needs read access to `sys_user`
298
- and `sys_properties` for the lookup to succeed. When it cannot be resolved the
299
- cache disables itself for that identity rather than assuming UTC — an assumed
300
- zone would serve silently stale metadata for the length of the offset. OAuth
301
- client_credentials and API-key profiles carry no username and therefore cannot
302
- cache metadata at all. Deletions to a cached table become visible within one
303
- TTL, since the probe detects updates rather than deletes.
304
-
305
- Journal content is readable on request. `comments` and `work_notes` on
306
- `incident` are returned by `fields=all`, `response_format: "detailed"`, an
307
- explicit `fields=comments`, and `sn_schema`; the default projection still
308
- excludes them. Journal content on production instances routinely contains
309
- customer PII, so a profile granted `incident` reads can retrieve
310
- customer-visible commentary whenever the caller asks for it. Treat that as part
311
- of the data classification when granting incident reads, and narrow it through
312
- the field policy rather than relying on the default projection, which the
313
- caller can override. Field names matching the sensitive-name pattern are
314
- excluded from an unrestricted selection before the request is built, so those
315
- values are never requested rather than being requested and scrubbed on arrival.
293
+ Metadata caching works in every auth mode, including the client_credentials
294
+ profile above. Its freshness check reads the cached table's row count and newest
295
+ row by `sys_updated_on`, as the instance stores it, so it needs no timezone and
296
+ no username. The only access it needs is the ServiceNow read permission of the
297
+ user the credential runs as, on the cached table itself. It needs no
298
+ `tableAccess` grant, so do not widen `readTables` for it. Cached entries are
299
+ partitioned by instance and credential identity; `sn_schema` results are also
300
+ partitioned by profile and effective policy, so a narrower profile never sees a
301
+ wider one's schema.
302
+
303
+ The partition is the credential, not the ServiceNow user it runs as. A cache
304
+ hit re-reads only the table's watermark, so the run-as user's permissions on
305
+ the cached rows are not evaluated again until the entry is refetched. Revoking
306
+ read on a whole table shows on the next metadata read, because the watermark
307
+ read is refused; an `sn_schema` result already cached is still served until it
308
+ expires (5 minutes by default, up to 1 hour). Tightening ServiceNow row- or
309
+ field-level ACLs does not move the watermark, so rows cached before the change
310
+ are served for up to one TTL: by default 24 hours for metadata (configurable up
311
+ to 7 days) and 5 minutes for `sn_schema`. This concerns the instance's ACLs
312
+ only. A profile's `tableAccess` and `fieldPolicy` are applied on every call,
313
+ cached or not, so profiles that share a credential share cached rows but never
314
+ each other's permissions. A metadata entry keeps the TTL of the profile
315
+ that stored it, so another profile on the same credential with a shorter TTL
316
+ can be served it for the longer one. After re-mapping a client_credentials
317
+ application or API key to another user, or tightening that user's roles or
318
+ ACLs, restart the server or rotate the secret. `force_recache: true` is not a
319
+ substitute: it refreshes only the read it is passed on, not the credential's
320
+ whole cache.
316
321
 
317
322
  `sys_properties` is deliberately absent from that list. Rows in it are
318
323
  ACL-restricted per user and routinely hold integration secrets in the `value`
319
- column, and a cache hit is served without re-contacting ServiceNow, so the
320
- caller's ACLs are not evaluated on the hit. Do not add it, and review any
324
+ column, and a cache hit re-reads only the table's watermark, so the caller's
325
+ ACLs on the cached rows are not evaluated on the hit. Do not add it, and review any
321
326
  table you do add against the same two questions: are its rows ACL-restricted
322
327
  per user, and would a stale or cross-identity answer be a disclosure?
323
328
 
@@ -343,6 +348,130 @@ canonical runtime secret:
343
348
  }
344
349
  ```
345
350
 
351
+ ## Journal content
352
+
353
+ `comments` (customer-visible) and `work_notes` (internal) are the journal
354
+ fields on `incident` and the other task tables. A Table API write to one
355
+ appends an entry; it cannot rewrite or remove earlier entries.
356
+
357
+ ### Reading journals
358
+
359
+ Journal content is readable on request. `comments` and `work_notes` on
360
+ `incident` are returned by `fields=all`, `response_format: "detailed"`, an
361
+ explicit `fields=comments`, and `sn_schema`; the default projection still
362
+ excludes them. Journal content on production instances routinely contains
363
+ customer PII, so a profile granted `incident` reads can retrieve
364
+ customer-visible commentary whenever the caller asks for it. Treat that as part
365
+ of the data classification when granting incident reads, and narrow it through
366
+ the field policy rather than relying on the default projection, which the
367
+ caller can override. Field names matching the sensitive-name pattern are
368
+ excluded from an unrestricted selection before the request is built, so those
369
+ values are never requested rather than being requested and scrubbed on arrival.
370
+
371
+ ### Writing journals
372
+
373
+ A profile granted writes on a table can append `comments` and `work_notes`
374
+ there through `sn_create`, `sn_update` and `sn_batch`, and on `incident`
375
+ through `sn_incident_add_comment` and `sn_incident_add_work_note`. Field
376
+ policy decides for every one of these routes, and with no field policy every
377
+ write-granted table accepts both fields. Each entry is 1-8,000 characters and
378
+ at most 16,384 UTF-8 bytes, without control or format characters other than
379
+ newline, carriage return and tab.
380
+
381
+ Decide separately whether an agent may post customer-visible comments:
382
+
383
+ - **Notifications.** On many instances a new comment notifies the record's
384
+ caller and watch list. A bulk `sn_batch` update of `comments` posts one
385
+ comment per matched record, up to 10,000 in one call, and each can send a
386
+ notification.
387
+ - **An outbound email channel.** Comment notifications commonly go to the
388
+ watch list, and `watch_list` accepts free-form email addresses, so a
389
+ profile that may write both fields can direct notification email, including
390
+ record content, to any address. Withhold one of the two fields, or restrict
391
+ outbound email recipients on the instance.
392
+ - **Rendered markup.** Where the instance property
393
+ `glide.ui.security.allow_codetag` is enabled, text inside `[code]` tags in a
394
+ journal entry can render as HTML. Journal text is sent as written. Disable
395
+ the property, or withhold the field, if agents should not post markup.
396
+
397
+ **Opting out.** To withhold journal writes, set `writable` to an explicit
398
+ list that leaves out `comments`, and `work_notes` if needed. A profile with no
399
+ field policy can write every field, so there is nothing to leave a field out
400
+ of until you write a list:
401
+
402
+ ```json
403
+ {
404
+ "fieldPolicy": {
405
+ "*": {
406
+ "writable": ["short_description", "description", "state", "assigned_to", "assignment_group", "work_notes"]
407
+ }
408
+ }
409
+ }
410
+ ```
411
+
412
+ A `"*"` entry reaches the ITSM tables, including `incident` and `task`, and
413
+ every table without a built-in entry; state the list per table instead where
414
+ tables need different sets. Field policy is evaluated against the table a call
415
+ names, so narrow write-granted parent tables such as `task` too, or do not
416
+ grant writes on them. On `incident` the same list also denies the matching
417
+ dedicated tool. Leaving the dedicated tools off a target, or passing
418
+ `--tools` to `servicenow-mcp-setup grant`, controls only those two tools; it
419
+ does not withhold journals from `sn_create`, `sn_update` or `sn_batch`. See
420
+ the [field policy reference](../README.md#field-policy).
421
+
422
+ ### Duplicate entries
423
+
424
+ The server never re-sends a journal write that may have reached the instance:
425
+
426
+ - The HTTP client does not retry a `PATCH` or `PUT` that sets `comments` or
427
+ `work_notes` after a 502, 503, 504 or connection error, because the first
428
+ attempt may already have appended the entry. It reports the failure
429
+ instead. It still retries after a 429 and refreshes credentials once after
430
+ a 401, because neither request was processed. A `POST`, which `sn_create`
431
+ sends, is never re-sent after a server or connection error.
432
+ - `sn_batch` never re-sends a batch request that may have reached the
433
+ instance, reports a record whose outcome ServiceNow did not confirm instead
434
+ of retrying it, and stops its serial fallback at the first such record.
435
+
436
+ This covers `sn_create`, `sn_update`, the dedicated tools and both `sn_batch`
437
+ paths. A repeated call still appends again: `sn_create`, `sn_update`,
438
+ `sn_batch` and the dedicated tools are all annotated as not idempotent, and
439
+ running the same journal-only `sn_batch` again appends another entry to every
440
+ record it matches.
441
+
442
+ **Limitation: journal fields are recognised by name.** Only `comments` and
443
+ `work_notes` get this handling. A custom journal field (`u_*`), or a built-in
444
+ journal-type field under another name, is not detected: it gets the generic
445
+ value bounds (100,000 characters) instead of the journal bounds, and the
446
+ client's ordinary retry on 502, 503, 504 and connection errors, so a gateway
447
+ failure after the instance applied such a write can append the entry twice.
448
+ Where a duplicate would matter, withhold such fields with field policy.
449
+
450
+ ## Flow views
451
+
452
+ `sn_flow_view` is read-only. It reads 15 tables through the Table API and
453
+ never calls Flow Designer's internal API (`/api/now/processflow/...`), whose
454
+ flow read creates a Workflow Studio history record. Approve it on these terms:
455
+
456
+ - Grant the 15 tables with targets bound to `sn_flow_view` only, as
457
+ `servicenow-mcp-setup grant --flows` does. The flow tables hold scripts and
458
+ configuration; binding them keeps `sn_query` and `sn_get` off them.
459
+ - Input values are shown by default. Names that look sensitive and the
460
+ `password`, `password2`, `masked` and `encrypted_text` types are always
461
+ redacted, but redaction is by name and type: a credential typed into an
462
+ ordinary string input or a script is shown. Where that matters, hide the
463
+ value fields with field policy or tell callers to pass
464
+ `include_inputs: false`.
465
+ - `sys_variable_value` is a system table: a `"*"` field-policy entry does not
466
+ narrow it. Name it in `fieldPolicy` to hide older (V1) flows' values. The
467
+ ATF tools read the same table.
468
+ - Flow text is untrusted instance content. The Mermaid diagram is built from
469
+ a closed grammar with encoded labels, and the outline is fenced as
470
+ untrusted.
471
+
472
+ [docs/FLOW-VIEW.md](FLOW-VIEW.md) lists every table, required field and
473
+ field-policy switch.
474
+
346
475
  ## Denied exposure patterns
347
476
 
348
477
  Do not approve a deployment that has any of these properties:
@@ -26,7 +26,7 @@ npm audit --omit=dev --audit-level=moderate
26
26
 
27
27
  The unit and protocol commands are deliberately separate release records even
28
28
  though the complete unit suite contains the focused protocol cases. The
29
- protocol gate includes the all-23-tool missing-profile rejection matrix through
29
+ protocol gate includes the all-24-tool missing-profile rejection matrix through
30
30
  the official SDK and independent Fetch clients, plus the catalog-wide resolved
31
31
  profile/result/audit contract. The profile gate covers encryption,
32
32
  secret-reference resolution, operator administration, and profile isolation.
@@ -68,7 +68,7 @@ bearer header in argv. In the local UI:
68
68
 
69
69
  1. Select Streamable HTTP and enter the exact `MCP_URL` shown by the launcher.
70
70
  2. Enter the bearer directly from the approved secret store in the local UI.
71
- 3. Run `tools/list`; verify exactly 23 tools and required non-empty `profile`
71
+ 3. Run `tools/list`; verify exactly 24 tools and required non-empty `profile`
72
72
  schemas.
73
73
  4. Call `sn_profile` once without `profile` and verify rejection.
74
74
  5. Call it again with the exact `MCP_PROFILE`; verify
@@ -60,7 +60,7 @@ npm run smoke
60
60
  The smoke client uses the official MCP Streamable HTTP client and verifies:
61
61
 
62
62
  - initialization and discovery over `/mcp`;
63
- - exactly 23 tools;
63
+ - exactly 24 tools;
64
64
  - every discovered schema requires a non-empty `profile`;
65
65
  - `sn_profile` returns `structuredContent.profile` without credentials;
66
66
  - a version health check and a bounded incident query return that same resolved