@onlyflows/servicenow-mcp 2.3.0-dev.2 → 2.3.0-dev.4

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 (89) hide show
  1. package/CHANGELOG.md +235 -26
  2. package/README.md +174 -36
  3. package/dist/client.d.ts +5 -13
  4. package/dist/client.d.ts.map +1 -1
  5. package/dist/client.js +11 -26
  6. package/dist/client.js.map +1 -1
  7. package/dist/code-search-snippet.d.ts +25 -0
  8. package/dist/code-search-snippet.d.ts.map +1 -0
  9. package/dist/code-search-snippet.js +67 -0
  10. package/dist/code-search-snippet.js.map +1 -0
  11. package/dist/code-search-targets.d.ts +66 -0
  12. package/dist/code-search-targets.d.ts.map +1 -0
  13. package/dist/code-search-targets.js +82 -0
  14. package/dist/code-search-targets.js.map +1 -0
  15. package/dist/config.d.ts +1 -1
  16. package/dist/config.d.ts.map +1 -1
  17. package/dist/field-policy.d.ts.map +1 -1
  18. package/dist/field-policy.js +17 -5
  19. package/dist/field-policy.js.map +1 -1
  20. package/dist/http-observability.js +1 -0
  21. package/dist/http-observability.js.map +1 -1
  22. package/dist/metadata-cache.d.ts +2 -2
  23. package/dist/metadata-cache.d.ts.map +1 -1
  24. package/dist/metadata-cache.js +3 -2
  25. package/dist/metadata-cache.js.map +1 -1
  26. package/dist/policy-card.js +1 -1
  27. package/dist/policy-card.js.map +1 -1
  28. package/dist/profile-admin.d.ts +18 -0
  29. package/dist/profile-admin.d.ts.map +1 -1
  30. package/dist/profile-admin.js +26 -1
  31. package/dist/profile-admin.js.map +1 -1
  32. package/dist/profile-manager.d.ts +1 -1
  33. package/dist/profile-manager.d.ts.map +1 -1
  34. package/dist/response-too-large.d.ts +23 -0
  35. package/dist/response-too-large.d.ts.map +1 -0
  36. package/dist/response-too-large.js +42 -0
  37. package/dist/response-too-large.js.map +1 -0
  38. package/dist/risky-grants.d.ts.map +1 -1
  39. package/dist/risky-grants.js +1 -0
  40. package/dist/risky-grants.js.map +1 -1
  41. package/dist/setup.d.ts +4 -0
  42. package/dist/setup.d.ts.map +1 -1
  43. package/dist/setup.js +165 -70
  44. package/dist/setup.js.map +1 -1
  45. package/dist/table-policy.d.ts +42 -2
  46. package/dist/table-policy.d.ts.map +1 -1
  47. package/dist/table-policy.js +90 -6
  48. package/dist/table-policy.js.map +1 -1
  49. package/dist/tool-error.d.ts +40 -4
  50. package/dist/tool-error.d.ts.map +1 -1
  51. package/dist/tool-error.js +81 -4
  52. package/dist/tool-error.js.map +1 -1
  53. package/dist/tool-table-access.d.ts +9 -2
  54. package/dist/tool-table-access.d.ts.map +1 -1
  55. package/dist/tool-table-access.js +93 -30
  56. package/dist/tool-table-access.js.map +1 -1
  57. package/dist/tools/batch.d.ts.map +1 -1
  58. package/dist/tools/batch.js +21 -5
  59. package/dist/tools/batch.js.map +1 -1
  60. package/dist/tools/catalog.d.ts.map +1 -1
  61. package/dist/tools/catalog.js +2 -1
  62. package/dist/tools/catalog.js.map +1 -1
  63. package/dist/tools/codesearch.d.ts +2 -2
  64. package/dist/tools/codesearch.d.ts.map +1 -1
  65. package/dist/tools/codesearch.js +535 -86
  66. package/dist/tools/codesearch.js.map +1 -1
  67. package/dist/tools/flow-view-contracts.d.ts +2 -2
  68. package/dist/tools/index.d.ts.map +1 -1
  69. package/dist/tools/index.js +13 -2
  70. package/dist/tools/index.js.map +1 -1
  71. package/dist/tools/query-module.d.ts.map +1 -1
  72. package/dist/tools/query-module.js +25 -4
  73. package/dist/tools/query-module.js.map +1 -1
  74. package/dist/tools/result-envelope.d.ts +2 -2
  75. package/dist/tools/result-envelope.d.ts.map +1 -1
  76. package/dist/tools/result-envelope.js +20 -2
  77. package/dist/tools/result-envelope.js.map +1 -1
  78. package/dist/unknown-filter-fields.d.ts +52 -0
  79. package/dist/unknown-filter-fields.d.ts.map +1 -0
  80. package/dist/unknown-filter-fields.js +87 -0
  81. package/dist/unknown-filter-fields.js.map +1 -0
  82. package/dist/version.d.ts +1 -1
  83. package/dist/version.js +1 -1
  84. package/docs/CLIENT-SETUP.md +23 -10
  85. package/docs/PRODUCTION-SECURITY.md +10 -6
  86. package/docs/PROFILE-CREDENTIALS.md +10 -4
  87. package/docs/V2-MIGRATION.md +1 -1
  88. package/package.json +1 -1
  89. package/server.json +2 -2
package/CHANGELOG.md CHANGED
@@ -5,20 +5,232 @@ 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-dev.4] — 2026-11-15
9
+
10
+ ### Changed
11
+
12
+ - **The setup wizard defaults to OAuth client credentials.** The authentication
13
+ prompt now lists `oauth` first and offers it by default, then `apikey`, then
14
+ `basic`, which is marked legacy because ServiceNow is retiring Basic Auth for
15
+ REST calls. Choosing OAuth prints a short note on what the instance needs (an
16
+ Application Registry entry with a client ID and secret, the client credentials
17
+ grant, and an OAuth Application User with only the roles it needs, not an
18
+ administrator) and where the README explains it. When a Basic credential gets a
19
+ 401, the wizard now asks what next: retry with the same settings, switch to
20
+ OAuth (keeping the profile name and instance, and discarding the Basic
21
+ credential), or stop; its 401 advice points at that menu, while `doctor --live`
22
+ tells the operator to re-run setup and choose oauth. Nothing else changes for scripts:
23
+ `servicenow-mcp-profile create` without `--auth-type` still creates a Basic
24
+ profile, now with a deprecation notice shown only in an interactive terminal,
25
+ never in captured output (a future release may require the flag), and
26
+ `SN_AUTH_TYPE` still defaults to `basic`. Saved
27
+ profiles are never changed, and a saved profile with no `authType` is still
28
+ read as Basic. The README quick start, the profile and client setup guides and
29
+ their examples now show OAuth first.
30
+
31
+ ## [2.3.0-dev.3] — 2026-11-15
32
+
33
+ ### Added
34
+
35
+ - **`sn_codesearch` searches ES modules.** `table: "sys_module"` searches the
36
+ `content` column and names each row by its `path` (the table has no `name`);
37
+ with no `table` it takes its turn after the other code tables, labelled "ES
38
+ Modules" (a search that names the table labels rows with the table name, as for
39
+ the others). `sys_module` follows the same rules as the other code tables: a
40
+ plain `--read sys_module` binds `sn_codesearch` to it with the other default
41
+ read tools, `content` goes through the field policy and the sensitive-name
42
+ rules, it is in the default metadata cache list, and a write grant on it is
43
+ flagged as code execution. It also becomes a built-in system table, which
44
+ changes who can read its fields: see Changed.
45
+
46
+ - **`sn_codesearch` searches ATF step scripts.** `table: "sys_atf_step"` finds
47
+ the script inputs of ATF steps: rows of `sys_variable_value` whose `document`
48
+ is `sys_atf_step` and whose `variable` ends with `script`, a condition fixed in
49
+ the server that no argument can widen (a `field` is refused, and the search
50
+ term cannot add a clause). Each result is the step, named `<test> > step
51
+ <order>`; the steps and then their tests are read by id to name them. The
52
+ profile needs read on `sys_variable_value`, `sys_atf_step` and `sys_atf_test`,
53
+ each bound to `sn_codesearch`; a denial names the missing table, and in a
54
+ search with no `table` the target is left out, and named, unless all three are
55
+ held. `grant --atf` binds those tables to `sn_atf_author` only, so add `grant
56
+ --read sys_variable_value,sys_atf_step,sys_atf_test --tools sn_codesearch` for
57
+ this search. The tables are not in the default metadata cache list.
58
+ - **`tools/list` grows by 129 characters.** The `sn_codesearch` entry goes from
59
+ 3,655 to 3,784 characters (model-visible total 40,012 to 40,141), for the new
60
+ description and parameter text. The published `inputSchema` shape is
61
+ unchanged.
62
+
63
+ ### Changed
64
+
65
+ - **`sys_module` is now a built-in system table, so a `"*"` field entry no longer
66
+ narrows it.** Before, `sys_module` was like any table without a built-in entry:
67
+ a profile whose field policy has a `"*"` entry that narrows `readable` (for
68
+ example `"*": { "readable": ["sys_id", "path"] }`) could not read its `content`
69
+ or `sys_scope`, and `fields=all` returned only the listed fields. It is now one
70
+ of the 24 system tables, which keep their own built-in entry and are never
71
+ covered by a `"*"` field entry, as for `sys_script` and the other code tables.
72
+ A profile that reads `sys_module` (granted by name, or by a `"*"` table read
73
+ grant, which still covers it) and narrowed fields with `"*"` now reads
74
+ `content` and its other non-sensitive fields, and gets no warning. To keep it
75
+ narrowed, name `sys_module` in `fieldPolicy`, for example
76
+ `"sys_module": { "readable": ["sys_id", "path"] }`; a named entry still
77
+ narrows it. The sensitive-field-name rules apply as before.
78
+ - **A default read of a code table no longer returns the script.** `sn_query`
79
+ and `sn_get` on `sys_script`, `sys_script_include`, `sys_ui_script`,
80
+ `sys_script_client` and `sys_ws_operation` return, with no `fields`,
81
+ identifiers and metadata instead of the script body: for `sys_script_include`
82
+ that is `sys_id`, `name`, `api_name`, `active` and `sys_updated_on` (the other
83
+ tables add what identifies a row, such as `collection` and `when` for a
84
+ business rule). A default read of 87 script includes used to keep 9 rows
85
+ before the response budget cut it; it now returns all 87. **This changes the
86
+ default output:** a caller that relied on the body appearing by default must
87
+ name it, for example `fields: "sys_id,name,script"`. `fields=all` and
88
+ `response_format: "detailed"` still include it, and a profile that states its
89
+ own `defaults` for one of these tables keeps them.
90
+
91
+ ### Fixed
92
+
93
+ - **A code search with no `table` searches the code tables the profile may read.**
94
+ It needed a read grant on all five (and `sn_codesearch` bound to each), so a
95
+ profile that held only `sys_script_include` was denied outright while the same
96
+ call with `table: "sys_script_include"` worked. It now decides each table on
97
+ its own, by the table policy and by the field policy of its script field,
98
+ searches the ones it may read, and adds a warning that names the others and
99
+ the `grant` command that includes one. It fails only when none can be read: the
100
+ error names the tool and the grant, or, when the tables are granted but their
101
+ script field is not readable, the field and the key to change. The dispatcher
102
+ still authorizes the narrowed plan, so this never widens access.
103
+ - **A large code search returns results instead of failing.** `sn_codesearch`
104
+ read the full script of `limit + 1` rows from every table it searched, so
105
+ above about 100 rows (150, 200 and 300 failed every time on an instance of
106
+ 6,500 script includes) it passed the 1 MiB response cap, and with no `table`
107
+ the five tables shared one budget. It now reads the rows without their
108
+ scripts and then the scripts of the rows it returns only, 50 at a time, each
109
+ batch in its own response scope; a batch that is still too large is halved,
110
+ and a script too large to read on its own leaves that row with an empty
111
+ snippet and `note: "script too large to preview"`. A search of one table with
112
+ `limit` 49 or less still reads the scripts with the rows, in one request.
113
+ Reads also send `sysparm_no_count`, so the instance skips a row count it never
114
+ used. If the rows alone pass the cap, the error is the too-large message.
115
+ - **The script reads of one code search are bounded.** Scripts for the rows of a
116
+ page are read by id in batches of 50, and a call spends at most 12 such
117
+ requests and 8 MiB on them, however large the scripts are (a batch that passes
118
+ the response cap is retried smaller, and what it learns sizes the later
119
+ batches). Scripts are read only for the rows the response can hold, in page
120
+ order. When the budget is spent the remaining rows keep their place with an
121
+ empty snippet, and a warning says how many and to lower `limit`; the call does
122
+ not fail. A search across all code tables makes more requests than before but
123
+ transfers less data.
124
+ - **A code search with no `table` no longer fills page 1 with one table.**
125
+ Results were sorted by table name, so the first table (business rules)
126
+ filled the page whenever it had `limit` or more matches and script includes
127
+ appeared only after paging past every one of them. The tables now take turns:
128
+ each table's first match (script includes first, then business rules, UI
129
+ scripts, client scripts, scripted REST operations), then each table's second,
130
+ and so on, each in `sys_id` order. The order depends only on the data, and
131
+ `offset` pages through it without skipping or repeating a row. The result
132
+ metadata's `order_by` is `["round", "table", "sys_id"]` for this search and
133
+ `["sys_id"]` for a search of one table.
134
+ - **A code search snippet shows the text around the match.** It was the first
135
+ 200 characters of the script, which rarely showed why the record matched. It
136
+ is now about 200 characters centred on the first case-insensitive match, with
137
+ `...` where text was cut, and each row gains `line`, the line the match is on.
138
+ When the text holds no literal match (the instance's comparison can be looser
139
+ than a literal one) the snippet is the head of the script, as before, with no
140
+ `line`.
141
+ - **`sn_codesearch` accepts `field: "name"` and `field: "sys_id"`.** The search
142
+ appended its field to a fixed `sys_id,name,<field>` list, so a field already in
143
+ the list became a duplicate and the policy check refused it with
144
+ `invalid_field_selection` before any request. The projection now lists each
145
+ field once, in the access check and in the read. A `field` that names more
146
+ than one field (`"name,script"`) is refused instead of silently searching the
147
+ first.
148
+ - **`sn_codesearch` pages in a stable order.** It sent `sysparm_orderby`, which
149
+ is not a Table API parameter, so the order of its windows was not guaranteed
150
+ and an offset could skip or repeat a record. The order is now part of the
151
+ encoded query (`^ORDERBYsys_id`), as `sn_query` does it.
152
+ - **A response that passes the byte cap is reported as too large, with the
153
+ remedy, by every tool.** A read that went over the 1 MiB response limit, or
154
+ over the call's cumulative upstream budget, used to reach the caller as "The
155
+ operation failed unexpectedly. Error category: internal. Retry unchanged is
156
+ not recommended." It now reads "The response was too large to return in one
157
+ call. Lower limit, request fewer fields, or narrow the query, then retry.
158
+ Error category: too_large. Retry after correcting the request or
159
+ configuration." The new `too_large` category is also what audit records and
160
+ the HTTP tool-call metrics report as `errorCategory`. The mapping is made once,
161
+ where an error becomes the caller's message, so it covers every tool that
162
+ reads through the client. A write whose response is over the cap is still
163
+ treated as an unknown outcome, as before.
164
+
165
+ - **A table-policy denial names the table, the tool and the grant that lifts it.**
166
+ It used to say only "Table access was denied by policy." Now, for example,
167
+ `Table access was denied by policy: "sys_script_include" is granted to this
168
+ profile, but not for sn_codesearch. To allow it, run: servicenow-mcp-setup
169
+ grant --profile <profile> --read sys_script_include --tools sn_codesearch,
170
+ then restart the MCP client.` The text says whether the table is missing from
171
+ the profile or only the tool is, and uses `--write` for a write. It carries
172
+ the table and tool of that one call and nothing else of the profile's rules;
173
+ a table name that is not a valid identifier still gets the fixed sentence.
174
+ `grant --help` now says `--tools` adds to a table's tools.
175
+ - **A page with more results no longer reports truncation.** `sn_codesearch`,
176
+ `sn_discover` and `sn_aggregate` (with `group_by`) read one row past the page
177
+ to learn whether another page exists. That row is not part of the result, but
178
+ the response counted it as a dropped record, so every page that had a next
179
+ page also said `metadata.truncation: {truncated: true, reason:
180
+ "record_limit", dropped_records: 1}`, which reads as data loss when none was
181
+ lost. `has_more` and `next_offset` are unchanged (`next_offset` is still
182
+ `offset + record_count`), and `metadata.truncation` is now `{truncated:
183
+ false}` for such a page. It still reports rows dropped to fit the response
184
+ size (`byte_limit`), now counting only the rows of the page that were dropped,
185
+ not the extra one, and rows a tool itself cut.
186
+
187
+ ### Removed
188
+
189
+ - Planning documents that were not part of the published package are no longer
190
+ in the repository.
191
+
192
+ ### Fixed
193
+
194
+ - **A 401 on a basic-auth profile now explains the Basic Auth restriction.**
195
+ Current ServiceNow instances reject REST Basic auth unless the user has the
196
+ role `snc_basic_auth_api_access` (or is a web-service-access-only account),
197
+ and the rejection is a bare 401. The setup wizard's credential check now says
198
+ so after "check the username and password", and recommends OAuth client
199
+ credentials, because ServiceNow is retiring Basic auth. A tool call that gets
200
+ a 401 on a basic-auth profile returns the same guidance as fixed text: the
201
+ error never contains the response body, the credential or the instance URL.
202
+ OAuth and API-key profiles are unchanged. The README already said the error
203
+ explained the restriction; now it does. The wizard still defaults to `basic`.
204
+ - **`sn_query` refuses a `structured_query` filter or order on a field the
205
+ table does not have.** ServiceNow ignores a condition on a field it does not
206
+ know, so a misspelt field returned unrelated rows with no error. The call now
207
+ fails and says the field "was not found on the table, or is not readable by
208
+ this user" (a field hidden by an ACL looks the same as a missing one). No
209
+ extra request is made: the fields a filter or order uses are added to the
210
+ read's `sysparm_fields` and looked for in the rows that come back, then left
211
+ out of the result. A field counts as present when any returned row carries
212
+ it, an existing column with no value is still returned, and a read that
213
+ returns no rows is returned as before, since there is nothing to check. A raw
214
+ encoded `query` is not checked; it is only accepted through a policy rule
215
+ that already pins the query and its fields. The extra columns add bytes to
216
+ each fetched row, and a filter on a very large text field that is not in
217
+ `fields` can take a wide read past the 1 MiB upstream response limit: the
218
+ call then says so and asks for a lower `limit`.
219
+
8
220
  ## [2.3.0-dev.2] — 2026-11-15
9
221
 
10
222
  ### Added
11
223
 
12
224
  - **`sn_query` reads `structured_query.filter` given as a list as an implicit
13
- AND (#17).** `filter: [c1, c2]` means `{type: "group", operator: "and",
225
+ AND.** `filter: [c1, c2]` means `{type: "group", operator: "and",
14
226
  conditions: [c1, c2]}`, and a one-element list means that element. The
15
227
  existing limit of 3 nested group levels is unchanged: a list of two or more
16
228
  takes one level, so a list that holds a 3-level group is rejected, and the
17
229
  error says so. An empty list is rejected with its own message. A list is read
18
230
  this way only as the top-level `filter` and only by `sn_query`: `sn_batch`
19
231
  write filters stay one object, so a mutation never selects records through a
20
- list. The list is part of the published `tools/list` schema (#33, below).
21
- - **`structured_query.filter` shows a working example in `tools/list` (#19).**
232
+ list. The list is part of the published `tools/list` schema (see the schema entry below).
233
+ - **`structured_query.filter` shows a working example in `tools/list`.**
22
234
  `sn_query`'s `filter` says a list is read as AND and shows one, and the
23
235
  `sn_query` description gains a one-line example with the OR group form.
24
236
  `sn_batch`'s `filter` has its own text: one condition or group, and a list is
@@ -27,8 +239,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
27
239
  such as `name` would match every row of a table without that column, since
28
240
  ServiceNow drops a condition on a field the table lacks. Costs 605 characters
29
241
  in `tools/list` (`sn_query` +459, `sn_batch` +146).
30
- - **Responses say whether the metadata cache was used and where the time went
31
- (#21).** `structuredContent.metadata` gains two optional fields. `cache` is
242
+ - **Responses say whether the metadata cache was used and where the time went.** `structuredContent.metadata` gains two optional fields. `cache` is
32
243
  `hit`, `miss`, `bypass` (a `force_recache` refresh) or `mixed` (several
33
244
  cacheable reads with different outcomes, such as an `sn_codesearch` with no
34
245
  `table`), and is absent when the call read no cacheable table. `timing` is
@@ -37,14 +248,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
37
248
  kind was in flight, so overlapping requests count once. Only the server sets
38
249
  them (a value a tool supplies is discarded), and they are not counted
39
250
  against the result's byte limit, so they never cost a record and are never
40
- dropped (#34, below). Every tool's
251
+ dropped (see the entry on truncated responses below). Every tool's
41
252
  `outputSchema` grows by 322 characters (7,728 in `tools/list`). Cache
42
253
  behaviour is unchanged.
43
254
 
44
255
  ### Fixed
45
256
 
46
257
  - **`sn_query` no longer fails with an internal error at the smallest byte
47
- budgets (#39, a regression from the labelled hint, #37).** A truncated read
258
+ budgets (a regression from the labelled hint).** A truncated read
48
259
  at `max_response_bytes` 1000 with a wide row (eight fields including a long
49
260
  `description`, limit 50) returned `The operation failed unexpectedly` every
50
261
  time: the envelope's metadata leaves room for little beside the counts at
@@ -55,7 +266,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
55
266
  `recovery` set, a hint that parses and equals `dropped_records`). The hint
56
267
  never names a value above the effective maximum.
57
268
  - **A truncation hint says which `max_response_bytes` is for the next row and
58
- which for the whole page (#37).** The hint's budget was measured for the
269
+ which for the whole page.** The hint's budget was measured for the
59
270
  next row only, but a bare `max_response_bytes=1500` read as a value for the
60
271
  page: live, a 50-row read at 1000 bytes said 1500 and following it returned
61
272
  one row. The hint now reads `... or max_response_bytes=1500 (fits the next
@@ -71,7 +282,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
71
282
  costs 68 characters in `tools/list` (`sn_schema` 3518 to 3586, total 128190
72
283
  to 128258).
73
284
  - **The list form of `structured_query.filter` is in the published `tools/list`
74
- schema, and `tools/list` is smaller (#33).** `sn_query` read a list filter,
285
+ schema, and `tools/list` is smaller.** `sn_query` read a list filter,
75
286
  and its descriptions tell clients to send one, but the schema it published
76
287
  had no array option, so a client that validates arguments against it (ajv)
77
288
  rejected the documented example. The list is now an explicit branch of the
@@ -82,7 +293,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
82
293
  `StructuredQueryFilter` and `StructuredQueryCondition`, so clients that merge
83
294
  `definitions` across tools or servers do not collide. `sn_batch` shares them
84
295
  and still publishes no array option, and a list is still rejected there.
85
- Behaviour is unchanged: the error messages (#27, including the specific one
296
+ Behaviour is unchanged: the error messages (including the specific one
86
297
  for a bad field name, a control character or an over-long value inside a
87
298
  list element, which now names the caller's own position, `filter[1].field`,
88
299
  and not a position inside the wrapper group) and the nesting rule (a list of
@@ -92,22 +303,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
92
303
  server rejects. `tools/list`: `sn_query` 16,574 to 10,183 characters,
93
304
  `sn_batch` 14,818 to 8,328, the whole list 140,887 to 128,006 (the part a
94
305
  model reads, without output schemas, 52,641 to 39,760). This delivers most of
95
- the filter dedupe asked for in #9; stripping the bounds the server enforces
306
+ the filter dedupe that was asked for; stripping the bounds the server enforces
96
307
  anyway, and sharing the scalar value union, are not done. Clients that do not
97
308
  resolve `$ref` to `definitions` are not served by this form, and a client that
98
309
  dereferences `$ref` before it validates or shows the schema sees `sn_query` at
99
310
  about 22.8k characters (the list option written out), against about 13.7k
100
311
  before this change.
101
- - **Truncated responses keep `metadata.cache` and `metadata.timing` (#34).**
312
+ - **Truncated responses keep `metadata.cache` and `metadata.timing`.**
102
313
  The two fields were added only when the finished response still fit
103
314
  `max_response_bytes`, so a response fitted to within about 90 bytes of its
104
315
  limit lost them, on exactly the calls where the timing helps most. They are
105
316
  no longer counted against the limit: the fit and the truncation hint's numbers
106
- (#28, #29) are unchanged, and a successful response always carries both. It
317
+ (see the entries on `has_more` and on the hint's values) are unchanged, and a successful response always carries both. It
107
318
  can exceed `max_response_bytes` by their size, under 100 bytes. The
108
319
  `max_response_bytes` description of `sn_query`, `sn_get` and `sn_flow_view`
109
320
  says so (about 61 characters each in `tools/list`).
110
- - **A rejected `structured_query.filter` names the mistake (#27).** A bad
321
+ - **A rejected `structured_query.filter` names the mistake.** A bad
111
322
  operator, an unknown or missing `type`, a bad group, a missing key, a value of
112
323
  the wrong kind or a group nested too deep used to get the same shape message,
113
324
  even when the condition sat inside a group. The message now says the first
@@ -121,7 +332,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
121
332
  condition type is quoted only when it is one of the known type names. The
122
333
  shape message remains for anything the walk cannot name. `tools/list` is
123
334
  byte-identical.
124
- - **The `sn_query` truncation hint gives values to use (#29).** The
335
+ - **The `sn_query` truncation hint gives values to use.** The
125
336
  `max_response_bytes` description promised exact follow-up arguments, but the
126
337
  hint said "a lower limit" and "a higher max_response_bytes" with no numbers,
127
338
  and a caller who chose their own `fields` got no field advice. The hint now
@@ -138,7 +349,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
138
349
  `dropped_records` and the hint stays within 600 characters. The
139
350
  `max_response_bytes` description now names what the hint carries (5
140
351
  characters shorter; `tools/list` `sn_query` 16,579 to 16,574).
141
- - **`sn_query` no longer stops paging after page 2 (#1).** The tool sends
352
+ - **`sn_query` no longer stops paging after page 2.** The tool sends
142
353
  `sysparm_no_count`, so ServiceNow's `X-Total-Count` header holds the size of
143
354
  the response (the page plus the one sentinel row), not the table. The handler
144
355
  trusted it: `total` echoed the rows fetched, and `has_more` turned false from
@@ -150,7 +361,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
150
361
  call `sn_aggregate` with `COUNT` when the table size matters. If ServiceNow
151
362
  ACLs strip rows from a page, `has_more` can read false early; cross-check
152
363
  with `sn_aggregate` `COUNT`.
153
- - **A read grant now allows code search (#2).** `servicenow-mcp-setup grant
364
+ - **A read grant now allows code search.** `servicenow-mcp-setup grant
154
365
  --read <table>` binds `sn_codesearch` along with `sn_query`, `sn_get`,
155
366
  `sn_aggregate` and `sn_schema`, so `--read sys_script_include` is enough to
156
367
  search script includes; before, every code search on such a profile was
@@ -163,7 +374,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
163
374
  --profile <name> --read <code table>` again to add the default tools, or add
164
375
  just this one with `--tools sn_codesearch`. Neither removes a tool.
165
376
  - **A truncation hint on `sn_query` no longer disagrees with `dropped_records`,
166
- and suggests fields the table has (#20).** A read cut to fit
377
+ and suggests fields the table has.** A read cut to fit
167
378
  `max_response_bytes` is trimmed in two steps, and the second could drop more
168
379
  rows than the hint's "Dropped n/m" said. The hint is now restated from the
169
380
  final result, so its count, its empty-result advice and its continuation
@@ -174,7 +385,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
174
385
  display field the profile's field policy names, else `sys_id` alone. A call
175
386
  that passed its own `fields` is told to lower `limit` or raise
176
387
  `max_response_bytes` instead of being given a field list.
177
- - **A rejected `structured_query.filter` now says what is accepted (#18).**
388
+ - **A rejected `structured_query.filter` now says what is accepted.**
178
389
  Every mistake used to read "Invalid input at structured_query.filter". The
179
390
  message now says the filter is one condition or group object, gives a working
180
391
  example, shows how to combine conditions with a group, and states the limit
@@ -183,7 +394,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
183
394
  ### Changed
184
395
 
185
396
  - **A repeated read of a small cached-table response is one request, not a
186
- watermark and a read (#36).** A cache hit costs one watermark round trip, so
397
+ watermark and a read.** A cache hit costs one watermark round trip, so
187
398
  for a small response a hit cost about what a plain read did and a miss cost
188
399
  two requests. A read of a cacheable table whose response is under 32 KiB is
189
400
  no longer kept: the selector is remembered as small, per credential scope,
@@ -197,7 +408,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
197
408
  size, not a time: `sys_dictionary` there has a watermark of about 0.5 s, and
198
409
  even a 66 KB read was faster uncached. `metadataCache.smallReadBytes` sets
199
410
  the threshold per profile (0 keeps every response).
200
- - **`has_more` and `next_offset` count rows dropped for size (#28). Contract
411
+ - **`has_more` and `next_offset` count rows dropped for size. Contract
201
412
  change for truncated pages.** A page cut to fit `max_response_bytes` kept
202
413
  `has_more` and `next_offset` for the rows beyond the page, so a client that
203
414
  followed `next_offset` skipped every dropped row, and a cut last page said
@@ -221,10 +432,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
221
432
  `sn_discover`, `sn_attach` (list) and `sn_atf` continue at `offset + rows
222
433
  returned`; any other cut collection (for example `sn_aggregate`) reports
223
434
  `has_more: true` with no `next_offset`. This also stops a byte drop made only
224
- by the envelope (#23) from skipping the dropped row when `next_offset` is
435
+ by the envelope from skipping the dropped row when `next_offset` is
225
436
  followed, and the tool's "More records available. Call sn_query again with
226
437
  offset=N." hint is restated at `next_offset` (or says no row fit), so it never
227
- contradicts it; #23's `truncated`/`dropped_records` flags in `data` are not
438
+ contradicts it; the envelope's `truncated`/`dropped_records` flags in `data` are not
228
439
  added here. See the README, "Paging when a response is cut to size".
229
440
  - **Code tables are in the default metadata cache.** `sys_script`,
230
441
  `sys_script_include`, `sys_ui_script`, `sys_script_client` and
@@ -459,9 +670,7 @@ parentheses are the pull requests that made each change.
459
670
  `io.github.onlyflowstech/servicenow-mcp`, and the package ships the
460
671
  `server.json` manifest for the official MCP Registry. (#14)
461
672
  - The README leads with what the server controls and what it does not, lists
462
- the tools by area, and documents per-profile field policy. `AGENTS.md`
463
- describes how contributors' AI agents work in this repository. (#11, #13,
464
- #14)
673
+ the tools by area, and documents per-profile field policy. (#11, #13, #14)
465
674
  - From the 2.2.0 dev builds: the ATF tools `sn_atf_author`, `sn_atf_run`,
466
675
  `sn_atf_results` and `sn_atf_readiness`, with `setup grant --atf`;
467
676
  Windows support in `servicenow-mcp-setup`; and the npm `dev` channel for