@onlyflows/servicenow-mcp 2.3.0-rc.1 → 2.3.0-rc.3

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 (248) hide show
  1. package/CHANGELOG.md +788 -3
  2. package/README.md +446 -41
  3. package/dist/atf-policy.d.ts +1 -1
  4. package/dist/atf-policy.d.ts.map +1 -1
  5. package/dist/atf-policy.js +2 -0
  6. package/dist/atf-policy.js.map +1 -1
  7. package/dist/call-metrics.d.ts +42 -0
  8. package/dist/call-metrics.d.ts.map +1 -0
  9. package/dist/call-metrics.js +89 -0
  10. package/dist/call-metrics.js.map +1 -0
  11. package/dist/client.d.ts +18 -14
  12. package/dist/client.d.ts.map +1 -1
  13. package/dist/client.js +51 -36
  14. package/dist/client.js.map +1 -1
  15. package/dist/code-search-snippet.d.ts +25 -0
  16. package/dist/code-search-snippet.d.ts.map +1 -0
  17. package/dist/code-search-snippet.js +67 -0
  18. package/dist/code-search-snippet.js.map +1 -0
  19. package/dist/code-search-targets.d.ts +66 -0
  20. package/dist/code-search-targets.d.ts.map +1 -0
  21. package/dist/code-search-targets.js +82 -0
  22. package/dist/code-search-targets.js.map +1 -0
  23. package/dist/config.d.ts +1 -1
  24. package/dist/config.d.ts.map +1 -1
  25. package/dist/credential-tables.d.ts +32 -0
  26. package/dist/credential-tables.d.ts.map +1 -0
  27. package/dist/credential-tables.js +58 -0
  28. package/dist/credential-tables.js.map +1 -0
  29. package/dist/encoded-query-policy.d.ts +9 -0
  30. package/dist/encoded-query-policy.d.ts.map +1 -1
  31. package/dist/encoded-query-policy.js +27 -2
  32. package/dist/encoded-query-policy.js.map +1 -1
  33. package/dist/execution-context.d.ts +14 -0
  34. package/dist/execution-context.d.ts.map +1 -1
  35. package/dist/execution-context.js +8 -0
  36. package/dist/execution-context.js.map +1 -1
  37. package/dist/field-policy.d.ts +44 -1
  38. package/dist/field-policy.d.ts.map +1 -1
  39. package/dist/field-policy.js +623 -35
  40. package/dist/field-policy.js.map +1 -1
  41. package/dist/hidden-values.d.ts +225 -0
  42. package/dist/hidden-values.d.ts.map +1 -0
  43. package/dist/hidden-values.js +748 -0
  44. package/dist/hidden-values.js.map +1 -0
  45. package/dist/http-entrypoint.d.ts.map +1 -1
  46. package/dist/http-entrypoint.js +7 -0
  47. package/dist/http-entrypoint.js.map +1 -1
  48. package/dist/http-observability.js +1 -0
  49. package/dist/http-observability.js.map +1 -1
  50. package/dist/http-runtime.js +16 -0
  51. package/dist/http-runtime.js.map +1 -1
  52. package/dist/index.js +7 -0
  53. package/dist/index.js.map +1 -1
  54. package/dist/metadata-cache.d.ts +135 -7
  55. package/dist/metadata-cache.d.ts.map +1 -1
  56. package/dist/metadata-cache.js +357 -21
  57. package/dist/metadata-cache.js.map +1 -1
  58. package/dist/policy-card.d.ts +16 -1
  59. package/dist/policy-card.d.ts.map +1 -1
  60. package/dist/policy-card.js +15 -2
  61. package/dist/policy-card.js.map +1 -1
  62. package/dist/profile-admin.d.ts +18 -0
  63. package/dist/profile-admin.d.ts.map +1 -1
  64. package/dist/profile-admin.js +26 -1
  65. package/dist/profile-admin.js.map +1 -1
  66. package/dist/profile-manager.d.ts +13 -1
  67. package/dist/profile-manager.d.ts.map +1 -1
  68. package/dist/profile-manager.js +23 -1
  69. package/dist/profile-manager.js.map +1 -1
  70. package/dist/response-too-large.d.ts +23 -0
  71. package/dist/response-too-large.d.ts.map +1 -0
  72. package/dist/response-too-large.js +42 -0
  73. package/dist/response-too-large.js.map +1 -0
  74. package/dist/risky-grants.d.ts +6 -2
  75. package/dist/risky-grants.d.ts.map +1 -1
  76. package/dist/risky-grants.js +58 -5
  77. package/dist/risky-grants.js.map +1 -1
  78. package/dist/setup-prompts.js +1 -1
  79. package/dist/setup-prompts.js.map +1 -1
  80. package/dist/setup.d.ts +4 -0
  81. package/dist/setup.d.ts.map +1 -1
  82. package/dist/setup.js +176 -68
  83. package/dist/setup.js.map +1 -1
  84. package/dist/structured-query.d.ts +61 -2
  85. package/dist/structured-query.d.ts.map +1 -1
  86. package/dist/structured-query.js +382 -36
  87. package/dist/structured-query.js.map +1 -1
  88. package/dist/table-policy.d.ts +75 -2
  89. package/dist/table-policy.d.ts.map +1 -1
  90. package/dist/table-policy.js +184 -15
  91. package/dist/table-policy.js.map +1 -1
  92. package/dist/tool-error.d.ts +47 -4
  93. package/dist/tool-error.d.ts.map +1 -1
  94. package/dist/tool-error.js +104 -4
  95. package/dist/tool-error.js.map +1 -1
  96. package/dist/tool-table-access.d.ts +9 -2
  97. package/dist/tool-table-access.d.ts.map +1 -1
  98. package/dist/tool-table-access.js +118 -36
  99. package/dist/tool-table-access.js.map +1 -1
  100. package/dist/tools/aggregate.js +2 -2
  101. package/dist/tools/aggregate.js.map +1 -1
  102. package/dist/tools/all-fields-cap.d.ts.map +1 -1
  103. package/dist/tools/all-fields-cap.js +29 -7
  104. package/dist/tools/all-fields-cap.js.map +1 -1
  105. package/dist/tools/atf-author-module.d.ts +1 -7
  106. package/dist/tools/atf-author-module.d.ts.map +1 -1
  107. package/dist/tools/atf-author-module.js +16 -7
  108. package/dist/tools/atf-author-module.js.map +1 -1
  109. package/dist/tools/atf-contracts.d.ts +69 -4
  110. package/dist/tools/atf-contracts.d.ts.map +1 -1
  111. package/dist/tools/atf-contracts.js +32 -2
  112. package/dist/tools/atf-contracts.js.map +1 -1
  113. package/dist/tools/atf-renderers.js +2 -1
  114. package/dist/tools/atf-renderers.js.map +1 -1
  115. package/dist/tools/atf-results-module.d.ts.map +1 -1
  116. package/dist/tools/atf-results-module.js +5 -3
  117. package/dist/tools/atf-results-module.js.map +1 -1
  118. package/dist/tools/atf-run-module.js +3 -2
  119. package/dist/tools/atf-run-module.js.map +1 -1
  120. package/dist/tools/atf-shared.d.ts +6 -0
  121. package/dist/tools/atf-shared.d.ts.map +1 -1
  122. package/dist/tools/atf-shared.js +49 -10
  123. package/dist/tools/atf-shared.js.map +1 -1
  124. package/dist/tools/atf-step-catalog.d.ts +13 -8
  125. package/dist/tools/atf-step-catalog.d.ts.map +1 -1
  126. package/dist/tools/atf-step-catalog.js +169 -5
  127. package/dist/tools/atf-step-catalog.js.map +1 -1
  128. package/dist/tools/batch.d.ts.map +1 -1
  129. package/dist/tools/batch.js +25 -7
  130. package/dist/tools/batch.js.map +1 -1
  131. package/dist/tools/catalog.d.ts.map +1 -1
  132. package/dist/tools/catalog.js +2 -1
  133. package/dist/tools/catalog.js.map +1 -1
  134. package/dist/tools/codesearch.d.ts +2 -2
  135. package/dist/tools/codesearch.d.ts.map +1 -1
  136. package/dist/tools/codesearch.js +536 -67
  137. package/dist/tools/codesearch.js.map +1 -1
  138. package/dist/tools/flow-view-contracts.d.ts +59 -3
  139. package/dist/tools/flow-view-contracts.d.ts.map +1 -1
  140. package/dist/tools/flow-view-contracts.js +34 -2
  141. package/dist/tools/flow-view-contracts.js.map +1 -1
  142. package/dist/tools/flow-view-graph.d.ts +14 -0
  143. package/dist/tools/flow-view-graph.d.ts.map +1 -1
  144. package/dist/tools/flow-view-graph.js +43 -1
  145. package/dist/tools/flow-view-graph.js.map +1 -1
  146. package/dist/tools/flow-view-module.js +2 -2
  147. package/dist/tools/flow-view-module.js.map +1 -1
  148. package/dist/tools/flow-view-policy.d.ts +3 -3
  149. package/dist/tools/flow-view-policy.d.ts.map +1 -1
  150. package/dist/tools/flow-view-policy.js +5 -4
  151. package/dist/tools/flow-view-policy.js.map +1 -1
  152. package/dist/tools/flow-view-renderers.d.ts.map +1 -1
  153. package/dist/tools/flow-view-renderers.js +9 -21
  154. package/dist/tools/flow-view-renderers.js.map +1 -1
  155. package/dist/tools/get-module.js +1 -1
  156. package/dist/tools/get-module.js.map +1 -1
  157. package/dist/tools/index.d.ts.map +1 -1
  158. package/dist/tools/index.js +116 -25
  159. package/dist/tools/index.js.map +1 -1
  160. package/dist/tools/platform-view-contracts.d.ts +189 -0
  161. package/dist/tools/platform-view-contracts.d.ts.map +1 -0
  162. package/dist/tools/platform-view-contracts.js +353 -0
  163. package/dist/tools/platform-view-contracts.js.map +1 -0
  164. package/dist/tools/platform-view-evaluate.d.ts +219 -0
  165. package/dist/tools/platform-view-evaluate.d.ts.map +1 -0
  166. package/dist/tools/platform-view-evaluate.js +1346 -0
  167. package/dist/tools/platform-view-evaluate.js.map +1 -0
  168. package/dist/tools/platform-view-module.d.ts +28 -0
  169. package/dist/tools/platform-view-module.d.ts.map +1 -0
  170. package/dist/tools/platform-view-module.js +111 -0
  171. package/dist/tools/platform-view-module.js.map +1 -0
  172. package/dist/tools/platform-view-scan.d.ts +57 -0
  173. package/dist/tools/platform-view-scan.d.ts.map +1 -0
  174. package/dist/tools/platform-view-scan.js +375 -0
  175. package/dist/tools/platform-view-scan.js.map +1 -0
  176. package/dist/tools/platform-view-upgrades.d.ts +152 -0
  177. package/dist/tools/platform-view-upgrades.d.ts.map +1 -0
  178. package/dist/tools/platform-view-upgrades.js +545 -0
  179. package/dist/tools/platform-view-upgrades.js.map +1 -0
  180. package/dist/tools/profile.d.ts.map +1 -1
  181. package/dist/tools/profile.js +1 -0
  182. package/dist/tools/profile.js.map +1 -1
  183. package/dist/tools/query-module.d.ts.map +1 -1
  184. package/dist/tools/query-module.js +231 -64
  185. package/dist/tools/query-module.js.map +1 -1
  186. package/dist/tools/record-write-shared.d.ts.map +1 -1
  187. package/dist/tools/record-write-shared.js +4 -3
  188. package/dist/tools/record-write-shared.js.map +1 -1
  189. package/dist/tools/result-envelope.d.ts +429 -38
  190. package/dist/tools/result-envelope.d.ts.map +1 -1
  191. package/dist/tools/result-envelope.js +372 -36
  192. package/dist/tools/result-envelope.js.map +1 -1
  193. package/dist/tools/schema-module.d.ts.map +1 -1
  194. package/dist/tools/schema-module.js +1 -1
  195. package/dist/tools/schema-module.js.map +1 -1
  196. package/dist/tools/syslog-cursor.d.ts +61 -0
  197. package/dist/tools/syslog-cursor.d.ts.map +1 -0
  198. package/dist/tools/syslog-cursor.js +146 -0
  199. package/dist/tools/syslog-cursor.js.map +1 -0
  200. package/dist/tools/syslog.d.ts +2 -0
  201. package/dist/tools/syslog.d.ts.map +1 -1
  202. package/dist/tools/syslog.js +126 -2
  203. package/dist/tools/syslog.js.map +1 -1
  204. package/dist/tools/truncation-hint.d.ts +125 -0
  205. package/dist/tools/truncation-hint.d.ts.map +1 -0
  206. package/dist/tools/truncation-hint.js +298 -0
  207. package/dist/tools/truncation-hint.js.map +1 -0
  208. package/dist/unknown-filter-fields.d.ts +52 -0
  209. package/dist/unknown-filter-fields.d.ts.map +1 -0
  210. package/dist/unknown-filter-fields.js +87 -0
  211. package/dist/unknown-filter-fields.js.map +1 -0
  212. package/dist/update-set-eval/engine.d.ts +29 -0
  213. package/dist/update-set-eval/engine.d.ts.map +1 -0
  214. package/dist/update-set-eval/engine.js +405 -0
  215. package/dist/update-set-eval/engine.js.map +1 -0
  216. package/dist/update-set-eval/prepare.d.ts +72 -0
  217. package/dist/update-set-eval/prepare.d.ts.map +1 -0
  218. package/dist/update-set-eval/prepare.js +216 -0
  219. package/dist/update-set-eval/prepare.js.map +1 -0
  220. package/dist/update-set-eval/rules.d.ts +126 -0
  221. package/dist/update-set-eval/rules.d.ts.map +1 -0
  222. package/dist/update-set-eval/rules.js +927 -0
  223. package/dist/update-set-eval/rules.js.map +1 -0
  224. package/dist/update-set-eval/script-scan.d.ts +65 -0
  225. package/dist/update-set-eval/script-scan.d.ts.map +1 -0
  226. package/dist/update-set-eval/script-scan.js +378 -0
  227. package/dist/update-set-eval/script-scan.js.map +1 -0
  228. package/dist/update-set-eval/secret-patterns.d.ts +75 -0
  229. package/dist/update-set-eval/secret-patterns.d.ts.map +1 -0
  230. package/dist/update-set-eval/secret-patterns.js +570 -0
  231. package/dist/update-set-eval/secret-patterns.js.map +1 -0
  232. package/dist/update-set-eval/types.d.ts +181 -0
  233. package/dist/update-set-eval/types.d.ts.map +1 -0
  234. package/dist/update-set-eval/types.js +20 -0
  235. package/dist/update-set-eval/types.js.map +1 -0
  236. package/dist/update-set-eval/xml-reader.d.ts +117 -0
  237. package/dist/update-set-eval/xml-reader.d.ts.map +1 -0
  238. package/dist/update-set-eval/xml-reader.js +561 -0
  239. package/dist/update-set-eval/xml-reader.js.map +1 -0
  240. package/dist/version.d.ts +1 -1
  241. package/dist/version.js +1 -1
  242. package/docs/CLIENT-SETUP.md +30 -7
  243. package/docs/FLOW-VIEW.md +14 -5
  244. package/docs/PRODUCTION-SECURITY.md +84 -1
  245. package/docs/PROFILE-CREDENTIALS.md +10 -4
  246. package/docs/V2-MIGRATION.md +1 -1
  247. package/package.json +1 -1
  248. package/server.json +2 -2
package/CHANGELOG.md CHANGED
@@ -5,6 +5,673 @@ All notable changes to this project are documented here.
5
5
  The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.3.0-rc.3] — 2026-11-16
9
+
10
+ Release candidate for 2.3.0, published to the `next` dist-tag. It contains the
11
+ changes listed under 2.3.0-dev.1 to 2.3.0-dev.5 below, and the changes that
12
+ follow.
13
+
14
+ ### Changed
15
+
16
+ - **Record payload columns are readable only when a profile's field policy
17
+ names them.** These columns, and the numbered rotation shards of the queue
18
+ tables (`ecc_queue0003`, `sys_replication_queue5`, ...), are covered:
19
+ - `payload` and `payload_diff` on `sys_update_xml`, `sys_update_version`,
20
+ `sys_update_preview_xml`, `sys_update_diff`, `sys_sync_preview_remote`,
21
+ `sys_upgrade_history_log`, `sys_metadata_link`, `sys_metadata_delete`,
22
+ `sys_audit_delete`, `sys_archive_log` and `clone_preserved_data`;
23
+ - `payload` on `ecc_queue`, `data_replication_queue`, `sys_rt_change_log`,
24
+ `sys_hub_snapshot` and `sys_hub_flow_version`; `payload` and
25
+ `payload_short` on `sys_replication_queue`; `payload` and
26
+ `previous_payload` on every `cdc_queue_*` table (such as `cdc_queue_ih`,
27
+ `cdc_queue_par` and `cdc_queue_uxa_user_props`) except `cdc_queue_state_*`;
28
+ `data` on `sys_hub_snapshot_chunk`; and `encoded_keystore` on
29
+ `sn_disco_certmgmt_certificate_ca_credentials`.
30
+
31
+ No wildcard covers them any more: not the open default of a profile with no
32
+ field policy, a `"*"` field entry, or `"*"` on the table's own entry. Each is
33
+ read only where that table's own `readable` lists it, and written only where
34
+ its own `writable` lists it (`fieldPolicy.<table>`, or the table's
35
+ `readableTableFields`/`writableTableFields` entry); a shard is its own table.
36
+ Until then it is refused by name, as a filter, order, group-by, aggregate or
37
+ write field, and is left out of `fields=all`, detailed and default reads,
38
+ write echoes and aggregate groups. The refusal names the key to set.
39
+ `tools/list` is unchanged.
40
+
41
+ - **More tables are on the privilege-sensitive write list.** `ecc_queue` and
42
+ its rotation shards (records written there can run commands on MID Server
43
+ hosts), and these tables that hold scripts run on the instance or on MID
44
+ Server hosts: `sysevent_script_action`,
45
+ `sys_script_fix`, `sys_script_email`, `sys_ui_action`, `sys_ui_page`,
46
+ `sys_ui_macro`, `sp_widget`, `sysevent_in_email_action`,
47
+ `sys_transform_map`, `sys_transform_script`, `ecc_agent_script_include`,
48
+ `sysevent_email_action`, `sys_dictionary`, `sa_pattern`, `sys_hub_flow` and
49
+ `sys_hub_action_type_definition`.
50
+ A write grant that reaches them, including `"*"`, is still allowed; `grant`,
51
+ the wizard and the policy card flag it.
52
+
53
+ - **`sys_update_xml`, `sys_upgrade_history_log`, `scan_finding`, `scan_result`
54
+ and `scan_check` have their own default projections.** A read that names no
55
+ `fields` returns the columns that identify the row (for `sys_update_xml`:
56
+ `sys_id`, `name`, `type`, `target_name`, `table`, `action`, `update_set`,
57
+ `application` and `sys_updated_on`) instead of `sys_id` alone. The projections
58
+ do not include `finding_details`, `scan_finding.task` and `.user`,
59
+ `scan_check.script`, `scan_result.message` or the payload columns above; apart
60
+ from the payload columns, those stay readable by name. A profile's `"*"` field
61
+ entry still narrows these tables, their defaults included. `tools/list` is
62
+ unchanged.
63
+
64
+ ## [2.3.0-rc.2] — 2026-11-16
65
+
66
+ Release candidate for 2.3.0, published to the `next` dist-tag. It contains the
67
+ changes listed under 2.3.0-dev.1 to 2.3.0-dev.5 below and nothing else.
68
+
69
+ ## [2.3.0-dev.5] — 2026-11-16
70
+
71
+ ### Added
72
+
73
+ - **Read tools now hide `password`/`password2`-typed fields by dictionary type,
74
+ not only by name.** A field whose internal type is `password`, `password2`,
75
+ `masked` or `encrypted_text` is refused when named, left out of `fields=all`,
76
+ detailed and default reads, `"*"` responses and write echoes, refused as a
77
+ filter, order, aggregate, group-by or ATF step-condition field, and refused
78
+ as a write key, whatever it is called. A `sys_properties` row shows `value` only when its
79
+ `type` is a known non-secret type. The types come from one cached
80
+ `sys_dictionary` read per credential. While they cannot be read, field-policy
81
+ tools refuse with a message naming the access needed, unless the profile sets
82
+ `"fieldTypes": { "dictionary": "not_required" }`, which falls back to
83
+ name-only hiding and is flagged on the policy card. `tools/list` is unchanged.
84
+
85
+ - **`sn_syslog` can tail the system log.** `tail: true` returns the newest
86
+ entries, oldest first, with a `cursor`; each later call with `after_cursor`
87
+ returns only the entries created after it, oldest first, with a new `cursor`,
88
+ so a caller no longer re-reads a window and removes duplicates by hand. The
89
+ cursor holds the creation second and the row's `sys_id`, so entries that share
90
+ a second are neither skipped nor repeated, and it is bound to the `level`,
91
+ `source` and `message` filters it was issued for. A malformed, oversized or
92
+ altered cursor, or one used with other filters, is refused with a fixed message
93
+ that never repeats it. When more entries are waiting than `limit` allows (or the
94
+ response is cut to fit its size limit), the call returns `has_more: true` and a
95
+ cursor at the last entry returned. Tail reads never use the metadata cache,
96
+ carry no total count and no `next_offset`, and follow the same table and field
97
+ policy as any `sn_syslog` read; a call without `tail` or `after_cursor` is
98
+ unchanged. A cursor older than the longest `since` window (one year) is refused,
99
+ so a tail cannot reach further back than a plain read. The two new inputs and the `cursor` output add about 340 characters
100
+ to the `sn_syslog` entry in `tools/list`.
101
+
102
+ ### Changed
103
+
104
+ - **`sn_atf_author` checks the table, conditions and ACL setting of ATF steps
105
+ when it adds them.** A `record_query`, `record_validation`,
106
+ `field_values_validation` or `open_existing_record` step needs a read grant on
107
+ the table it names, and an `open_new_form` or `set_field_values` step a write
108
+ grant, with the same refusal as any table access (a named-only table such as
109
+ `sys_audit` must be named). The conditions of `record_query`,
110
+ `record_validation` and `field_values_validation` are checked against the
111
+ table's field policy: a field the profile may not read, a dot-walk (`a.b`), a
112
+ condition that is only a pasted step output, and a term the check does not
113
+ recognise are refused, and only the operators that compare a field with a
114
+ literal are allowed (`=`, `!=`, `<`, `<=`, `>`, `>=`, `LIKE`, `NOT LIKE`,
115
+ `STARTSWITH`, `ENDSWITH`, `IN`, `NOT IN`, `ISEMPTY`, `ISNOTEMPTY`, `BETWEEN`),
116
+ so an operator that takes a second field, such as `SAMEAS` or `GT_FIELD`, is
117
+ refused. `enforce_security: false` is refused on `record_query` and
118
+ `record_validation` with a fixed message (leave it out, or pass `true`; it
119
+ stays `true` by default). A refused step refuses the whole call, before any
120
+ write. A condition value, and a `set_field_values` value, may refer to an earlier
121
+ step's output only by record id or sys_id (`record_id`, `first_record`,
122
+ `sys_id`, `user`), and the fields a
123
+ `set_field_values` step sets must be writable on its table, as for `sn_update`.
124
+ The impersonated user's ACLs still apply on top; suites authored in the
125
+ instance are not checked by the server's table grants, and `atf.execute` stays
126
+ opt-in. The README and `docs/PRODUCTION-SECURITY.md` now also say that a
127
+ database view or extension table over one of the six named-only tables is not
128
+ covered by the name list.
129
+ - **A `"*"` write grant no longer covers `sys_atf_step`, `sys_variable_value`
130
+ and `sys_element_mapping` for the generic write tools.** These tables hold the
131
+ step types, input values and pill mappings that `sn_atf_author` checks when it
132
+ adds a step. Under `"*"`,
133
+ `sn_atf_author` still writes them, but `sn_create`, `sn_update`, `sn_delete`,
134
+ `sn_batch` and attachment uploads reach them only when the profile names the
135
+ table for write; the refusal names the table and the grant that allows it
136
+ (`servicenow-mcp-setup grant --profile <profile> --write sys_atf_step --tools
137
+ sn_update`). Reads are unchanged, and no other table's access changes.
138
+ `sys_variable_value` and `sys_element_mapping` also hold other variables'
139
+ values and mappings (catalog variables, for example), so a profile that writes
140
+ those with the generic tools must now name them. The policy card lists the
141
+ three tables as outside the wildcard row's write access.
142
+ - **`sys_audit` and `sys_journal_field` are no longer covered by a `"*"` table
143
+ grant; name them to read them.** A profile whose `readTables` (or
144
+ `writeTables`) holds `"*"` now reaches them only when it names them. Their rows
145
+ hold the old and new values of other tables' fields, comments and work notes,
146
+ so they are now granted by name only. With `"*"` alone, `sn_query`, `sn_get`,
147
+ `sn_aggregate`, `sn_schema`, `sn_batch` and the other tools refuse them, and
148
+ the message names the table and the grant that allows it:
149
+ `servicenow-mcp-setup grant --profile <profile> --read sys_audit --tools
150
+ sn_query`. A profile that already names a table is unaffected, and a `"*"`
151
+ grant beside the name still covers everything else. A read that names no
152
+ `fields` returns `sys_id`, `tablename`, `documentkey`, `fieldname`, `user` and
153
+ `sys_created_on` for `sys_audit`, and `sys_id`, `name`, `element_id`, `element`,
154
+ `sys_created_by` and `sys_created_on` for `sys_journal_field`; ask for
155
+ `oldvalue`, `newvalue` or `value` by name. No other table's access changes. The
156
+ policy card and the setup wizard's wildcard note say the same.
157
+ - **Four more tables are granted by name only, and a `"*"` field entry now
158
+ narrows all six.** `sys_history_line`, `sys_audit_delete`, `sys_attachment_doc`
159
+ and `sys_email` join `sys_audit` and `sys_journal_field`: a `"*"` table grant no
160
+ longer covers them, for read or write, and a profile reaches one only when
161
+ `tableAccess` names it. Their rows hold history built from audit, deleted
162
+ records, attachment content and email bodies. The refusal names the table and
163
+ the grant that allows it. A read that names no `fields` leaves out the value
164
+ columns (`old`, `new`, `old_value` and `new_value`; `payload`; `data`; `body`,
165
+ `body_text`, `subject`, `recipients`, `copied`, `blind_copied`, `reply_to`,
166
+ `headers` and `error_string`), so ask for them by name. For field policy
167
+ the six belong to the profile, as the ITSM tables do: once a profile names one,
168
+ its `"*"` field entry narrows it, and an entry for the table itself narrows or
169
+ widens it. The 24 system tables, which a `"*"` field entry never narrows, are
170
+ unchanged. `sn_attach` is unaffected: it uses the Attachment API and never
171
+ reads `sys_attachment_doc`.
172
+ A `relatedTables` list that reaches one of the six under a `"*"` grant still
173
+ stops the profile loading, and the message now names the table and says it
174
+ must be granted by name. `sn_profile` reports these tables with the class
175
+ `named_only`.
176
+
177
+ ### Fixed
178
+
179
+ - **`sn_atf_results` with action `get` no longer fails with an internal error on
180
+ a completed suite result whose rows have empty references.** Some result rows
181
+ carry an empty suite reference, and their test results an empty test
182
+ reference. The tool failed on the first one as soon as it had read the result
183
+ (and would have failed on the second), so every completed result of that kind
184
+ failed, while a running one that names its suite worked. Such a result now
185
+ returns normally: the run, its tests and its failures, without a `suite_id`,
186
+ with each test that has no reference identified by its test result's own id,
187
+ and with warnings that say so and that the result has no history or comparison
188
+ (the cache is kept per suite and per test). `run.suiteId` is therefore optional
189
+ in the output schema. A row of the wrong shape (a reference that is not a
190
+ sys_id, an unknown status) now ends the call with an upstream error instead of
191
+ an internal one.
192
+
193
+ - **A client that reads only `structuredContent` no longer loses what the text
194
+ carried.** Some MCP clients give the model the structured result and drop the
195
+ text, and a few tools kept information only in the text. They now carry it as
196
+ typed fields as well, and the text is unchanged. `sn_flow_view` adds `diagram`
197
+ (the Mermaid source, when `format` asks for one), `ref` (the flow record as
198
+ table and sys_id) and `warning_details` (each warning code with its
199
+ explanation). `sn_atf_run` and `sn_atf_results` add `result_ref` (the suite
200
+ result record) and `advice` (how to read a failed step in full).
201
+ `sn_atf_author` adds `advice` after an insert whose outcome could not be
202
+ confirmed; the records it created were already listed with their table and
203
+ sys_id. Record links stay out of `structuredContent`: it names a record by
204
+ table and sys_id, and the instance address stays in the text, so no result
205
+ gains an address. The diagram counts toward `max_response_bytes` and is the first
206
+ thing given up: if the graph and the diagram do not fit together the diagram
207
+ keeps only a note, and its source is never cut short. The published output
208
+ schemas grow by about 1.6 KB in total (1.3%), and the model-visible part of
209
+ `tools/list` by 18 characters.
210
+
211
+ ## [2.3.0-dev.4] — 2026-11-15
212
+
213
+ ### Changed
214
+
215
+ - **The setup wizard defaults to OAuth client credentials.** The authentication
216
+ prompt now lists `oauth` first and offers it by default, then `apikey`, then
217
+ `basic`, which is marked legacy because ServiceNow is retiring Basic Auth for
218
+ REST calls. Choosing OAuth prints a short note on what the instance needs (an
219
+ Application Registry entry with a client ID and secret, the client credentials
220
+ grant, and an OAuth Application User with only the roles it needs, not an
221
+ administrator) and where the README explains it. When a Basic credential gets a
222
+ 401, the wizard now asks what next: retry with the same settings, switch to
223
+ OAuth (keeping the profile name and instance, and discarding the Basic
224
+ credential), or stop; its 401 advice points at that menu, while `doctor --live`
225
+ tells the operator to re-run setup and choose oauth. Nothing else changes for scripts:
226
+ `servicenow-mcp-profile create` without `--auth-type` still creates a Basic
227
+ profile, now with a deprecation notice shown only in an interactive terminal,
228
+ never in captured output (a future release may require the flag), and
229
+ `SN_AUTH_TYPE` still defaults to `basic`. Saved
230
+ profiles are never changed, and a saved profile with no `authType` is still
231
+ read as Basic. The README quick start, the profile and client setup guides and
232
+ their examples now show OAuth first.
233
+
234
+ ## [2.3.0-dev.3] — 2026-11-15
235
+
236
+ ### Added
237
+
238
+ - **`sn_codesearch` searches ES modules.** `table: "sys_module"` searches the
239
+ `content` column and names each row by its `path` (the table has no `name`);
240
+ with no `table` it takes its turn after the other code tables, labelled "ES
241
+ Modules" (a search that names the table labels rows with the table name, as for
242
+ the others). `sys_module` follows the same rules as the other code tables: a
243
+ plain `--read sys_module` binds `sn_codesearch` to it with the other default
244
+ read tools, `content` goes through the field policy and the sensitive-name
245
+ rules, it is in the default metadata cache list, and a write grant on it is
246
+ flagged as code execution. It also becomes a built-in system table, which
247
+ changes who can read its fields: see Changed.
248
+
249
+ - **`sn_codesearch` searches ATF step scripts.** `table: "sys_atf_step"` finds
250
+ the script inputs of ATF steps: rows of `sys_variable_value` whose `document`
251
+ is `sys_atf_step` and whose `variable` ends with `script`, a condition fixed in
252
+ the server that no argument can widen (a `field` is refused, and the search
253
+ term cannot add a clause). Each result is the step, named `<test> > step
254
+ <order>`; the steps and then their tests are read by id to name them. The
255
+ profile needs read on `sys_variable_value`, `sys_atf_step` and `sys_atf_test`,
256
+ each bound to `sn_codesearch`; a denial names the missing table, and in a
257
+ search with no `table` the target is left out, and named, unless all three are
258
+ held. `grant --atf` binds those tables to `sn_atf_author` only, so add `grant
259
+ --read sys_variable_value,sys_atf_step,sys_atf_test --tools sn_codesearch` for
260
+ this search. The tables are not in the default metadata cache list.
261
+ - **`tools/list` grows by 129 characters.** The `sn_codesearch` entry goes from
262
+ 3,655 to 3,784 characters (model-visible total 40,012 to 40,141), for the new
263
+ description and parameter text. The published `inputSchema` shape is
264
+ unchanged.
265
+
266
+ ### Changed
267
+
268
+ - **`sys_module` is now a built-in system table, so a `"*"` field entry no longer
269
+ narrows it.** Before, `sys_module` was like any table without a built-in entry:
270
+ a profile whose field policy has a `"*"` entry that narrows `readable` (for
271
+ example `"*": { "readable": ["sys_id", "path"] }`) could not read its `content`
272
+ or `sys_scope`, and `fields=all` returned only the listed fields. It is now one
273
+ of the 24 system tables, which keep their own built-in entry and are never
274
+ covered by a `"*"` field entry, as for `sys_script` and the other code tables.
275
+ A profile that reads `sys_module` (granted by name, or by a `"*"` table read
276
+ grant, which still covers it) and narrowed fields with `"*"` now reads
277
+ `content` and its other non-sensitive fields, and gets no warning. To keep it
278
+ narrowed, name `sys_module` in `fieldPolicy`, for example
279
+ `"sys_module": { "readable": ["sys_id", "path"] }`; a named entry still
280
+ narrows it. The sensitive-field-name rules apply as before.
281
+ - **A default read of a code table no longer returns the script.** `sn_query`
282
+ and `sn_get` on `sys_script`, `sys_script_include`, `sys_ui_script`,
283
+ `sys_script_client` and `sys_ws_operation` return, with no `fields`,
284
+ identifiers and metadata instead of the script body: for `sys_script_include`
285
+ that is `sys_id`, `name`, `api_name`, `active` and `sys_updated_on` (the other
286
+ tables add what identifies a row, such as `collection` and `when` for a
287
+ business rule). A default read of 87 script includes used to keep 9 rows
288
+ before the response budget cut it; it now returns all 87. **This changes the
289
+ default output:** a caller that relied on the body appearing by default must
290
+ name it, for example `fields: "sys_id,name,script"`. `fields=all` and
291
+ `response_format: "detailed"` still include it, and a profile that states its
292
+ own `defaults` for one of these tables keeps them.
293
+
294
+ ### Fixed
295
+
296
+ - **A code search with no `table` searches the code tables the profile may read.**
297
+ It needed a read grant on all five (and `sn_codesearch` bound to each), so a
298
+ profile that held only `sys_script_include` was denied outright while the same
299
+ call with `table: "sys_script_include"` worked. It now decides each table on
300
+ its own, by the table policy and by the field policy of its script field,
301
+ searches the ones it may read, and adds a warning that names the others and
302
+ the `grant` command that includes one. It fails only when none can be read: the
303
+ error names the tool and the grant, or, when the tables are granted but their
304
+ script field is not readable, the field and the key to change. The dispatcher
305
+ still authorizes the narrowed plan, so this never widens access.
306
+ - **A large code search returns results instead of failing.** `sn_codesearch`
307
+ read the full script of `limit + 1` rows from every table it searched, so
308
+ above about 100 rows (150, 200 and 300 failed every time on an instance of
309
+ 6,500 script includes) it passed the 1 MiB response cap, and with no `table`
310
+ the five tables shared one budget. It now reads the rows without their
311
+ scripts and then the scripts of the rows it returns only, 50 at a time, each
312
+ batch in its own response scope; a batch that is still too large is halved,
313
+ and a script too large to read on its own leaves that row with an empty
314
+ snippet and `note: "script too large to preview"`. A search of one table with
315
+ `limit` 49 or less still reads the scripts with the rows, in one request.
316
+ Reads also send `sysparm_no_count`, so the instance skips a row count it never
317
+ used. If the rows alone pass the cap, the error is the too-large message.
318
+ - **The script reads of one code search are bounded.** Scripts for the rows of a
319
+ page are read by id in batches of 50, and a call spends at most 12 such
320
+ requests and 8 MiB on them, however large the scripts are (a batch that passes
321
+ the response cap is retried smaller, and what it learns sizes the later
322
+ batches). Scripts are read only for the rows the response can hold, in page
323
+ order. When the budget is spent the remaining rows keep their place with an
324
+ empty snippet, and a warning says how many and to lower `limit`; the call does
325
+ not fail. A search across all code tables makes more requests than before but
326
+ transfers less data.
327
+ - **A code search with no `table` no longer fills page 1 with one table.**
328
+ Results were sorted by table name, so the first table (business rules)
329
+ filled the page whenever it had `limit` or more matches and script includes
330
+ appeared only after paging past every one of them. The tables now take turns:
331
+ each table's first match (script includes first, then business rules, UI
332
+ scripts, client scripts, scripted REST operations), then each table's second,
333
+ and so on, each in `sys_id` order. The order depends only on the data, and
334
+ `offset` pages through it without skipping or repeating a row. The result
335
+ metadata's `order_by` is `["round", "table", "sys_id"]` for this search and
336
+ `["sys_id"]` for a search of one table.
337
+ - **A code search snippet shows the text around the match.** It was the first
338
+ 200 characters of the script, which rarely showed why the record matched. It
339
+ is now about 200 characters centred on the first case-insensitive match, with
340
+ `...` where text was cut, and each row gains `line`, the line the match is on.
341
+ When the text holds no literal match (the instance's comparison can be looser
342
+ than a literal one) the snippet is the head of the script, as before, with no
343
+ `line`.
344
+ - **`sn_codesearch` accepts `field: "name"` and `field: "sys_id"`.** The search
345
+ appended its field to a fixed `sys_id,name,<field>` list, so a field already in
346
+ the list became a duplicate and the policy check refused it with
347
+ `invalid_field_selection` before any request. The projection now lists each
348
+ field once, in the access check and in the read. A `field` that names more
349
+ than one field (`"name,script"`) is refused instead of silently searching the
350
+ first.
351
+ - **`sn_codesearch` pages in a stable order.** It sent `sysparm_orderby`, which
352
+ is not a Table API parameter, so the order of its windows was not guaranteed
353
+ and an offset could skip or repeat a record. The order is now part of the
354
+ encoded query (`^ORDERBYsys_id`), as `sn_query` does it.
355
+ - **A response that passes the byte cap is reported as too large, with the
356
+ remedy, by every tool.** A read that went over the 1 MiB response limit, or
357
+ over the call's cumulative upstream budget, used to reach the caller as "The
358
+ operation failed unexpectedly. Error category: internal. Retry unchanged is
359
+ not recommended." It now reads "The response was too large to return in one
360
+ call. Lower limit, request fewer fields, or narrow the query, then retry.
361
+ Error category: too_large. Retry after correcting the request or
362
+ configuration." The new `too_large` category is also what audit records and
363
+ the HTTP tool-call metrics report as `errorCategory`. The mapping is made once,
364
+ where an error becomes the caller's message, so it covers every tool that
365
+ reads through the client. A write whose response is over the cap is still
366
+ treated as an unknown outcome, as before.
367
+
368
+ - **A table-policy denial names the table, the tool and the grant that lifts it.**
369
+ It used to say only "Table access was denied by policy." Now, for example,
370
+ `Table access was denied by policy: "sys_script_include" is granted to this
371
+ profile, but not for sn_codesearch. To allow it, run: servicenow-mcp-setup
372
+ grant --profile <profile> --read sys_script_include --tools sn_codesearch,
373
+ then restart the MCP client.` The text says whether the table is missing from
374
+ the profile or only the tool is, and uses `--write` for a write. It carries
375
+ the table and tool of that one call and nothing else of the profile's rules;
376
+ a table name that is not a valid identifier still gets the fixed sentence.
377
+ `grant --help` now says `--tools` adds to a table's tools.
378
+ - **A page with more results no longer reports truncation.** `sn_codesearch`,
379
+ `sn_discover` and `sn_aggregate` (with `group_by`) read one row past the page
380
+ to learn whether another page exists. That row is not part of the result, but
381
+ the response counted it as a dropped record, so every page that had a next
382
+ page also said `metadata.truncation: {truncated: true, reason:
383
+ "record_limit", dropped_records: 1}`, which reads as data loss when none was
384
+ lost. `has_more` and `next_offset` are unchanged (`next_offset` is still
385
+ `offset + record_count`), and `metadata.truncation` is now `{truncated:
386
+ false}` for such a page. It still reports rows dropped to fit the response
387
+ size (`byte_limit`), now counting only the rows of the page that were dropped,
388
+ not the extra one, and rows a tool itself cut.
389
+
390
+ ### Removed
391
+
392
+ - Planning documents that were not part of the published package are no longer
393
+ in the repository.
394
+
395
+ ### Fixed
396
+
397
+ - **A 401 on a basic-auth profile now explains the Basic Auth restriction.**
398
+ Current ServiceNow instances reject REST Basic auth unless the user has the
399
+ role `snc_basic_auth_api_access` (or is a web-service-access-only account),
400
+ and the rejection is a bare 401. The setup wizard's credential check now says
401
+ so after "check the username and password", and recommends OAuth client
402
+ credentials, because ServiceNow is retiring Basic auth. A tool call that gets
403
+ a 401 on a basic-auth profile returns the same guidance as fixed text: the
404
+ error never contains the response body, the credential or the instance URL.
405
+ OAuth and API-key profiles are unchanged. The README already said the error
406
+ explained the restriction; now it does. The wizard still defaults to `basic`.
407
+ - **`sn_query` refuses a `structured_query` filter or order on a field the
408
+ table does not have.** ServiceNow ignores a condition on a field it does not
409
+ know, so a misspelt field returned unrelated rows with no error. The call now
410
+ fails and says the field "was not found on the table, or is not readable by
411
+ this user" (a field hidden by an ACL looks the same as a missing one). No
412
+ extra request is made: the fields a filter or order uses are added to the
413
+ read's `sysparm_fields` and looked for in the rows that come back, then left
414
+ out of the result. A field counts as present when any returned row carries
415
+ it, an existing column with no value is still returned, and a read that
416
+ returns no rows is returned as before, since there is nothing to check. A raw
417
+ encoded `query` is not checked; it is only accepted through a policy rule
418
+ that already pins the query and its fields. The extra columns add bytes to
419
+ each fetched row, and a filter on a very large text field that is not in
420
+ `fields` can take a wide read past the 1 MiB upstream response limit: the
421
+ call then says so and asks for a lower `limit`.
422
+
423
+ ## [2.3.0-dev.2] — 2026-11-15
424
+
425
+ ### Added
426
+
427
+ - **`sn_query` reads `structured_query.filter` given as a list as an implicit
428
+ AND.** `filter: [c1, c2]` means `{type: "group", operator: "and",
429
+ conditions: [c1, c2]}`, and a one-element list means that element. The
430
+ existing limit of 3 nested group levels is unchanged: a list of two or more
431
+ takes one level, so a list that holds a 3-level group is rejected, and the
432
+ error says so. An empty list is rejected with its own message. A list is read
433
+ this way only as the top-level `filter` and only by `sn_query`: `sn_batch`
434
+ write filters stay one object, so a mutation never selects records through a
435
+ list. The list is part of the published `tools/list` schema (see the schema entry below).
436
+ - **`structured_query.filter` shows a working example in `tools/list`.**
437
+ `sn_query`'s `filter` says a list is read as AND and shows one, and the
438
+ `sn_query` description gains a one-line example with the OR group form.
439
+ `sn_batch`'s `filter` has its own text: one condition or group, and a list is
440
+ not accepted, because a mutation never selects records through a list. Its
441
+ example filters on `sys_id`, a field every table has: an example on a field
442
+ such as `name` would match every row of a table without that column, since
443
+ ServiceNow drops a condition on a field the table lacks. Costs 605 characters
444
+ in `tools/list` (`sn_query` +459, `sn_batch` +146).
445
+ - **Responses say whether the metadata cache was used and where the time went.** `structuredContent.metadata` gains two optional fields. `cache` is
446
+ `hit`, `miss`, `bypass` (a `force_recache` refresh) or `mixed` (several
447
+ cacheable reads with different outcomes, such as an `sn_codesearch` with no
448
+ `table`), and is absent when the call read no cacheable table. `timing` is
449
+ `{ total_ms, upstream_ms, watermark_ms }` in whole milliseconds, wall-clock:
450
+ `upstream_ms` and `watermark_ms` are the time at least one request of that
451
+ kind was in flight, so overlapping requests count once. Only the server sets
452
+ them (a value a tool supplies is discarded), and they are not counted
453
+ against the result's byte limit, so they never cost a record and are never
454
+ dropped (see the entry on truncated responses below). Every tool's
455
+ `outputSchema` grows by 322 characters (7,728 in `tools/list`). Cache
456
+ behaviour is unchanged.
457
+
458
+ ### Fixed
459
+
460
+ - **`sn_query` no longer fails with an internal error at the smallest byte
461
+ budgets (a regression from the labelled hint).** A truncated read
462
+ at `max_response_bytes` 1000 with a wide row (eight fields including a long
463
+ `description`, limit 50) returned `The operation failed unexpectedly` every
464
+ time: the envelope's metadata leaves room for little beside the counts at
465
+ that budget, and the fuller labelled hint no longer fitted even with no row.
466
+ When no row fits beside the whole hint, the fit now leaves out the
467
+ whole-page figure and then the field advice, keeping the next-row figure, so
468
+ the result is a normal truncated one (`has_more: true`, no `next_offset`,
469
+ `recovery` set, a hint that parses and equals `dropped_records`). The hint
470
+ never names a value above the effective maximum.
471
+ - **A truncation hint says which `max_response_bytes` is for the next row and
472
+ which for the whole page.** The hint's budget was measured for the
473
+ next row only, but a bare `max_response_bytes=1500` read as a value for the
474
+ page: live, a 50-row read at 1000 bytes said 1500 and following it returned
475
+ one row. The hint now reads `... or max_response_bytes=1500 (fits the next
476
+ row) or max_response_bytes=15400 (fits all 50)`. The page figure is measured
477
+ the same way as the next-row one, is never smaller than it, and is left out
478
+ when the page would exceed the effective maximum (1,000,000, or a raw-read
479
+ rule's `maxResponseBytes`) and when one row was dropped (the next row is then
480
+ the rest of the page). The bare figure is gone, so a client that matched
481
+ `max_response_bytes=<n>.` at the end of the hint must match the labelled
482
+ form; the count still equals `dropped_records`, and the hint stays within its
483
+ 600 characters. `sn_schema`'s `fields_only` text now says it lists the
484
+ table's own fields only, and that inherited fields need the full schema; it
485
+ costs 68 characters in `tools/list` (`sn_schema` 3518 to 3586, total 128190
486
+ to 128258).
487
+ - **The list form of `structured_query.filter` is in the published `tools/list`
488
+ schema, and `tools/list` is smaller.** `sn_query` read a list filter,
489
+ and its descriptions tell clients to send one, but the schema it published
490
+ had no array option, so a client that validates arguments against it (ajv)
491
+ rejected the documented example. The list is now an explicit branch of the
492
+ schema, 1 to 32 conditions. The filter union and the leaf-condition union
493
+ are published once per tool, under `definitions`, and referred to with
494
+ `$ref`, where each use used to be written out again; every `$ref` resolves
495
+ inside the same tool's `inputSchema`; the definitions are named
496
+ `StructuredQueryFilter` and `StructuredQueryCondition`, so clients that merge
497
+ `definitions` across tools or servers do not collide. `sn_batch` shares them
498
+ and still publishes no array option, and a list is still rejected there.
499
+ Behaviour is unchanged: the error messages (including the specific one
500
+ for a bad field name, a control character or an over-long value inside a
501
+ list element, which now names the caller's own position, `filter[1].field`,
502
+ and not a position inside the wrapper group) and the nesting rule (a list of
503
+ two or more takes one group level) are as before. One difference stays between the
504
+ schema and the server: the schema cannot say that a list of two or more
505
+ takes a level, so it accepts a list that holds a 3-level group, which the
506
+ server rejects. `tools/list`: `sn_query` 16,574 to 10,183 characters,
507
+ `sn_batch` 14,818 to 8,328, the whole list 140,887 to 128,006 (the part a
508
+ model reads, without output schemas, 52,641 to 39,760). This delivers most of
509
+ the filter dedupe that was asked for; stripping the bounds the server enforces
510
+ anyway, and sharing the scalar value union, are not done. Clients that do not
511
+ resolve `$ref` to `definitions` are not served by this form, and a client that
512
+ dereferences `$ref` before it validates or shows the schema sees `sn_query` at
513
+ about 22.8k characters (the list option written out), against about 13.7k
514
+ before this change.
515
+ - **Truncated responses keep `metadata.cache` and `metadata.timing`.**
516
+ The two fields were added only when the finished response still fit
517
+ `max_response_bytes`, so a response fitted to within about 90 bytes of its
518
+ limit lost them, on exactly the calls where the timing helps most. They are
519
+ no longer counted against the limit: the fit and the truncation hint's numbers
520
+ (see the entries on `has_more` and on the hint's values) are unchanged, and a successful response always carries both. It
521
+ can exceed `max_response_bytes` by their size, under 100 bytes. The
522
+ `max_response_bytes` description of `sn_query`, `sn_get` and `sn_flow_view`
523
+ says so (about 61 characters each in `tools/list`).
524
+ - **A rejected `structured_query.filter` names the mistake.** A bad
525
+ operator, an unknown or missing `type`, a bad group, a missing key, a value of
526
+ the wrong kind or a group nested too deep used to get the same shape message,
527
+ even when the condition sat inside a group. The message now says the first
528
+ thing wrong, in fixed words, with an index path, for example `filter.conditions[1]:
529
+ a "text" condition needs operator one of contains, not_contains, starts_with,
530
+ ends_with`, `type must be one of equality, set, range, text, null, group` and
531
+ `a group needs operator and or or, and a non-empty conditions list`, followed
532
+ by the working example. A list filter on `sn_query` is reported at the
533
+ caller's own position (`filter[1]`); `sn_batch` gives the same text and still
534
+ says a list is not accepted. Nothing the caller sent is repeated, and a
535
+ condition type is quoted only when it is one of the known type names. The
536
+ shape message remains for anything the walk cannot name. `tools/list` is
537
+ byte-identical.
538
+ - **The `sn_query` truncation hint gives values to use.** The
539
+ `max_response_bytes` description promised exact follow-up arguments, but the
540
+ hint said "a lower limit" and "a higher max_response_bytes" with no numbers,
541
+ and a caller who chose their own `fields` got no field advice. The hint now
542
+ reads like `Dropped 14/22; continue offset=8 limit=8; retry offset=0 with
543
+ fields="sys_id,name" or max_response_bytes=31500.` The `limit` is the number
544
+ of rows that fit. The `max_response_bytes` is measured where the envelope
545
+ refits the result, with its own cost in it, and holds at least the next row;
546
+ if no budget up to 1,000,000 (or up to the `maxResponseBytes` of the raw-read
547
+ rule that approved a raw `query`, when that is lower) could, the hint says
548
+ the next row exceeds that maximum, names it, and offers fields and `sn_get`. A caller's own `fields` list is offered back without its large
549
+ fields (such as `script`); a list with none gets the `limit` and the budget,
550
+ and a read of `fields=all` gets the table's short default list. Only fields
551
+ the profile may read are named, never a sensitive one. The count still equals
552
+ `dropped_records` and the hint stays within 600 characters. The
553
+ `max_response_bytes` description now names what the hint carries (5
554
+ characters shorter; `tools/list` `sn_query` 16,579 to 16,574).
555
+ - **`sn_query` no longer stops paging after page 2.** The tool sends
556
+ `sysparm_no_count`, so ServiceNow's `X-Total-Count` header holds the size of
557
+ the response (the page plus the one sentinel row), not the table. The handler
558
+ trusted it: `total` echoed the rows fetched, and `has_more` turned false from
559
+ page 2 on, with thousands of rows unread. `has_more` and `next_offset` now
560
+ come from the sentinel row alone, so they stay true until the last page.
561
+ **`total` is no longer returned by `sn_query`** (the output schema already
562
+ made it optional); counting would need a COUNT query on every call, which
563
+ `sysparm_no_count` exists to avoid. Page on `has_more` and `next_offset`, or
564
+ call `sn_aggregate` with `COUNT` when the table size matters. If ServiceNow
565
+ ACLs strip rows from a page, `has_more` can read false early; cross-check
566
+ with `sn_aggregate` `COUNT`.
567
+ - **A read grant now allows code search.** `servicenow-mcp-setup grant
568
+ --read <table>` binds `sn_codesearch` along with `sn_query`, `sn_get`,
569
+ `sn_aggregate` and `sn_schema`, so `--read sys_script_include` is enough to
570
+ search script includes; before, every code search on such a profile was
571
+ denied unless `--tools sn_codesearch` was passed. It is checked per code
572
+ table (`sys_script`, `sys_script_include`, `sys_ui_script`,
573
+ `sys_script_client`, `sys_ws_operation`), does nothing on other tables, and
574
+ field policy still decides the script field exactly as it does for
575
+ `sn_query`. **Profiles saved before this change are not rewritten:** a target
576
+ keeps the tool list it was saved with, so run `servicenow-mcp-setup grant
577
+ --profile <name> --read <code table>` again to add the default tools, or add
578
+ just this one with `--tools sn_codesearch`. Neither removes a tool.
579
+ - **A truncation hint on `sn_query` no longer disagrees with `dropped_records`,
580
+ and suggests fields the table has.** A read cut to fit
581
+ `max_response_bytes` is trimmed in two steps, and the second could drop more
582
+ rows than the hint's "Dropped n/m" said. The hint is now restated from the
583
+ final result, so its count, its empty-result advice and its continuation
584
+ match `dropped_records`, `has_more` and `next_offset`. The suggested
585
+ projection was always `fields="sys_id,number"`, wrong for any table without
586
+ a `number` column. It is now the table's default fields without large ones
587
+ such as `script`, at most three; if that leaves only `sys_id`, `sys_id` and a
588
+ display field the profile's field policy names, else `sys_id` alone. A call
589
+ that passed its own `fields` is told to lower `limit` or raise
590
+ `max_response_bytes` instead of being given a field list.
591
+ - **A rejected `structured_query.filter` now says what is accepted.**
592
+ Every mistake used to read "Invalid input at structured_query.filter". The
593
+ message now says the filter is one condition or group object, gives a working
594
+ example, shows how to combine conditions with a group, and states the limit
595
+ of 3 nested group levels. It adds nothing to `tools/list`.
596
+
597
+ ### Changed
598
+
599
+ - **A repeated read of a small cached-table response is one request, not a
600
+ watermark and a read.** A cache hit costs one watermark round trip, so
601
+ for a small response a hit cost about what a plain read did and a miss cost
602
+ two requests. A read of a cacheable table whose response is under 32 KiB is
603
+ no longer kept: the selector is remembered as small, per credential scope,
604
+ for one cache TTL (at most 512 selectors, least recently used out), and its
605
+ later reads go straight to ServiceNow with no watermark. `metadata.cache`
606
+ says `miss` for them; `bypass` stays for `force_recache`. A direct read that
607
+ comes back at 32 KiB or more forgets the mark, so the selector is cached
608
+ from the next read. Responses of 32 KiB and up are cached, checked and
609
+ bounded as before. Measured on a dev instance: a 6 KB read 490 ms before (a
610
+ hit), 81 ms after; a 17 KB read 489 ms before, 98 ms. The threshold is a
611
+ size, not a time: `sys_dictionary` there has a watermark of about 0.5 s, and
612
+ even a 66 KB read was faster uncached. `metadataCache.smallReadBytes` sets
613
+ the threshold per profile (0 keeps every response).
614
+ - **`has_more` and `next_offset` count rows dropped for size. Contract
615
+ change for truncated pages.** A page cut to fit `max_response_bytes` kept
616
+ `has_more` and `next_offset` for the rows beyond the page, so a client that
617
+ followed `next_offset` skipped every dropped row, and a cut last page said
618
+ `has_more: false` with `record_count: 0`. Now `record_count`, `truncated` and
619
+ `dropped_records` keep their meaning, and:
620
+ - `has_more` is true when rows were dropped for size **or** rows exist past
621
+ the page: rows exist that the response did not contain.
622
+ - `next_offset` is `offset + record_count` when at least one row came back:
623
+ the first row not returned. A client that only follows it re-reads the
624
+ dropped rows and loses nothing.
625
+ - When no row fit, `next_offset` is omitted and `metadata.pagination.recovery`
626
+ is `adjust_request_and_retry_same_offset`: `has_more: true` with no
627
+ `next_offset` means the request must change (fewer `fields`, a lower
628
+ `limit`, or a higher `max_response_bytes`). The pagination output schema
629
+ accepts `has_more` without `next_offset` only with `recovery`.
630
+ - The old post-page continuation is gone from the hint; `next_offset` covers
631
+ it. A page that lost no rows to size is unchanged.
632
+
633
+ Applies to every list tool that fits through the shared envelope:
634
+ `sn_query`, `sn_syslog`, `sn_schema`, `sn_relationships`, `sn_codesearch`,
635
+ `sn_discover`, `sn_attach` (list) and `sn_atf` continue at `offset + rows
636
+ returned`; any other cut collection (for example `sn_aggregate`) reports
637
+ `has_more: true` with no `next_offset`. This also stops a byte drop made only
638
+ by the envelope from skipping the dropped row when `next_offset` is
639
+ followed, and the tool's "More records available. Call sn_query again with
640
+ offset=N." hint is restated at `next_offset` (or says no row fit), so it never
641
+ contradicts it; the envelope's `truncated`/`dropped_records` flags in `data` are not
642
+ added here. See the README, "Paging when a response is cut to size".
643
+ - **Code tables are in the default metadata cache.** `sys_script`,
644
+ `sys_script_include`, `sys_ui_script`, `sys_script_client` and
645
+ `sys_ws_operation` now cache like the other system-level metadata tables,
646
+ under the same per-credential scope and watermark freshness, so a repeated
647
+ `sn_codesearch` or `sn_query` of them skips the payload while the table is
648
+ unchanged (one watermark read still runs per call). A profile that sets its
649
+ own `metadataCache.tables` or `SN_METADATA_CACHE_TABLES` replaces the default
650
+ list and must name these tables to cache them. `sn_codesearch` has no
651
+ `force_recache` flag. `sn_get` of a record in these tables is cached too, and
652
+ a cold one costs 2 requests (a watermark read, then the record); `sn_batch`
653
+ and `sn_aggregate` reads are not cached. The cache is also bounded by bytes
654
+ now: a response over 512 KiB is not kept, each credential scope holds at most
655
+ 32 MiB and the whole cache 128 MiB (least recently used out first), and
656
+ expired entries are dropped as new ones are stored. A no-table
657
+ `sn_codesearch` reads its five tables concurrently, within the client's
658
+ existing request limit. Cached code-table entries hold full script bodies,
659
+ which can contain hard-coded credentials, in process memory (never on disk)
660
+ for up to the TTL; to keep them out, set `metadataCache.tables` or
661
+ `SN_METADATA_CACHE_TABLES` to
662
+ `sys_glide_object,sys_dictionary,sys_db_object,sys_app,sys_plugins,sys_metadata*,sys_flow*`.
663
+
664
+ ### Security
665
+
666
+ - **HTTP transport rejects a backslash in the request path.** A request whose
667
+ raw path (the part before `?` or `#`) contains a literal `\` now gets
668
+ `400 Bad Request`, on every route including the health paths. The WHATWG URL
669
+ parser reads `\` as `/` and resolves `..`, so `/x/..\mcp` or `//h\mcp` would
670
+ otherwise pass our path check as `/mcp`; until now only the
671
+ `@hono/node-server` dependency inside the MCP SDK transport refused the ones
672
+ that reached `/mcp`, and the health paths answered them. Backslashes in the
673
+ query string and a percent-encoded `%5C` behave as before.
674
+
8
675
  ## [2.3.0-rc.1] — 2026-11-14
9
676
 
10
677
  Release candidate for 2.3.0, published to the `next` dist-tag. It contains the
@@ -41,6 +708,126 @@ changes listed under 2.3.0-dev.1 below and nothing else.
41
708
  `\mcp`, which the server's own path check reads as `/mcp`) now gets 400 Bad
42
709
  Request.
43
710
 
711
+ ## [2.2.1] — 2026-11-16
712
+
713
+ ### Changed
714
+
715
+ - **Read tools hide `password`/`password2`-typed fields by dictionary type as
716
+ well as by name.** A field whose internal type is `password`, `password2`,
717
+ `masked` or `encrypted_text` is refused when named, left out of `fields=all`,
718
+ detailed and default reads, `"*"` responses and write echoes, refused as a
719
+ filter, order, aggregate, group-by or ATF step-condition field, and refused
720
+ as a write key, whatever it is called. A `sys_properties` row shows `value`
721
+ only when its `type` is a known non-secret type. The types come from one
722
+ cached `sys_dictionary` read per credential. While they cannot be read,
723
+ field-policy tools refuse with a message naming the access needed, unless the
724
+ profile sets `"fieldTypes": { "dictionary": "not_required" }`, which falls
725
+ back to name-only hiding and is flagged on the policy card. `tools/list` is
726
+ unchanged.
727
+
728
+ - **`sn_atf_author` checks the table, conditions and ACL setting of ATF steps
729
+ when it adds them.** A `record_query`, `record_validation`,
730
+ `field_values_validation` or `open_existing_record` step needs a read grant on
731
+ the table it names, and an `open_new_form` or `set_field_values` step a write
732
+ grant, with the same refusal as any table access (a named-only table such as
733
+ `sys_audit` must be named). The conditions of `record_query`,
734
+ `record_validation` and `field_values_validation` are checked against the
735
+ table's field policy: a field the profile may not read, a dot-walk (`a.b`), a
736
+ condition that is only a pasted step output, and a term the check does not
737
+ recognise are refused, and only the operators that compare a field with a
738
+ literal are allowed (`=`, `!=`, `<`, `<=`, `>`, `>=`, `LIKE`, `NOT LIKE`,
739
+ `STARTSWITH`, `ENDSWITH`, `IN`, `NOT IN`, `ISEMPTY`, `ISNOTEMPTY`, `BETWEEN`),
740
+ so an operator that takes a second field, such as `SAMEAS` or `GT_FIELD`, is
741
+ refused. `enforce_security: false` is refused on `record_query` and
742
+ `record_validation` with a fixed message (leave it out, or pass `true`; it
743
+ stays `true` by default). A refused step refuses the whole call, before any
744
+ write. A condition value, and a `set_field_values` value, may refer to an earlier
745
+ step's output only by record id or sys_id (`record_id`, `first_record`,
746
+ `sys_id`, `user`), and the fields a
747
+ `set_field_values` step sets must be writable on its table, as for `sn_update`.
748
+ The impersonated user's ACLs still apply on top; suites authored in the
749
+ instance are not checked by the server's table grants, and `atf.execute` stays
750
+ opt-in. The README and `docs/PRODUCTION-SECURITY.md` now also say that a
751
+ database view or extension table over one of the six named-only tables is not
752
+ covered by the name list.
753
+ - **A `"*"` write grant does not cover `sys_atf_step`, `sys_variable_value`
754
+ and `sys_element_mapping` for the generic write tools.** These tables hold the
755
+ step types, input values and pill mappings that `sn_atf_author` checks when it
756
+ adds a step. Under `"*"`,
757
+ `sn_atf_author` still writes them, but `sn_create`, `sn_update`, `sn_delete`,
758
+ `sn_batch` and attachment uploads reach them only when the profile names the
759
+ table for write, for example `servicenow-mcp-setup grant --profile <profile>
760
+ --write sys_atf_step --tools sn_update`; a refusal is the usual table-access
761
+ denial. Reads are unchanged, and no other table's access changes.
762
+ `sys_variable_value` and `sys_element_mapping` also hold other variables'
763
+ values and mappings (catalog variables, for example), so a profile that writes
764
+ those with the generic tools must now name them. The policy card lists the
765
+ three tables as outside the wildcard row's write access.
766
+ - **`sys_audit` and `sys_journal_field` are granted by name only: a `"*"` table
767
+ grant does not cover them.** Their rows hold the old and new values of other
768
+ tables' fields, comments and work notes. With `"*"` alone, `sn_query`, `sn_get`,
769
+ `sn_aggregate`, `sn_schema`, `sn_batch` and the other tools refuse them with
770
+ the usual table-access denial. To read one, name it:
771
+ `servicenow-mcp-setup grant --profile <profile> --read sys_audit --tools
772
+ sn_query`. A profile that already names a table is unaffected, and a `"*"`
773
+ grant beside the name still covers everything else. A read that names no
774
+ `fields` returns `sys_id`, `tablename`, `documentkey`, `fieldname`, `user` and
775
+ `sys_created_on` for `sys_audit`, and `sys_id`, `name`, `element_id`, `element`,
776
+ `sys_created_by` and `sys_created_on` for `sys_journal_field`; ask for
777
+ `oldvalue`, `newvalue` or `value` by name. No other table's access changes. The
778
+ policy card and the setup wizard's wildcard note say the same.
779
+ - **Four more tables are granted by name only, and a `"*"` field entry now
780
+ narrows all six.** `sys_history_line`, `sys_audit_delete`, `sys_attachment_doc`
781
+ and `sys_email` join `sys_audit` and `sys_journal_field`: a `"*"` table grant does
782
+ not cover them, for read or write, and a profile reaches one only when
783
+ `tableAccess` names it. Their rows hold history built from audit, deleted
784
+ records, attachment content and email bodies. A refusal is the usual
785
+ table-access denial. A read that names no `fields` leaves out the value
786
+ columns (`old`, `new`, `old_value` and `new_value`; `payload`; `data`; `body`,
787
+ `body_text`, `subject`, `recipients`, `copied`, `blind_copied`, `reply_to`,
788
+ `headers` and `error_string`), so ask for them by name. For field policy
789
+ the six belong to the profile, as the ITSM tables do: once a profile names one,
790
+ its `"*"` field entry narrows it, and an entry for the table itself narrows or
791
+ widens it. The 23 system tables, which a `"*"` field entry never narrows, are
792
+ unchanged. `sn_attach` is unaffected: it uses the Attachment API and never
793
+ reads `sys_attachment_doc`.
794
+ A `relatedTables` list that reaches one of the six under a `"*"` grant still
795
+ stops the profile loading, and the message now names the table and says it
796
+ must be granted by name. `sn_profile` reports these tables with the class
797
+ `named_only`.
798
+ - **`sn_batch` and `sn_query` refuse a `structured_query` filter or order on a
799
+ field the table does not have.** A confirmed `sn_batch` update or delete, its
800
+ dry run and an `sn_query` read stop with a fixed message that names the field
801
+ ("was not found on the table, or is not readable by this user") before any
802
+ record is changed or listed; for `sn_batch` that is before the sample or the
803
+ write. No extra request is made: the fields a filter or order uses are added to
804
+ the read's `sysparm_fields`, looked for in the rows that come back, and left out
805
+ of the result. A field counts as present when any returned row carries it, an
806
+ existing column with no value is still returned, and a read that returns no
807
+ rows is returned as before, since there is nothing to check. A raw encoded
808
+ `query` is not checked; it is only accepted through a policy rule that pins
809
+ the query and its fields. The extra columns add bytes to each fetched row, and
810
+ a filter on a very large text field that is not in `fields` can take a wide
811
+ read past the 1 MiB upstream response limit: the call then says so and asks for
812
+ a lower `limit`.
813
+
814
+ ### Security
815
+
816
+ - **HTTP server dependencies.** `@hono/node-server` moves from 2.1.3 to 2.1.7
817
+ and `hono` (transitive, through the MCP SDK) from 4.13.13 to 4.13.18,
818
+ clearing the advisories that `npm audit --omit=dev` reported:
819
+ GHSA-qv5m-9pm6-hqp3 and GHSA-jpvv-r467-5p4w in `@hono/node-server`, and
820
+ GHSA-4m76-xfj5-7975, GHSA-h7mg-cq63-vhpq, GHSA-3gg2-335m-rxc6,
821
+ GHSA-4h7h-rv7c-7m2v and GHSA-46wx-v44x-9hh2 in `hono`. The same releases
822
+ also carry the fixes for GHSA-7v5p-43qr-wch5 and GHSA-fj57-4f93-cfw6
823
+ (`@hono/node-server`) and GHSA-92p4-j3wq-jmqx, GHSA-39q9-qp46-w8xg and
824
+ GHSA-74fm-fwc7-3fwp (`hono`). The `tools/inspector` lock moves to `hono`
825
+ 4.13.18 and `@hono/node-server` 2.1.8. In the published package, only the
826
+ dormant HTTP transport uses these packages. One behaviour
827
+ change: a request to `/mcp` whose raw path contains a backslash (for example
828
+ `\mcp`, which the server's own path check reads as `/mcp`) now gets 400 Bad
829
+ Request.
830
+
44
831
  ## [2.2.0] — 2026-10-30
45
832
 
46
833
  2.2.0 is the first stable release since 2.1.0. It contains everything
@@ -206,9 +993,7 @@ parentheses are the pull requests that made each change.
206
993
  `io.github.onlyflowstech/servicenow-mcp`, and the package ships the
207
994
  `server.json` manifest for the official MCP Registry. (#14)
208
995
  - The README leads with what the server controls and what it does not, lists
209
- the tools by area, and documents per-profile field policy. `AGENTS.md`
210
- describes how contributors' AI agents work in this repository. (#11, #13,
211
- #14)
996
+ the tools by area, and documents per-profile field policy. (#11, #13, #14)
212
997
  - From the 2.2.0 dev builds: the ATF tools `sn_atf_author`, `sn_atf_run`,
213
998
  `sn_atf_results` and `sn_atf_readiness`, with `setup grant --atf`;
214
999
  Windows support in `servicenow-mcp-setup`; and the npm `dev` channel for