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

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