@vectros-ai/mcp-server 0.5.2 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2877,7 +2877,7 @@ var AuthClient = class {
2877
2877
  );
2878
2878
  }
2879
2879
  /**
2880
- * Creates a new access profile under the given app context. This call is idempotent by `principalId`: if a profile with the same `principalId` already exists, the existing profile is returned (with status 200) instead of creating a duplicate. You must provide exactly one of `scopes` (an inline list of scopes) or `roleId` (a reference to a role); supplying both, or neither, is rejected. `identityOverrides` may set only `orgId` and `clientId`; any other key (including the account identifier or `userId`) is rejected. If you use a scoped credential, the profile's effective scopes may not exceed your own; a root API key (`sk_`) is exempt. Requires the `profiles:c` scope.
2880
+ * Creates a new access profile under the given app context. This call is idempotent by `principalId`: if a profile with the same `principalId` already exists, the existing profile is returned (with status 200) instead of creating a duplicate. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing profile was returned) tells the two apart. To overwrite an existing profile's `scopes`/`roleId`, `identityOverrides`, and `status` instead of returning it unchanged, set `?upsert=true` (this also requires the `profiles:u` scope). You must provide exactly one of `scopes` (an inline list of scopes) or `roleId` (a reference to a role); supplying both, or neither, is rejected. `identityOverrides` may set only `orgId` and `clientId`; any other key (including the account identifier or `userId`) is rejected. If you use a scoped credential, the profile's effective scopes may not exceed your own; a root API key (`sk_`) is exempt. Requires the `profiles:c` scope.
2881
2881
  *
2882
2882
  * @param {Vectros.CreateAccessProfileRequest} request
2883
2883
  * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -2899,7 +2899,10 @@ var AuthClient = class {
2899
2899
  return HttpResponsePromise.fromPromise(this.__createAccessProfile(request, requestOptions));
2900
2900
  }
2901
2901
  async __createAccessProfile(request, requestOptions) {
2902
- const { contextId, body: _body } = request;
2902
+ const { contextId, upsert, body: _body } = request;
2903
+ const _queryParams = {
2904
+ upsert
2905
+ };
2903
2906
  const _authRequest = await this._options.authProvider.getAuthRequest();
2904
2907
  const _headers = mergeHeaders(
2905
2908
  _authRequest.headers,
@@ -2914,7 +2917,7 @@ var AuthClient = class {
2914
2917
  method: "POST",
2915
2918
  headers: _headers,
2916
2919
  contentType: "application/json",
2917
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
2920
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
2918
2921
  requestType: "json",
2919
2922
  body: _body,
2920
2923
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
@@ -3009,9 +3012,9 @@ var AuthClient = class {
3009
3012
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/app-contexts");
3010
3013
  }
3011
3014
  /**
3012
- * Creates a new app context. This call is idempotent by `contextId`: if an app context with the same `contextId` already exists, the existing app context is returned (with status 200) instead of creating a duplicate. The reserved `contextId` value `vectros-admin` cannot be created through this endpoint; it is provisioned automatically for your account. Requires the `app-contexts:c` scope.
3015
+ * Creates a new app context. This call is idempotent by `contextId`: if an app context with the same `contextId` already exists, the existing app context is returned (with status 200) instead of creating a duplicate. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing context was returned) tells the two apart. To overwrite an existing context's `name`/`description` instead of returning it unchanged, set `?upsert=true` (this also requires the `app-contexts:u` scope). The reserved `contextId` value `vectros-admin` cannot be created through this endpoint; it is provisioned automatically for your account. Requires the `app-contexts:c` scope.
3013
3016
  *
3014
- * @param {Vectros.AppContextRequest} request
3017
+ * @param {Vectros.CreateAppContextRequest} request
3015
3018
  * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
3016
3019
  *
3017
3020
  * @throws {@link Vectros.BadRequestError}
@@ -3020,14 +3023,20 @@ var AuthClient = class {
3020
3023
  *
3021
3024
  * @example
3022
3025
  * await client.auth.createAppContext({
3023
- * contextId: "myapp",
3024
- * name: "My Internal App"
3026
+ * body: {
3027
+ * contextId: "myapp",
3028
+ * name: "My Internal App"
3029
+ * }
3025
3030
  * })
3026
3031
  */
3027
3032
  createAppContext(request, requestOptions) {
3028
3033
  return HttpResponsePromise.fromPromise(this.__createAppContext(request, requestOptions));
3029
3034
  }
3030
3035
  async __createAppContext(request, requestOptions) {
3036
+ const { upsert, body: _body } = request;
3037
+ const _queryParams = {
3038
+ upsert
3039
+ };
3031
3040
  const _authRequest = await this._options.authProvider.getAuthRequest();
3032
3041
  const _headers = mergeHeaders(
3033
3042
  _authRequest.headers,
@@ -3042,9 +3051,9 @@ var AuthClient = class {
3042
3051
  method: "POST",
3043
3052
  headers: _headers,
3044
3053
  contentType: "application/json",
3045
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
3054
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
3046
3055
  requestType: "json",
3047
- body: request,
3056
+ body: _body,
3048
3057
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
3049
3058
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
3050
3059
  abortSignal: requestOptions?.abortSignal,
@@ -3140,7 +3149,7 @@ var AuthClient = class {
3140
3149
  );
3141
3150
  }
3142
3151
  /**
3143
- * Creates a new role under the given app context. This call is idempotent by `roleId`: if a role with the same `roleId` already exists, the existing role is returned (with status 200) instead of creating a duplicate. If you use a scoped credential, the role's scopes may not exceed your own; a root API key (`sk_`) is exempt. Requires the `profiles:c` scope.
3152
+ * Creates a new role under the given app context. This call is idempotent by `roleId`: if a role with the same `roleId` already exists, the existing role is returned (with status 200) instead of creating a duplicate. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing role was returned) tells the two apart. To overwrite an existing role's `name`/`description`/`scopes` instead of returning it unchanged, set `?upsert=true` (this also requires the `profiles:u` scope). If you use a scoped credential, the role's scopes may not exceed your own; a root API key (`sk_`) is exempt. Requires the `profiles:c` scope.
3144
3153
  *
3145
3154
  * @param {Vectros.CreateRoleRequest} request
3146
3155
  * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -3166,7 +3175,10 @@ var AuthClient = class {
3166
3175
  return HttpResponsePromise.fromPromise(this.__createRole(request, requestOptions));
3167
3176
  }
3168
3177
  async __createRole(request, requestOptions) {
3169
- const { contextId, body: _body } = request;
3178
+ const { contextId, upsert, body: _body } = request;
3179
+ const _queryParams = {
3180
+ upsert
3181
+ };
3170
3182
  const _authRequest = await this._options.authProvider.getAuthRequest();
3171
3183
  const _headers = mergeHeaders(
3172
3184
  _authRequest.headers,
@@ -3181,7 +3193,7 @@ var AuthClient = class {
3181
3193
  method: "POST",
3182
3194
  headers: _headers,
3183
3195
  contentType: "application/json",
3184
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
3196
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
3185
3197
  requestType: "json",
3186
3198
  body: _body,
3187
3199
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
@@ -4665,23 +4677,30 @@ var DocumentsClient = class {
4665
4677
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/documents");
4666
4678
  }
4667
4679
  /**
4668
- * Creates a document from a raw text string and queues it for asynchronous indexing so it becomes searchable. Requires the `documents:c` scope.
4680
+ * Creates a document from a raw text string and queues it for asynchronous indexing so it becomes searchable. Optionally supply an `externalId` to make the create idempotent — if a document with the same `externalId` already exists in your context, that existing document is returned unchanged instead of a duplicate being created. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing document was returned) tells the two apart. To overwrite an existing document's content instead of returning it unchanged, set `?upsert=true` (this also requires the `documents:u` scope). Requires the `documents:c` scope.
4669
4681
  *
4670
- * @param {Vectros.DocumentRequest} request
4682
+ * @param {Vectros.IngestDocumentRequest} request
4671
4683
  * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
4672
4684
  *
4673
4685
  * @throws {@link Vectros.BadRequestError}
4686
+ * @throws {@link Vectros.ForbiddenError}
4674
4687
  * @throws {@link Vectros.TooManyRequestsError}
4675
4688
  *
4676
4689
  * @example
4677
4690
  * await client.documents.ingestDocument({
4678
- * title: "Patient Intake Form \u2014 Jane Doe"
4691
+ * body: {
4692
+ * title: "Patient Intake Form \u2014 Jane Doe"
4693
+ * }
4679
4694
  * })
4680
4695
  */
4681
4696
  ingestDocument(request, requestOptions) {
4682
4697
  return HttpResponsePromise.fromPromise(this.__ingestDocument(request, requestOptions));
4683
4698
  }
4684
4699
  async __ingestDocument(request, requestOptions) {
4700
+ const { upsert, body: _body } = request;
4701
+ const _queryParams = {
4702
+ upsert
4703
+ };
4685
4704
  const _authRequest = await this._options.authProvider.getAuthRequest();
4686
4705
  const _headers = mergeHeaders(
4687
4706
  _authRequest.headers,
@@ -4696,9 +4715,9 @@ var DocumentsClient = class {
4696
4715
  method: "POST",
4697
4716
  headers: _headers,
4698
4717
  contentType: "application/json",
4699
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
4718
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
4700
4719
  requestType: "json",
4701
- body: request,
4720
+ body: _body,
4702
4721
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
4703
4722
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
4704
4723
  abortSignal: requestOptions?.abortSignal,
@@ -4712,6 +4731,8 @@ var DocumentsClient = class {
4712
4731
  switch (_response.error.statusCode) {
4713
4732
  case 400:
4714
4733
  throw new BadRequestError(_response.error.body, _response.rawResponse);
4734
+ case 403:
4735
+ throw new ForbiddenError(_response.error.body, _response.rawResponse);
4715
4736
  case 429:
4716
4737
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
4717
4738
  default:
@@ -4978,7 +4999,7 @@ var DocumentsClient = class {
4978
4999
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v1/documents/{id}");
4979
5000
  }
4980
5001
  /**
4981
- * Finds documents of a given type by a schema-declared lookup field. The document must be bound to a schema (via `schemaId`) that declares the field as a lookup field. A lookup on a sensitive field is rejected here, because the value would appear in the URL query string; use POST /v1/documents/lookup (the request-body variant) for a sensitive field instead. Results are paginated: set `limit` for the page size and feed the returned `nextCursor` back as `startFrom` to fetch the next page. The response is a `{data, nextCursor}` envelope. Requires the `documents:r` scope.
5002
+ * Finds documents of a given type by field value. Supported fields: `externalId` (the document's first-class external identifier — no schema declaration required) and any field declared as a lookup field on the bound schema. A lookup on a sensitive field is rejected here because the value would appear in the URL query string; use POST /v1/documents/lookup (the request-body variant) for a sensitive field instead. Results are paginated: set `limit` for the page size and feed the returned `nextCursor` back as `startFrom` to fetch the next page. The response is a `{data, nextCursor}` envelope. Requires the `documents:r` scope.
4982
5003
  *
4983
5004
  * @param {Vectros.LookupDocumentsRequest} request
4984
5005
  * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -5273,12 +5294,13 @@ var DocumentsClient = class {
5273
5294
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/documents/{id}/versions");
5274
5295
  }
5275
5296
  /**
5276
- * Starts a file-based document by returning a short-lived presigned S3 PUT URL. Upload the file bytes directly to `uploadUrl`; the document is then automatically queued for text extraction and asynchronous indexing. Requires the `documents:c` scope.
5297
+ * Starts a file-based document by returning a short-lived presigned S3 PUT URL. Upload the file bytes directly to `uploadUrl`; the document is then automatically queued for text extraction and asynchronous indexing. Supplying an `externalId` makes this idempotent — re-initiating an upload with the same `externalId` re-issues a fresh presigned URL to the SAME existing document/object (so a re-upload inherently replaces the file body) rather than creating a duplicate. The response's `created` field (and the HTTP status — 201 when a new document was minted, 200 when an existing one was matched) tells the two apart. With `?upsert=true`, the submitted `payload`/`title` are also applied to the matched document (file-body divergence cannot be diffed at upload-init — the bytes have not arrived yet — so the re-upload itself replaces the body; `?upsert=true` requires the `documents:u` scope). Requires the `documents:c` scope.
5277
5298
  *
5278
5299
  * @param {Vectros.FileUploadRequest} request
5279
5300
  * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
5280
5301
  *
5281
5302
  * @throws {@link Vectros.BadRequestError}
5303
+ * @throws {@link Vectros.ForbiddenError}
5282
5304
  * @throws {@link Vectros.TooManyRequestsError}
5283
5305
  *
5284
5306
  * @example
@@ -5291,6 +5313,10 @@ var DocumentsClient = class {
5291
5313
  return HttpResponsePromise.fromPromise(this.__uploadDocument(request, requestOptions));
5292
5314
  }
5293
5315
  async __uploadDocument(request, requestOptions) {
5316
+ const { upsert, ..._body } = request;
5317
+ const _queryParams = {
5318
+ upsert
5319
+ };
5294
5320
  const _authRequest = await this._options.authProvider.getAuthRequest();
5295
5321
  const _headers = mergeHeaders(
5296
5322
  _authRequest.headers,
@@ -5305,9 +5331,9 @@ var DocumentsClient = class {
5305
5331
  method: "POST",
5306
5332
  headers: _headers,
5307
5333
  contentType: "application/json",
5308
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
5334
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
5309
5335
  requestType: "json",
5310
- body: request,
5336
+ body: _body,
5311
5337
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
5312
5338
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
5313
5339
  abortSignal: requestOptions?.abortSignal,
@@ -5321,6 +5347,8 @@ var DocumentsClient = class {
5321
5347
  switch (_response.error.statusCode) {
5322
5348
  case 400:
5323
5349
  throw new BadRequestError(_response.error.body, _response.rawResponse);
5350
+ case 403:
5351
+ throw new ForbiddenError(_response.error.body, _response.rawResponse);
5324
5352
  case 429:
5325
5353
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
5326
5354
  default:
@@ -5399,23 +5427,30 @@ var FoldersClient = class {
5399
5427
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/folders");
5400
5428
  }
5401
5429
  /**
5402
- * Creates a folder to organize your documents and records. If `parentFolderId` is omitted, the folder is created under your context's default root folder. Requires the `folders:c` scope.
5430
+ * Creates a folder to organize your documents and records. If `parentFolderId` is omitted, the folder is created under your context's default root folder. Folder creation is idempotent by (slug + parent): if a folder with the same slug already exists under the same parent, that existing folder is returned unchanged instead of a duplicate being created. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing folder was returned) tells the two apart. To overwrite an existing folder's mutable fields instead of returning it unchanged, set `?upsert=true` (this also requires the `folders:u` scope). Requires the `folders:c` scope.
5403
5431
  *
5404
- * @param {Vectros.FolderRequest} request
5432
+ * @param {Vectros.CreateFolderRequest} request
5405
5433
  * @param {FoldersClient.RequestOptions} requestOptions - Request-specific configuration.
5406
5434
  *
5407
5435
  * @throws {@link Vectros.BadRequestError}
5436
+ * @throws {@link Vectros.ForbiddenError}
5408
5437
  * @throws {@link Vectros.TooManyRequestsError}
5409
5438
  *
5410
5439
  * @example
5411
5440
  * await client.folders.createFolder({
5412
- * name: "Patient Records 2024"
5441
+ * body: {
5442
+ * name: "Patient Records 2024"
5443
+ * }
5413
5444
  * })
5414
5445
  */
5415
5446
  createFolder(request, requestOptions) {
5416
5447
  return HttpResponsePromise.fromPromise(this.__createFolder(request, requestOptions));
5417
5448
  }
5418
5449
  async __createFolder(request, requestOptions) {
5450
+ const { upsert, body: _body } = request;
5451
+ const _queryParams = {
5452
+ upsert
5453
+ };
5419
5454
  const _authRequest = await this._options.authProvider.getAuthRequest();
5420
5455
  const _headers = mergeHeaders(
5421
5456
  _authRequest.headers,
@@ -5430,9 +5465,9 @@ var FoldersClient = class {
5430
5465
  method: "POST",
5431
5466
  headers: _headers,
5432
5467
  contentType: "application/json",
5433
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
5468
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
5434
5469
  requestType: "json",
5435
- body: request,
5470
+ body: _body,
5436
5471
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
5437
5472
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
5438
5473
  abortSignal: requestOptions?.abortSignal,
@@ -5446,6 +5481,8 @@ var FoldersClient = class {
5446
5481
  switch (_response.error.statusCode) {
5447
5482
  case 400:
5448
5483
  throw new BadRequestError(_response.error.body, _response.rawResponse);
5484
+ case 403:
5485
+ throw new ForbiddenError(_response.error.body, _response.rawResponse);
5449
5486
  case 429:
5450
5487
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
5451
5488
  default:
@@ -5854,23 +5891,30 @@ var IdentityClient = class {
5854
5891
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/clients");
5855
5892
  }
5856
5893
  /**
5857
- * Creates a new client identity in your account. This call is idempotent on `externalId`: if a client with the same `externalId` already exists, the existing record is returned instead of creating a duplicate. Requires the `clients:c` scope.
5894
+ * Creates a new client identity in your account. This call is idempotent on `externalId`: if a client with the same `externalId` already exists, the existing record is returned instead of creating a duplicate. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing client was returned) tells the two apart. To overwrite an existing client's content instead of returning it unchanged, set `?upsert=true` (this also requires the `clients:u` scope). Requires the `clients:c` scope.
5858
5895
  *
5859
- * @param {Vectros.ClientRequest} request
5896
+ * @param {Vectros.CreateClientRequest} request
5860
5897
  * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
5861
5898
  *
5862
5899
  * @throws {@link Vectros.BadRequestError}
5900
+ * @throws {@link Vectros.ForbiddenError}
5863
5901
  * @throws {@link Vectros.TooManyRequestsError}
5864
5902
  *
5865
5903
  * @example
5866
5904
  * await client.identity.createClient({
5867
- * externalId: "patient_789"
5905
+ * body: {
5906
+ * externalId: "patient_789"
5907
+ * }
5868
5908
  * })
5869
5909
  */
5870
5910
  createClient(request, requestOptions) {
5871
5911
  return HttpResponsePromise.fromPromise(this.__createClient(request, requestOptions));
5872
5912
  }
5873
5913
  async __createClient(request, requestOptions) {
5914
+ const { upsert, body: _body } = request;
5915
+ const _queryParams = {
5916
+ upsert
5917
+ };
5874
5918
  const _authRequest = await this._options.authProvider.getAuthRequest();
5875
5919
  const _headers = mergeHeaders(
5876
5920
  _authRequest.headers,
@@ -5885,9 +5929,9 @@ var IdentityClient = class {
5885
5929
  method: "POST",
5886
5930
  headers: _headers,
5887
5931
  contentType: "application/json",
5888
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
5932
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
5889
5933
  requestType: "json",
5890
- body: request,
5934
+ body: _body,
5891
5935
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
5892
5936
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
5893
5937
  abortSignal: requestOptions?.abortSignal,
@@ -5901,6 +5945,8 @@ var IdentityClient = class {
5901
5945
  switch (_response.error.statusCode) {
5902
5946
  case 400:
5903
5947
  throw new BadRequestError(_response.error.body, _response.rawResponse);
5948
+ case 403:
5949
+ throw new ForbiddenError(_response.error.body, _response.rawResponse);
5904
5950
  case 429:
5905
5951
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
5906
5952
  default:
@@ -6289,23 +6335,30 @@ var IdentityClient = class {
6289
6335
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/orgs");
6290
6336
  }
6291
6337
  /**
6292
- * Creates a new organization in your account. This call is idempotent on `externalId`: if an organization with the same `externalId` already exists, the existing record is returned instead of creating a duplicate. Requires the `orgs:c` scope.
6338
+ * Creates a new organization in your account. This call is idempotent on `externalId`: if an organization with the same `externalId` already exists, the existing record is returned instead of creating a duplicate. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing organization was returned) tells the two apart. To overwrite an existing organization's content instead of returning it unchanged, set `?upsert=true` (this also requires the `orgs:u` scope). Requires the `orgs:c` scope.
6293
6339
  *
6294
- * @param {Vectros.OrgRequest} request
6340
+ * @param {Vectros.CreateOrgRequest} request
6295
6341
  * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
6296
6342
  *
6297
6343
  * @throws {@link Vectros.BadRequestError}
6344
+ * @throws {@link Vectros.ForbiddenError}
6298
6345
  * @throws {@link Vectros.TooManyRequestsError}
6299
6346
  *
6300
6347
  * @example
6301
6348
  * await client.identity.createOrg({
6302
- * externalId: "clinic_001"
6349
+ * body: {
6350
+ * externalId: "clinic_001"
6351
+ * }
6303
6352
  * })
6304
6353
  */
6305
6354
  createOrg(request, requestOptions) {
6306
6355
  return HttpResponsePromise.fromPromise(this.__createOrg(request, requestOptions));
6307
6356
  }
6308
6357
  async __createOrg(request, requestOptions) {
6358
+ const { upsert, body: _body } = request;
6359
+ const _queryParams = {
6360
+ upsert
6361
+ };
6309
6362
  const _authRequest = await this._options.authProvider.getAuthRequest();
6310
6363
  const _headers = mergeHeaders(
6311
6364
  _authRequest.headers,
@@ -6320,9 +6373,9 @@ var IdentityClient = class {
6320
6373
  method: "POST",
6321
6374
  headers: _headers,
6322
6375
  contentType: "application/json",
6323
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
6376
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
6324
6377
  requestType: "json",
6325
- body: request,
6378
+ body: _body,
6326
6379
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
6327
6380
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
6328
6381
  abortSignal: requestOptions?.abortSignal,
@@ -6336,6 +6389,8 @@ var IdentityClient = class {
6336
6389
  switch (_response.error.statusCode) {
6337
6390
  case 400:
6338
6391
  throw new BadRequestError(_response.error.body, _response.rawResponse);
6392
+ case 403:
6393
+ throw new ForbiddenError(_response.error.body, _response.rawResponse);
6339
6394
  case 429:
6340
6395
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
6341
6396
  default:
@@ -6710,23 +6765,30 @@ var IdentityClient = class {
6710
6765
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/users");
6711
6766
  }
6712
6767
  /**
6713
- * Creates a user identity in your account. The operation is idempotent on `externalId`: if a user with the same `externalId` already exists, the existing record is returned instead of creating a duplicate. Requires the `users:c` scope.
6768
+ * Creates a user identity in your account. The operation is idempotent on `externalId`: if a user with the same `externalId` already exists, the existing record is returned instead of creating a duplicate. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing user was returned) tells the two apart. To overwrite an existing user's mutable fields (email, status, payload, schema binding) instead of returning it unchanged, set `?upsert=true` (this also requires the `users:u` scope). Requires the `users:c` scope.
6714
6769
  *
6715
- * @param {Vectros.UserRequest} request
6770
+ * @param {Vectros.CreateUserRequest} request
6716
6771
  * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
6717
6772
  *
6718
6773
  * @throws {@link Vectros.BadRequestError}
6774
+ * @throws {@link Vectros.ForbiddenError}
6719
6775
  * @throws {@link Vectros.TooManyRequestsError}
6720
6776
  *
6721
6777
  * @example
6722
6778
  * await client.identity.createUser({
6723
- * externalId: "usr_12345"
6779
+ * body: {
6780
+ * externalId: "usr_12345"
6781
+ * }
6724
6782
  * })
6725
6783
  */
6726
6784
  createUser(request, requestOptions) {
6727
6785
  return HttpResponsePromise.fromPromise(this.__createUser(request, requestOptions));
6728
6786
  }
6729
6787
  async __createUser(request, requestOptions) {
6788
+ const { upsert, body: _body } = request;
6789
+ const _queryParams = {
6790
+ upsert
6791
+ };
6730
6792
  const _authRequest = await this._options.authProvider.getAuthRequest();
6731
6793
  const _headers = mergeHeaders(
6732
6794
  _authRequest.headers,
@@ -6741,9 +6803,9 @@ var IdentityClient = class {
6741
6803
  method: "POST",
6742
6804
  headers: _headers,
6743
6805
  contentType: "application/json",
6744
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
6806
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
6745
6807
  requestType: "json",
6746
- body: request,
6808
+ body: _body,
6747
6809
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
6748
6810
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
6749
6811
  abortSignal: requestOptions?.abortSignal,
@@ -6757,6 +6819,8 @@ var IdentityClient = class {
6757
6819
  switch (_response.error.statusCode) {
6758
6820
  case 400:
6759
6821
  throw new BadRequestError(_response.error.body, _response.rawResponse);
6822
+ case 403:
6823
+ throw new ForbiddenError(_response.error.body, _response.rawResponse);
6760
6824
  case 429:
6761
6825
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
6762
6826
  default:
@@ -7574,9 +7638,9 @@ var RecordsClient = class {
7574
7638
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/records");
7575
7639
  }
7576
7640
  /**
7577
- * Creates a new record of a given type. The `payload` is validated against that type's schema before the record is stored. Identify the type by sending `typeName`, `schemaId`, or both (they must agree); if you send only `schemaId`, the type is taken from that schema. Optionally supply an `externalId` to make the create idempotent — if a record with the same `externalId` already exists in your context, that existing record is returned unchanged instead of a duplicate being created. Requires the `records:c:<type>` scope.
7641
+ * Creates a new record of a given type. The `payload` is validated against that type's schema before the record is stored. Identify the type by sending `typeName`, `schemaId`, or both (they must agree); if you send only `schemaId`, the type is taken from that schema. Optionally supply an `externalId` to make the create idempotent — if a record with the same `externalId` already exists in your context, that existing record is returned unchanged instead of a duplicate being created. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing record was returned) tells the two apart. To overwrite an existing record's content instead of returning it unchanged, set `?upsert=true` (this also requires the `records:u:<type>` scope). Requires the `records:c:<type>` scope.
7578
7642
  *
7579
- * @param {Vectros.RecordRequest} request
7643
+ * @param {Vectros.CreateRecordRequest} request
7580
7644
  * @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
7581
7645
  *
7582
7646
  * @throws {@link Vectros.BadRequestError}
@@ -7585,19 +7649,25 @@ var RecordsClient = class {
7585
7649
  *
7586
7650
  * @example
7587
7651
  * await client.records.createRecord({
7588
- * typeName: "intake_form",
7589
- * schemaId: "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
7590
- * payload: {
7591
- * "first_name": "Jane",
7592
- * "email": "jane@example.com"
7593
- * },
7594
- * folderId: "f47ac10b-58cc-4372-a567-0e02b2c3d479"
7652
+ * body: {
7653
+ * typeName: "intake_form",
7654
+ * schemaId: "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
7655
+ * payload: {
7656
+ * "first_name": "Jane",
7657
+ * "email": "jane@example.com"
7658
+ * },
7659
+ * folderId: "f47ac10b-58cc-4372-a567-0e02b2c3d479"
7660
+ * }
7595
7661
  * })
7596
7662
  */
7597
7663
  createRecord(request, requestOptions) {
7598
7664
  return HttpResponsePromise.fromPromise(this.__createRecord(request, requestOptions));
7599
7665
  }
7600
7666
  async __createRecord(request, requestOptions) {
7667
+ const { upsert, body: _body } = request;
7668
+ const _queryParams = {
7669
+ upsert
7670
+ };
7601
7671
  const _authRequest = await this._options.authProvider.getAuthRequest();
7602
7672
  const _headers = mergeHeaders(
7603
7673
  _authRequest.headers,
@@ -7612,9 +7682,9 @@ var RecordsClient = class {
7612
7682
  method: "POST",
7613
7683
  headers: _headers,
7614
7684
  contentType: "application/json",
7615
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
7685
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
7616
7686
  requestType: "json",
7617
- body: request,
7687
+ body: _body,
7618
7688
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
7619
7689
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
7620
7690
  abortSignal: requestOptions?.abortSignal,
@@ -8210,43 +8280,50 @@ var SchemasClient = class {
8210
8280
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/schemas");
8211
8281
  }
8212
8282
  /**
8213
- * Defines a new record type with optional field definitions, validation rules, and lookup indexes. Idempotent by `typeName` within the same ownership scope: re-creating an existing `typeName` returns the existing schema rather than failing. Requires the `schemas:w` scope.
8283
+ * Defines a new record type with optional field definitions, validation rules, and lookup indexes. Idempotent by `typeName` within the same ownership scope: re-creating an existing `typeName` returns the existing schema rather than failing. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing schema was returned) tells the two apart. To reconcile an existing schema to the submitted shape instead of returning it unchanged, set `?upsert=true` (this also requires the `schemas:w` scope; only legal schema changes are applied — migration-locked changes are rejected). Requires the `schemas:w` scope.
8214
8284
  *
8215
- * @param {Vectros.SchemaRequest} request
8285
+ * @param {Vectros.CreateSchemaRequest} request
8216
8286
  * @param {SchemasClient.RequestOptions} requestOptions - Request-specific configuration.
8217
8287
  *
8218
8288
  * @throws {@link Vectros.BadRequestError}
8289
+ * @throws {@link Vectros.ForbiddenError}
8219
8290
  * @throws {@link Vectros.TooManyRequestsError}
8220
8291
  *
8221
8292
  * @example
8222
8293
  * await client.schemas.createSchema({
8223
- * typeName: "intake_form",
8224
- * displayName: "Client Intake Form",
8225
- * description: "Captures initial client information",
8226
- * fields: [{
8227
- * fieldId: "first_name",
8228
- * fieldType: "string",
8229
- * required: true,
8230
- * searchable: true
8231
- * }, {
8232
- * fieldId: "email",
8233
- * fieldType: "string",
8234
- * required: true
8235
- * }],
8236
- * lookupFields: [{
8237
- * fieldName: "email",
8238
- * unique: true
8239
- * }],
8240
- * capabilities: {
8241
- * "auditHistory": true
8242
- * },
8243
- * allowedSurfaces: ["record"]
8294
+ * body: {
8295
+ * typeName: "intake_form",
8296
+ * displayName: "Client Intake Form",
8297
+ * description: "Captures initial client information",
8298
+ * fields: [{
8299
+ * fieldId: "first_name",
8300
+ * fieldType: "string",
8301
+ * required: true,
8302
+ * searchable: true
8303
+ * }, {
8304
+ * fieldId: "email",
8305
+ * fieldType: "string",
8306
+ * required: true
8307
+ * }],
8308
+ * lookupFields: [{
8309
+ * fieldName: "email",
8310
+ * unique: true
8311
+ * }],
8312
+ * capabilities: {
8313
+ * "auditHistory": true
8314
+ * },
8315
+ * allowedSurfaces: ["record"]
8316
+ * }
8244
8317
  * })
8245
8318
  */
8246
8319
  createSchema(request, requestOptions) {
8247
8320
  return HttpResponsePromise.fromPromise(this.__createSchema(request, requestOptions));
8248
8321
  }
8249
8322
  async __createSchema(request, requestOptions) {
8323
+ const { upsert, body: _body } = request;
8324
+ const _queryParams = {
8325
+ upsert
8326
+ };
8250
8327
  const _authRequest = await this._options.authProvider.getAuthRequest();
8251
8328
  const _headers = mergeHeaders(
8252
8329
  _authRequest.headers,
@@ -8261,9 +8338,9 @@ var SchemasClient = class {
8261
8338
  method: "POST",
8262
8339
  headers: _headers,
8263
8340
  contentType: "application/json",
8264
- queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
8341
+ queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
8265
8342
  requestType: "json",
8266
- body: request,
8343
+ body: _body,
8267
8344
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
8268
8345
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
8269
8346
  abortSignal: requestOptions?.abortSignal,
@@ -8277,6 +8354,8 @@ var SchemasClient = class {
8277
8354
  switch (_response.error.statusCode) {
8278
8355
  case 400:
8279
8356
  throw new BadRequestError(_response.error.body, _response.rawResponse);
8357
+ case 403:
8358
+ throw new ForbiddenError(_response.error.body, _response.rawResponse);
8280
8359
  case 429:
8281
8360
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
8282
8361
  default:
@@ -8711,8 +8790,8 @@ function warnOnSuboptimalKey(key, log) {
8711
8790
 
8712
8791
  // src/build-info.ts
8713
8792
  var BUILD_INFO = {
8714
- mcpServer: true ? "0.5.2" : "dev",
8715
- sdk: true ? "0.30.0" : "dev"
8793
+ mcpServer: true ? "0.5.3" : "dev",
8794
+ sdk: true ? "0.31.0" : "dev"
8716
8795
  };
8717
8796
 
8718
8797
  // src/log.ts
@@ -9212,15 +9291,17 @@ var recordCreate = ({ client, log }) => ({
9212
9291
  const type = args.type;
9213
9292
  try {
9214
9293
  const created = await client.records.createRecord({
9215
- typeName: type,
9216
- payload: args.fields,
9217
- externalId: args.externalId,
9218
- indexMode: args.indexMode,
9219
- status: args.status,
9220
- folderId: args.folderId,
9221
- userId: args.userId,
9222
- orgId: args.orgId,
9223
- clientId: args.clientId
9294
+ body: {
9295
+ typeName: type,
9296
+ payload: args.fields,
9297
+ externalId: args.externalId,
9298
+ indexMode: args.indexMode,
9299
+ status: args.status,
9300
+ folderId: args.folderId,
9301
+ userId: args.userId,
9302
+ orgId: args.orgId,
9303
+ clientId: args.clientId
9304
+ }
9224
9305
  });
9225
9306
  log.debug({ tool: "record_create", type, id: created.id }, "record_create ok");
9226
9307
  return { content: [{ type: "text", text: JSON.stringify(created, null, 2) }] };
@@ -9862,13 +9943,15 @@ var folderCreate = ({ client, log }) => ({
9862
9943
  handler: async (args) => {
9863
9944
  try {
9864
9945
  const folder = await client.folders.createFolder({
9865
- name: args.name,
9866
- description: args.description,
9867
- parentFolderId: args.parentId,
9868
- slug: args.slug,
9869
- userId: args.userId,
9870
- orgId: args.orgId,
9871
- clientId: args.clientId
9946
+ body: {
9947
+ name: args.name,
9948
+ description: args.description,
9949
+ parentFolderId: args.parentId,
9950
+ slug: args.slug,
9951
+ userId: args.userId,
9952
+ orgId: args.orgId,
9953
+ clientId: args.clientId
9954
+ }
9872
9955
  });
9873
9956
  log.debug({ tool: "folder_create", id: folder.id, name: folder.name }, "folder_create ok");
9874
9957
  return { content: [{ type: "text", text: JSON.stringify(folder, null, 2) }] };
@@ -10122,11 +10205,13 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
10122
10205
  if (text) {
10123
10206
  const storeText = args.storeText ?? true;
10124
10207
  const result = await client.documents.ingestDocument({
10125
- title,
10126
- text,
10127
- indexMode,
10128
- storeText,
10129
- ...common
10208
+ body: {
10209
+ title,
10210
+ text,
10211
+ indexMode,
10212
+ storeText,
10213
+ ...common
10214
+ }
10130
10215
  });
10131
10216
  log.debug(
10132
10217
  { tool: "document_ingest", mode: "text", id: result?.id, indexMode },