@norbix.ai/mcp 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -165,8 +165,8 @@ NORBIX_HUB_URL=https://hub.norbix.ai norbix-mcp --http --port 3010
165
165
  `norbix_get_integrations`, `norbix_get_integration`, `norbix_save_integration`,
166
166
  `norbix_test_integration`, `norbix_get_marketplace_integrations`,
167
167
  `norbix_save_marketplace_integration`, `norbix_get_database_schemas`,
168
- `norbix_find_documents`, `norbix_insert_document`, `norbix_update_document`,
169
- `norbix_get_taxonomy_terms`, `norbix_get_roles`, `norbix_get_policies`,
168
+ `norbix_find_documents`, `norbix_find_one_document`, `norbix_insert_document`,
169
+ `norbix_update_document`, `norbix_get_taxonomy_terms`, `norbix_get_roles`, `norbix_get_policies`,
170
170
  `norbix_get_logs`, `norbix_list_service_api_keys`.
171
171
 
172
172
  Typical flow the model follows for anything not curated:
@@ -192,7 +192,7 @@ The scheduler module switch (`enableScheduler` / `disableScheduler`) is `PUT`.
192
192
 
193
193
  ## Database tools
194
194
 
195
- Five shortcuts cover the everyday database work. Everything else in the
195
+ Six shortcuts cover the everyday database work. Everything else in the
196
196
  Database module (95 endpoints: schemas and drafts, records, taxonomies and
197
197
  terms, triggers, aggregates, database integrations) is reached with the
198
198
  generic trio.
@@ -200,13 +200,14 @@ generic trio.
200
200
  | Tool | SDK method | Route | Input |
201
201
  | --- | --- | --- | --- |
202
202
  | `norbix_get_database_schemas` | `hub.database.getDatabaseSchemas` | `GET /{version}/database/schemas` | `body` (paging) |
203
- | `norbix_find_documents` | `api.database.find` | `GET /{version}/database/collections/{collectionName}` | `body`: `collectionName`, `filter` (JSON string), `sortBy`, `pageSize`, … |
203
+ | `norbix_find_documents` | `api.database.find` | `GET /{version}/database/collections/{collectionName}` | `collectionName`, `filter?`, `sortBy?`, `sortOrder?`, `pageSize?`, `startingAfter?`, `endingBefore?`, `expandReferences?`, `databaseIntegrationId?`, `body?` (any other `FindRequest` field) |
204
+ | `norbix_find_one_document` | `api.database.findOne` | `GET /{version}/database/collections/{collectionName}/{id}` | `collectionName`, `id`, `expandReferences?`, `databaseIntegrationId?` |
204
205
  | `norbix_insert_document` | `api.database.insertOne` | `POST /{version}/database/collections/{collectionName}` | `collectionName`, `document`, `databaseIntegrationId?` |
205
- | `norbix_update_document` | `api.database.updateOne` | `PUT /{version}/database/collections/{collectionName}/{id}` | `collectionName`, `id`, `update`, `databaseIntegrationId?` |
206
+ | `norbix_update_document` | `api.database.updateOne` | `PUT /{version}/database/collections/{collectionName}/{id}` | `collectionName`, `id`, `update`, `arrayFilters?`, `databaseIntegrationId?` |
206
207
  | `norbix_get_taxonomy_terms` | `api.database.findTerms` | `GET /{version}/database/taxonomies/{taxonomyName}/terms` | `taxonomyName`, `filter?`, `pageSize?`, `sortDescending?`, `databaseIntegrationId?` |
207
208
 
208
209
  The Api record endpoints expect the document, the update and the filter as a
209
- JSON **string**. The three newer shortcuts accept an object or a string and
210
+ JSON **string**. The typed shortcuts accept an object or a string and
210
211
  send the string, so this works in one call:
211
212
 
212
213
  ```json
@@ -225,6 +226,31 @@ A `$` operator in it (`$set`, `$inc`, …) is refused with
225
226
  filter `{}` is refused (`CM-ERRORS-DATABASE-037`) unless the body also has
226
227
  `allRecords: true`.
227
228
 
229
+ **References.** A `user`, `role`, `taxonomy` (term), `collection` or `file`
230
+ field stores ids. Pass `expandReferences: true` to `norbix_find_documents` or
231
+ `norbix_find_one_document` and each such field comes back as
232
+ `{ "id": "…", "display": … }` (an array of them when the field is multiple):
233
+
234
+ ```json
235
+ { "name": "norbix_find_one_document", "arguments": {
236
+ "collectionName": "posts", "id": "…", "expandReferences": true } }
237
+ ```
238
+
239
+ ```json
240
+ { "author": { "id": "usr_…", "display": "Jane Doe" },
241
+ "tags": [ { "id": "6650…", "display": { "title": { "en": "News" }, "slug": "news" } },
242
+ { "id": "6651…", "display": null } ] }
243
+ ```
244
+
245
+ `display` is the target's `displayField` (a user property, a role name, a
246
+ term's title and slug, a record's chosen field). It is `null` when the target
247
+ is gone **or** when your API key may not read the target — the two cases look
248
+ the same on purpose. Default is off: the stored ids only.
249
+
250
+ **Arrays inside a document.** `norbix_update_document` takes `arrayFilters`
251
+ for positional paths: `update: { "items.$[i].qty": 2 }` with
252
+ `arrayFilters: [ { "i.sku": "A1" } ]`.
253
+
228
254
  For anything else, search the `database` group:
229
255
 
230
256
  - `norbix_search_endpoints({ query: "taxonomy term", group: "database" })`
@@ -275,6 +301,12 @@ is written as `feat(...)` with a `Breaking: <what>` line in the body (a
275
301
  is the source of truth for the version; release notes are on the GitHub
276
302
  Releases page.
277
303
 
304
+ The commit analyzer reads only the **start** of each subject, so a step
305
+ number goes at the end (`feat(database): expand references — step 2`),
306
+ never in front of the type: `[2] feat(database): …` is read as "no
307
+ release". Pull request 10 (the schema-content contract) shipped that way
308
+ and needed this follow-up commit to publish 0.3.0.
309
+
278
310
  ## Security notes
279
311
 
280
312
  - The server can do exactly what the API key can do — nothing more. Scope the
@@ -1183,6 +1183,11 @@
1183
1183
  "type": "{ [index: string]: string }",
1184
1184
  "optional": true
1185
1185
  },
1186
+ {
1187
+ "name": "slug",
1188
+ "type": "string",
1189
+ "optional": true
1190
+ },
1186
1191
  {
1187
1192
  "name": "description",
1188
1193
  "type": "string",
@@ -1283,6 +1288,11 @@
1283
1288
  "type": "{ [index: string]: string }",
1284
1289
  "optional": true
1285
1290
  },
1291
+ {
1292
+ "name": "slug",
1293
+ "type": "string",
1294
+ "optional": true
1295
+ },
1286
1296
  {
1287
1297
  "name": "description",
1288
1298
  "type": "string",
@@ -1791,6 +1801,16 @@
1791
1801
  "name": "translateOptions",
1792
1802
  "type": "IReadOnlyDictionary<string, string>",
1793
1803
  "optional": true
1804
+ },
1805
+ {
1806
+ "name": "default",
1807
+ "type": "string",
1808
+ "optional": true
1809
+ },
1810
+ {
1811
+ "name": "unique",
1812
+ "type": "boolean",
1813
+ "optional": true
1794
1814
  }
1795
1815
  ]
1796
1816
  },
@@ -1811,6 +1831,31 @@
1811
1831
  "name": "multipleOf",
1812
1832
  "type": "number",
1813
1833
  "optional": true
1834
+ },
1835
+ {
1836
+ "name": "default",
1837
+ "type": "number",
1838
+ "optional": true
1839
+ },
1840
+ {
1841
+ "name": "unique",
1842
+ "type": "boolean",
1843
+ "optional": true
1844
+ }
1845
+ ]
1846
+ },
1847
+ "CurrencyDefaultDto": {
1848
+ "base": null,
1849
+ "fields": [
1850
+ {
1851
+ "name": "value",
1852
+ "type": "number",
1853
+ "optional": false
1854
+ },
1855
+ {
1856
+ "name": "currency",
1857
+ "type": "string",
1858
+ "optional": false
1814
1859
  }
1815
1860
  ]
1816
1861
  },
@@ -1821,12 +1866,38 @@
1821
1866
  "name": "allowedCurrencies",
1822
1867
  "type": "IReadOnlyList<string>",
1823
1868
  "optional": true
1869
+ },
1870
+ {
1871
+ "name": "multipleOf",
1872
+ "type": "number",
1873
+ "optional": true
1874
+ },
1875
+ {
1876
+ "name": "minimum",
1877
+ "type": "number",
1878
+ "optional": true
1879
+ },
1880
+ {
1881
+ "name": "maximum",
1882
+ "type": "number",
1883
+ "optional": true
1884
+ },
1885
+ {
1886
+ "name": "default",
1887
+ "type": "CurrencyDefaultDto",
1888
+ "optional": true
1824
1889
  }
1825
1890
  ]
1826
1891
  },
1827
1892
  "BooleanFieldDto": {
1828
1893
  "base": "JsonSchemaFieldDto",
1829
- "fields": []
1894
+ "fields": [
1895
+ {
1896
+ "name": "default",
1897
+ "type": "boolean",
1898
+ "optional": true
1899
+ }
1900
+ ]
1830
1901
  },
1831
1902
  "DateFieldDto": {
1832
1903
  "base": "JsonSchemaFieldDto",
@@ -1840,6 +1911,11 @@
1840
1911
  "name": "maximum",
1841
1912
  "type": "number",
1842
1913
  "optional": true
1914
+ },
1915
+ {
1916
+ "name": "default",
1917
+ "type": "number",
1918
+ "optional": true
1843
1919
  }
1844
1920
  ]
1845
1921
  },
@@ -1855,6 +1931,16 @@
1855
1931
  "name": "maximum",
1856
1932
  "type": "number",
1857
1933
  "optional": true
1934
+ },
1935
+ {
1936
+ "name": "default",
1937
+ "type": "number",
1938
+ "optional": true
1939
+ },
1940
+ {
1941
+ "name": "unique",
1942
+ "type": "boolean",
1943
+ "optional": true
1858
1944
  }
1859
1945
  ]
1860
1946
  },
@@ -1870,7 +1956,23 @@
1870
1956
  },
1871
1957
  "TagsFieldDto": {
1872
1958
  "base": "JsonSchemaFieldDto",
1873
- "fields": []
1959
+ "fields": [
1960
+ {
1961
+ "name": "minItems",
1962
+ "type": "number",
1963
+ "optional": true
1964
+ },
1965
+ {
1966
+ "name": "maxItems",
1967
+ "type": "number",
1968
+ "optional": true
1969
+ },
1970
+ {
1971
+ "name": "default",
1972
+ "type": "IReadOnlyList<string>",
1973
+ "optional": true
1974
+ }
1975
+ ]
1874
1976
  },
1875
1977
  "FileFieldDto": {
1876
1978
  "base": "JsonSchemaFieldDto",
@@ -1879,6 +1981,26 @@
1879
1981
  "name": "storages",
1880
1982
  "type": "IReadOnlyList<string>",
1881
1983
  "optional": true
1984
+ },
1985
+ {
1986
+ "name": "minItems",
1987
+ "type": "number",
1988
+ "optional": true
1989
+ },
1990
+ {
1991
+ "name": "maxItems",
1992
+ "type": "number",
1993
+ "optional": true
1994
+ },
1995
+ {
1996
+ "name": "allowedFileType",
1997
+ "type": "string",
1998
+ "optional": true
1999
+ },
2000
+ {
2001
+ "name": "maxSizeMb",
2002
+ "type": "number",
2003
+ "optional": true
1882
2004
  }
1883
2005
  ]
1884
2006
  },
@@ -1894,6 +2016,11 @@
1894
2016
  "name": "multiple",
1895
2017
  "type": "boolean",
1896
2018
  "optional": false
2019
+ },
2020
+ {
2021
+ "name": "displayField",
2022
+ "type": "string",
2023
+ "optional": true
1897
2024
  }
1898
2025
  ]
1899
2026
  },
@@ -1924,6 +2051,11 @@
1924
2051
  "name": "multiple",
1925
2052
  "type": "boolean",
1926
2053
  "optional": false
2054
+ },
2055
+ {
2056
+ "name": "displayField",
2057
+ "type": "string",
2058
+ "optional": true
1927
2059
  }
1928
2060
  ]
1929
2061
  },
@@ -1934,6 +2066,11 @@
1934
2066
  "name": "multiple",
1935
2067
  "type": "boolean",
1936
2068
  "optional": false
2069
+ },
2070
+ {
2071
+ "name": "displayField",
2072
+ "type": "string",
2073
+ "optional": true
1937
2074
  }
1938
2075
  ]
1939
2076
  },
@@ -1949,6 +2086,61 @@
1949
2086
  "name": "multiple",
1950
2087
  "type": "boolean",
1951
2088
  "optional": false
2089
+ },
2090
+ {
2091
+ "name": "default",
2092
+ "type": "IReadOnlyList<string>",
2093
+ "optional": true
2094
+ }
2095
+ ]
2096
+ },
2097
+ "ObjectFieldDto": {
2098
+ "base": "JsonSchemaFieldDto",
2099
+ "fields": [
2100
+ {
2101
+ "name": "properties",
2102
+ "type": "IReadOnlyList<JsonSchemaFieldDto>",
2103
+ "optional": false
2104
+ },
2105
+ {
2106
+ "name": "required",
2107
+ "type": "IReadOnlyList<string>",
2108
+ "optional": true
2109
+ }
2110
+ ]
2111
+ },
2112
+ "ArrayFieldDto": {
2113
+ "base": "JsonSchemaFieldDto",
2114
+ "fields": [
2115
+ {
2116
+ "name": "items",
2117
+ "type": "JsonSchemaFieldDto",
2118
+ "optional": false
2119
+ },
2120
+ {
2121
+ "name": "minItems",
2122
+ "type": "number",
2123
+ "optional": true
2124
+ },
2125
+ {
2126
+ "name": "maxItems",
2127
+ "type": "number",
2128
+ "optional": true
2129
+ },
2130
+ {
2131
+ "name": "uniqueItems",
2132
+ "type": "boolean",
2133
+ "optional": true
2134
+ }
2135
+ ]
2136
+ },
2137
+ "JsonFieldDto": {
2138
+ "base": "JsonSchemaFieldDto",
2139
+ "fields": [
2140
+ {
2141
+ "name": "maxBytes",
2142
+ "type": "number",
2143
+ "optional": true
1952
2144
  }
1953
2145
  ]
1954
2146
  },
@@ -2535,6 +2727,26 @@
2535
2727
  }
2536
2728
  ]
2537
2729
  },
2730
+ "GetFileByIdResponse": {
2731
+ "base": "ResponseBase",
2732
+ "fields": [
2733
+ {
2734
+ "name": "file",
2735
+ "type": "FileResourceRefDto",
2736
+ "optional": true
2737
+ },
2738
+ {
2739
+ "name": "isPublic",
2740
+ "type": "boolean",
2741
+ "optional": true
2742
+ },
2743
+ {
2744
+ "name": "publicUrl",
2745
+ "type": "string",
2746
+ "optional": true
2747
+ }
2748
+ ]
2749
+ },
2538
2750
  "GetFileInfoResponse": {
2539
2751
  "base": "ResponseBase",
2540
2752
  "fields": [
@@ -3986,6 +4198,11 @@
3986
4198
  "name": "sortOrder",
3987
4199
  "type": "number",
3988
4200
  "optional": true
4201
+ },
4202
+ {
4203
+ "name": "expandReferences",
4204
+ "type": "boolean",
4205
+ "optional": false
3989
4206
  }
3990
4207
  ]
3991
4208
  },
@@ -4006,6 +4223,11 @@
4006
4223
  "name": "databaseIntegrationId",
4007
4224
  "type": "string",
4008
4225
  "optional": true
4226
+ },
4227
+ {
4228
+ "name": "expandReferences",
4229
+ "type": "boolean",
4230
+ "optional": false
4009
4231
  }
4010
4232
  ]
4011
4233
  },
@@ -4036,6 +4258,11 @@
4036
4258
  "name": "pagingArgs",
4037
4259
  "type": "PagingArgs",
4038
4260
  "optional": true
4261
+ },
4262
+ {
4263
+ "name": "expandReferences",
4264
+ "type": "boolean",
4265
+ "optional": false
4039
4266
  }
4040
4267
  ]
4041
4268
  },
@@ -4131,6 +4358,11 @@
4131
4358
  "name": "update",
4132
4359
  "type": "string",
4133
4360
  "optional": false
4361
+ },
4362
+ {
4363
+ "name": "arrayFilters",
4364
+ "type": "string",
4365
+ "optional": true
4134
4366
  }
4135
4367
  ]
4136
4368
  },
@@ -4156,6 +4388,11 @@
4156
4388
  "name": "update",
4157
4389
  "type": "string",
4158
4390
  "optional": false
4391
+ },
4392
+ {
4393
+ "name": "arrayFilters",
4394
+ "type": "string",
4395
+ "optional": true
4159
4396
  }
4160
4397
  ]
4161
4398
  },
@@ -4274,6 +4511,21 @@
4274
4511
  }
4275
4512
  ]
4276
4513
  },
4514
+ "GetFileByIdRequest": {
4515
+ "base": "CodeMashRequestBase",
4516
+ "fields": [
4517
+ {
4518
+ "name": "filesIntegrationId",
4519
+ "type": "string",
4520
+ "optional": false
4521
+ },
4522
+ {
4523
+ "name": "id",
4524
+ "type": "string",
4525
+ "optional": false
4526
+ }
4527
+ ]
4528
+ },
4277
4529
  "GetFileInfoRequest": {
4278
4530
  "base": "CodeMashRequestBase",
4279
4531
  "fields": [
@@ -10660,6 +10660,11 @@
10660
10660
  "type": "{ [index: string]: string }",
10661
10661
  "optional": true
10662
10662
  },
10663
+ {
10664
+ "name": "slug",
10665
+ "type": "string",
10666
+ "optional": true
10667
+ },
10663
10668
  {
10664
10669
  "name": "description",
10665
10670
  "type": "string",
@@ -10760,6 +10765,11 @@
10760
10765
  "type": "{ [index: string]: string }",
10761
10766
  "optional": true
10762
10767
  },
10768
+ {
10769
+ "name": "slug",
10770
+ "type": "string",
10771
+ "optional": true
10772
+ },
10763
10773
  {
10764
10774
  "name": "description",
10765
10775
  "type": "string",
@@ -12623,6 +12633,11 @@
12623
12633
  "type": "string",
12624
12634
  "optional": false
12625
12635
  },
12636
+ {
12637
+ "name": "env",
12638
+ "type": "string",
12639
+ "optional": true
12640
+ },
12626
12641
  {
12627
12642
  "name": "eventName",
12628
12643
  "type": "string",
@@ -12743,6 +12758,11 @@
12743
12758
  "type": "string",
12744
12759
  "optional": true
12745
12760
  },
12761
+ {
12762
+ "name": "env",
12763
+ "type": "string",
12764
+ "optional": false
12765
+ },
12746
12766
  {
12747
12767
  "name": "meta",
12748
12768
  "type": "IReadOnlyDictionary<string, string>",
@@ -15322,6 +15342,16 @@
15322
15342
  "name": "translateOptions",
15323
15343
  "type": "IReadOnlyDictionary<string, string>",
15324
15344
  "optional": true
15345
+ },
15346
+ {
15347
+ "name": "default",
15348
+ "type": "string",
15349
+ "optional": true
15350
+ },
15351
+ {
15352
+ "name": "unique",
15353
+ "type": "boolean",
15354
+ "optional": true
15325
15355
  }
15326
15356
  ]
15327
15357
  },
@@ -15342,6 +15372,31 @@
15342
15372
  "name": "multipleOf",
15343
15373
  "type": "number",
15344
15374
  "optional": true
15375
+ },
15376
+ {
15377
+ "name": "default",
15378
+ "type": "number",
15379
+ "optional": true
15380
+ },
15381
+ {
15382
+ "name": "unique",
15383
+ "type": "boolean",
15384
+ "optional": true
15385
+ }
15386
+ ]
15387
+ },
15388
+ "CurrencyDefaultDto": {
15389
+ "base": null,
15390
+ "fields": [
15391
+ {
15392
+ "name": "value",
15393
+ "type": "number",
15394
+ "optional": false
15395
+ },
15396
+ {
15397
+ "name": "currency",
15398
+ "type": "string",
15399
+ "optional": false
15345
15400
  }
15346
15401
  ]
15347
15402
  },
@@ -15352,12 +15407,38 @@
15352
15407
  "name": "allowedCurrencies",
15353
15408
  "type": "IReadOnlyList<string>",
15354
15409
  "optional": true
15410
+ },
15411
+ {
15412
+ "name": "multipleOf",
15413
+ "type": "number",
15414
+ "optional": true
15415
+ },
15416
+ {
15417
+ "name": "minimum",
15418
+ "type": "number",
15419
+ "optional": true
15420
+ },
15421
+ {
15422
+ "name": "maximum",
15423
+ "type": "number",
15424
+ "optional": true
15425
+ },
15426
+ {
15427
+ "name": "default",
15428
+ "type": "CurrencyDefaultDto",
15429
+ "optional": true
15355
15430
  }
15356
15431
  ]
15357
15432
  },
15358
15433
  "BooleanFieldDto": {
15359
15434
  "base": "JsonSchemaFieldDto",
15360
- "fields": []
15435
+ "fields": [
15436
+ {
15437
+ "name": "default",
15438
+ "type": "boolean",
15439
+ "optional": true
15440
+ }
15441
+ ]
15361
15442
  },
15362
15443
  "DateFieldDto": {
15363
15444
  "base": "JsonSchemaFieldDto",
@@ -15371,6 +15452,11 @@
15371
15452
  "name": "maximum",
15372
15453
  "type": "number",
15373
15454
  "optional": true
15455
+ },
15456
+ {
15457
+ "name": "default",
15458
+ "type": "number",
15459
+ "optional": true
15374
15460
  }
15375
15461
  ]
15376
15462
  },
@@ -15386,6 +15472,16 @@
15386
15472
  "name": "maximum",
15387
15473
  "type": "number",
15388
15474
  "optional": true
15475
+ },
15476
+ {
15477
+ "name": "default",
15478
+ "type": "number",
15479
+ "optional": true
15480
+ },
15481
+ {
15482
+ "name": "unique",
15483
+ "type": "boolean",
15484
+ "optional": true
15389
15485
  }
15390
15486
  ]
15391
15487
  },
@@ -15401,7 +15497,23 @@
15401
15497
  },
15402
15498
  "TagsFieldDto": {
15403
15499
  "base": "JsonSchemaFieldDto",
15404
- "fields": []
15500
+ "fields": [
15501
+ {
15502
+ "name": "minItems",
15503
+ "type": "number",
15504
+ "optional": true
15505
+ },
15506
+ {
15507
+ "name": "maxItems",
15508
+ "type": "number",
15509
+ "optional": true
15510
+ },
15511
+ {
15512
+ "name": "default",
15513
+ "type": "IReadOnlyList<string>",
15514
+ "optional": true
15515
+ }
15516
+ ]
15405
15517
  },
15406
15518
  "FileFieldDto": {
15407
15519
  "base": "JsonSchemaFieldDto",
@@ -15410,6 +15522,26 @@
15410
15522
  "name": "storages",
15411
15523
  "type": "IReadOnlyList<string>",
15412
15524
  "optional": true
15525
+ },
15526
+ {
15527
+ "name": "minItems",
15528
+ "type": "number",
15529
+ "optional": true
15530
+ },
15531
+ {
15532
+ "name": "maxItems",
15533
+ "type": "number",
15534
+ "optional": true
15535
+ },
15536
+ {
15537
+ "name": "allowedFileType",
15538
+ "type": "string",
15539
+ "optional": true
15540
+ },
15541
+ {
15542
+ "name": "maxSizeMb",
15543
+ "type": "number",
15544
+ "optional": true
15413
15545
  }
15414
15546
  ]
15415
15547
  },
@@ -15425,6 +15557,11 @@
15425
15557
  "name": "multiple",
15426
15558
  "type": "boolean",
15427
15559
  "optional": false
15560
+ },
15561
+ {
15562
+ "name": "displayField",
15563
+ "type": "string",
15564
+ "optional": true
15428
15565
  }
15429
15566
  ]
15430
15567
  },
@@ -15455,6 +15592,11 @@
15455
15592
  "name": "multiple",
15456
15593
  "type": "boolean",
15457
15594
  "optional": false
15595
+ },
15596
+ {
15597
+ "name": "displayField",
15598
+ "type": "string",
15599
+ "optional": true
15458
15600
  }
15459
15601
  ]
15460
15602
  },
@@ -15465,6 +15607,11 @@
15465
15607
  "name": "multiple",
15466
15608
  "type": "boolean",
15467
15609
  "optional": false
15610
+ },
15611
+ {
15612
+ "name": "displayField",
15613
+ "type": "string",
15614
+ "optional": true
15468
15615
  }
15469
15616
  ]
15470
15617
  },
@@ -15480,6 +15627,61 @@
15480
15627
  "name": "multiple",
15481
15628
  "type": "boolean",
15482
15629
  "optional": false
15630
+ },
15631
+ {
15632
+ "name": "default",
15633
+ "type": "IReadOnlyList<string>",
15634
+ "optional": true
15635
+ }
15636
+ ]
15637
+ },
15638
+ "ObjectFieldDto": {
15639
+ "base": "JsonSchemaFieldDto",
15640
+ "fields": [
15641
+ {
15642
+ "name": "properties",
15643
+ "type": "IReadOnlyList<JsonSchemaFieldDto>",
15644
+ "optional": false
15645
+ },
15646
+ {
15647
+ "name": "required",
15648
+ "type": "IReadOnlyList<string>",
15649
+ "optional": true
15650
+ }
15651
+ ]
15652
+ },
15653
+ "ArrayFieldDto": {
15654
+ "base": "JsonSchemaFieldDto",
15655
+ "fields": [
15656
+ {
15657
+ "name": "items",
15658
+ "type": "JsonSchemaFieldDto",
15659
+ "optional": false
15660
+ },
15661
+ {
15662
+ "name": "minItems",
15663
+ "type": "number",
15664
+ "optional": true
15665
+ },
15666
+ {
15667
+ "name": "maxItems",
15668
+ "type": "number",
15669
+ "optional": true
15670
+ },
15671
+ {
15672
+ "name": "uniqueItems",
15673
+ "type": "boolean",
15674
+ "optional": true
15675
+ }
15676
+ ]
15677
+ },
15678
+ "JsonFieldDto": {
15679
+ "base": "JsonSchemaFieldDto",
15680
+ "fields": [
15681
+ {
15682
+ "name": "maxBytes",
15683
+ "type": "number",
15684
+ "optional": true
15483
15685
  }
15484
15686
  ]
15485
15687
  },
@@ -16744,6 +16946,26 @@
16744
16946
  }
16745
16947
  ]
16746
16948
  },
16949
+ "GetFileByIdResponse": {
16950
+ "base": "ResponseBase",
16951
+ "fields": [
16952
+ {
16953
+ "name": "file",
16954
+ "type": "FileResourceRefDto",
16955
+ "optional": true
16956
+ },
16957
+ {
16958
+ "name": "isPublic",
16959
+ "type": "boolean",
16960
+ "optional": true
16961
+ },
16962
+ {
16963
+ "name": "publicUrl",
16964
+ "type": "string",
16965
+ "optional": true
16966
+ }
16967
+ ]
16968
+ },
16747
16969
  "GetFolderFilesResponse": {
16748
16970
  "base": "ResponseBase",
16749
16971
  "fields": [
@@ -22845,6 +23067,11 @@
22845
23067
  "name": "sortOrder",
22846
23068
  "type": "number",
22847
23069
  "optional": true
23070
+ },
23071
+ {
23072
+ "name": "expandReferences",
23073
+ "type": "boolean",
23074
+ "optional": false
22848
23075
  }
22849
23076
  ]
22850
23077
  },
@@ -22865,6 +23092,11 @@
22865
23092
  "name": "databaseIntegrationId",
22866
23093
  "type": "string",
22867
23094
  "optional": true
23095
+ },
23096
+ {
23097
+ "name": "expandReferences",
23098
+ "type": "boolean",
23099
+ "optional": false
22868
23100
  }
22869
23101
  ]
22870
23102
  },
@@ -22995,6 +23227,11 @@
22995
23227
  "name": "update",
22996
23228
  "type": "string",
22997
23229
  "optional": false
23230
+ },
23231
+ {
23232
+ "name": "arrayFilters",
23233
+ "type": "string",
23234
+ "optional": true
22998
23235
  }
22999
23236
  ]
23000
23237
  },
@@ -23020,6 +23257,11 @@
23020
23257
  "name": "update",
23021
23258
  "type": "string",
23022
23259
  "optional": false
23260
+ },
23261
+ {
23262
+ "name": "arrayFilters",
23263
+ "type": "string",
23264
+ "optional": true
23023
23265
  }
23024
23266
  ]
23025
23267
  },
@@ -23513,6 +23755,21 @@
23513
23755
  }
23514
23756
  ]
23515
23757
  },
23758
+ "GetFileById": {
23759
+ "base": "CodeMashRequestBase",
23760
+ "fields": [
23761
+ {
23762
+ "name": "filesIntegrationId",
23763
+ "type": "string",
23764
+ "optional": false
23765
+ },
23766
+ {
23767
+ "name": "id",
23768
+ "type": "string",
23769
+ "optional": false
23770
+ }
23771
+ ]
23772
+ },
23516
23773
  "GetFolderFiles": {
23517
23774
  "base": "CodeMashListPaginationRequestBase",
23518
23775
  "fields": [
@@ -3578,6 +3578,17 @@
3578
3578
  "pathParams": [],
3579
3579
  "scope": "project"
3580
3580
  },
3581
+ {
3582
+ "surface": "hub",
3583
+ "group": "files",
3584
+ "method": "getFileById",
3585
+ "requestDto": "GetFileById",
3586
+ "responseDto": "GetFileByIdResponse",
3587
+ "path": "/{version}/files/item/by-id",
3588
+ "verb": "GET",
3589
+ "pathParams": [],
3590
+ "scope": "project"
3591
+ },
3581
3592
  {
3582
3593
  "surface": "hub",
3583
3594
  "group": "files",
@@ -7185,6 +7196,20 @@
7185
7196
  ],
7186
7197
  "scope": "project"
7187
7198
  },
7199
+ {
7200
+ "surface": "api",
7201
+ "group": "files",
7202
+ "method": "getFileById",
7203
+ "requestDto": "GetFileByIdRequest",
7204
+ "responseDto": "GetFileByIdResponse",
7205
+ "path": "/{version}/files/{filesIntegrationId}/by-id/{id}",
7206
+ "verb": "GET",
7207
+ "pathParams": [
7208
+ "filesIntegrationId",
7209
+ "id"
7210
+ ],
7211
+ "scope": "project"
7212
+ },
7188
7213
  {
7189
7214
  "surface": "api",
7190
7215
  "group": "files",
package/dist/server.js CHANGED
@@ -72,7 +72,6 @@ export const curated = [
72
72
  { name: 'norbix_get_marketplace_integrations', surface: 'hub', group: 'code', method: 'getMarketplaceIntegrations', description: 'List marketplace integrations of the project.' },
73
73
  { name: 'norbix_save_marketplace_integration', surface: 'hub', group: 'code', method: 'saveMarketplaceIntegration', description: 'Create or update a marketplace integration.' },
74
74
  { name: 'norbix_get_database_schemas', surface: 'hub', group: 'database', method: 'getDatabaseSchemas', description: 'List database collection schemas of the project.' },
75
- { name: 'norbix_find_documents', surface: 'api', group: 'database', method: 'find', description: 'Query documents in a database collection (filter, sort, projection, paging).' },
76
75
  { name: 'norbix_get_roles', surface: 'hub', group: 'membership', method: 'getRoles', description: 'List membership roles of the project.' },
77
76
  { name: 'norbix_get_policies', surface: 'hub', group: 'membership', method: 'getPolicies', description: 'List membership policies of the project.' },
78
77
  { name: 'norbix_get_logs', surface: 'hub', group: 'logs', method: 'getLogs', description: 'Query project logs.' },
@@ -106,6 +105,69 @@ export function buildServer(handle) {
106
105
  .string()
107
106
  .optional()
108
107
  .describe('Database integration id; omit for the project default database.');
108
+ const expandReferences = z
109
+ .boolean()
110
+ .optional()
111
+ .describe('true = every reference field (user, role, taxonomy term, collection record, file) comes back as { id, display } — an array of them when the field is multiple. display is the target’s displayField (a term: { title, slug? }); null when the target is missing or your key may not read it. Default false = the stored ids only.');
112
+ server.registerTool('norbix_find_documents', {
113
+ title: 'norbix_find_documents',
114
+ description: 'Query documents in a database collection: MongoDB filter, sort, cursor paging, optional reference expansion. [GET /{version}/database/collections/{collectionName}]',
115
+ inputSchema: {
116
+ collectionName: z.string().describe('Collection (schema) name, e.g. "products".'),
117
+ filter: jsonValue.optional().describe('MongoDB filter (object or JSON string), e.g. { "price": { "$gt": 5 } }.'),
118
+ sortBy: z.string().optional().describe('Field to sort by.'),
119
+ sortOrder: z.number().int().optional().describe('1 = ascending, -1 = descending.'),
120
+ pageSize: z.number().int().min(1).max(1000).optional(),
121
+ startingAfter: z.string().optional().describe('Cursor paging: id of the last document of the previous page.'),
122
+ endingBefore: z.string().optional().describe('Cursor paging: id of the first document of the next page.'),
123
+ expandReferences,
124
+ databaseIntegrationId: integrationId,
125
+ body: z
126
+ .record(z.unknown())
127
+ .optional()
128
+ .describe('Any other FindRequest field (schemaVersion, pagingArgs, …). The named inputs above win over the same key here.'),
129
+ },
130
+ }, async ({ collectionName, filter, sortBy, sortOrder, pageSize, startingAfter, endingBefore, expandReferences: expand, databaseIntegrationId, body }) => {
131
+ try {
132
+ return json(await invoke(handle.client, 'api', 'database', 'find', {
133
+ ...(body ?? {}),
134
+ collectionName,
135
+ ...(filter !== undefined ? { filter: asJson(filter) } : {}),
136
+ ...(sortBy !== undefined ? { sortBy } : {}),
137
+ ...(sortOrder !== undefined ? { sortOrder } : {}),
138
+ ...(pageSize !== undefined ? { pageSize } : {}),
139
+ ...(startingAfter !== undefined ? { startingAfter } : {}),
140
+ ...(endingBefore !== undefined ? { endingBefore } : {}),
141
+ ...(expand !== undefined ? { expandReferences: expand } : {}),
142
+ ...(databaseIntegrationId ? { databaseIntegrationId } : {}),
143
+ }));
144
+ }
145
+ catch (e) {
146
+ return err(e);
147
+ }
148
+ });
149
+ server.registerTool('norbix_find_one_document', {
150
+ title: 'norbix_find_one_document',
151
+ description: 'Get one document by id, with optional reference expansion. [GET /{version}/database/collections/{collectionName}/{id}]',
152
+ inputSchema: {
153
+ collectionName: z.string().describe('Collection (schema) name.'),
154
+ id: z.string().describe('Document id.'),
155
+ expandReferences,
156
+ databaseIntegrationId: integrationId,
157
+ },
158
+ }, async ({ collectionName, id, expandReferences: expand, databaseIntegrationId }) => {
159
+ try {
160
+ return json(await invoke(handle.client, 'api', 'database', 'findOne', {
161
+ collectionName,
162
+ id,
163
+ ...(expand !== undefined ? { expandReferences: expand } : {}),
164
+ ...(databaseIntegrationId ? { databaseIntegrationId } : {}),
165
+ }));
166
+ }
167
+ catch (e) {
168
+ return err(e);
169
+ }
170
+ });
109
171
  server.registerTool('norbix_insert_document', {
110
172
  title: 'norbix_insert_document',
111
173
  description: 'Insert one document into a database collection. Returns the new id. [POST /{version}/database/collections/{collectionName}]',
@@ -133,14 +195,18 @@ export function buildServer(handle) {
133
195
  collectionName: z.string().describe('Collection (schema) name.'),
134
196
  id: z.string().describe('Document id.'),
135
197
  update: jsonValue.describe('The fields to change as a plain document, e.g. { "field": "value" } (object or JSON string). No $ operators.'),
198
+ arrayFilters: jsonValue
199
+ .optional()
200
+ .describe('MongoDB arrayFilters for positional paths in update, e.g. update { "items.$[i].qty": 2 } with arrayFilters [ { "i.sku": "A1" } ] (array or JSON string).'),
136
201
  databaseIntegrationId: integrationId,
137
202
  },
138
- }, async ({ collectionName, id, update, databaseIntegrationId }) => {
203
+ }, async ({ collectionName, id, update, arrayFilters, databaseIntegrationId }) => {
139
204
  try {
140
205
  return json(await invoke(handle.client, 'api', 'database', 'updateOne', {
141
206
  collectionName,
142
207
  id,
143
208
  update: asJson(update),
209
+ ...(arrayFilters !== undefined ? { arrayFilters: asJson(arrayFilters) } : {}),
144
210
  ...(databaseIntegrationId ? { databaseIntegrationId } : {}),
145
211
  }));
146
212
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norbix.ai/mcp",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Norbix MCP server — manage projects, integrations, databases, membership, notifications and every other Norbix Hub/API endpoint from Claude, Cursor, VS Code, Windsurf or any MCP client.",
5
5
  "author": "UAB Isidos",
6
6
  "license": "MIT",
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@modelcontextprotocol/sdk": "^1.12.0",
48
- "@norbix.ai/ts": "^4.11.0",
48
+ "@norbix.ai/ts": "^4.14.0",
49
49
  "express": "^4.21.2",
50
50
  "zod": "^3.24.0"
51
51
  },