@vectros-ai/mcp-server 0.15.0 → 0.16.1

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/cli-http.mjs CHANGED
@@ -2492,7 +2492,7 @@ var AuthClient = class {
2492
2492
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/admin/keys/scoped");
2493
2493
  }
2494
2494
  /**
2495
- * Creates a scoped API key (an `ssk_*` secret) that inherits its permissions from an existing access profile in your account. The call is idempotent on the combination of tenant, context, user, and key name: re-issuing the same request returns the existing key WITHOUT re-disclosing its raw secret. The raw key is returned ONLY in this response — store it securely, as it cannot be retrieved again. Requires the `keys:c` scope. If you use a scoped credential, `keys:c` alone is not sufficient: because the minted key is durably bound to the profile you name, the profile's effective scopes may not exceed your own, and you may only mint against a profile whose `identityOverrides` values your own identity holds. A root API key (`sk_`) is exempt from both bounds.
2495
+ * Creates a scoped API key (an `ssk_*` secret) that inherits its permissions from an existing access profile in your account. The call is idempotent on the combination of tenant, context, user, and key name: re-issuing the same request returns the existing key WITHOUT re-disclosing its raw secret. The raw key is returned ONLY in this response — store it securely, as it cannot be retrieved again. Requires the `keys:c` scope. If you use a scoped credential, `keys:c` alone is not sufficient: because the minted key is durably bound to the profile you name, the profile's effective scopes may not exceed your own, and you may only mint against a profile whose `identityOverrides` values your own identity holds. Minting a key bound to your OWN principal needs nothing further; minting one bound to a DIFFERENT principal additionally requires the `delegate-mint` capability (`granted_capabilities`) on your credential — without it the request is refused. A root API key (`sk_`) is exempt from all three bounds.
2496
2496
  *
2497
2497
  * @param {Vectros.CreateScopedKeyRequest} request
2498
2498
  * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -3988,7 +3988,7 @@ var AuthClient = class {
3988
3988
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/usage");
3989
3989
  }
3990
3990
  /**
3991
- * Retrieves a single registered issuer by issuerId. Requires a root API key or the bootstrap's provisioning capability. A credential confined to one app context sees only an issuer registered in that context; naming one registered in another context returns 404, identically to a nonexistent issuerId. A root API key sees every context.
3991
+ * Retrieves a single registered issuer by issuerId. Requires a root API key or the bootstrap's provisioning capability. A credential confined to one app context sees only an issuer registered in that context; naming one registered in another context returns 404, identically to a nonexistent issuerId. A root API key sees every context. An ordinary bootstrap credential that didn't specify a context resolves to the `default` app context specifically, not every context — so this call returns 404 for an issuer registered under any other context unless you re-minted the bootstrap token pinned to that context.
3992
3992
  *
3993
3993
  * @param {Vectros.GetIssuerRequest} request
3994
3994
  * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -4045,6 +4045,73 @@ var AuthClient = class {
4045
4045
  }
4046
4046
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/auth/issuers/{issuerId}");
4047
4047
  }
4048
+ /**
4049
+ * Updates the mutable fields of a registered issuer: `subClaim`, `emailClaim`, `status` (`active`/`suspended` — a suspended issuer's tokens are rejected identically to an unregistered issuer at exchange time), and `selfSignupPolicies`. Fields omitted from the body are left unchanged (partial update). `issuer`, `jwksUri`, `audience`, and `contextId` are trust-anchor / routing-pin fields and are immutable via this route — supplying a value that differs from the current registration is rejected with 400; supplying the current value back is a no-op. Rotating a trust anchor requires deleting and re-registering the issuer, which is itself refused while any user is bound through it. Requires a root API key or the bootstrap's provisioning capability, gated identically to every other operation on this surface. A credential confined to one app context may only update an issuer registered in that context; naming one registered in another context returns 404, identically to a nonexistent issuerId. A root API key may update any issuer.
4050
+ *
4051
+ * @param {Vectros.IssuerUpdateRequest} request
4052
+ * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
4053
+ *
4054
+ * @throws {@link Vectros.BadRequestError}
4055
+ * @throws {@link Vectros.ForbiddenError}
4056
+ * @throws {@link Vectros.NotFoundError}
4057
+ * @throws {@link Vectros.TooManyRequestsError}
4058
+ *
4059
+ * @example
4060
+ * await client.auth.updateIssuer({
4061
+ * issuerId: "auth0-prod"
4062
+ * })
4063
+ */
4064
+ updateIssuer(request, requestOptions) {
4065
+ return HttpResponsePromise.fromPromise(this.__updateIssuer(request, requestOptions));
4066
+ }
4067
+ async __updateIssuer(request, requestOptions) {
4068
+ const { issuerId, ..._body } = request;
4069
+ const _authRequest = await this._options.authProvider.getAuthRequest();
4070
+ const _headers = mergeHeaders(
4071
+ _authRequest.headers,
4072
+ this._options?.headers,
4073
+ requestOptions?.headers
4074
+ );
4075
+ const _response = await fetcher({
4076
+ url: url_exports.join(
4077
+ await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
4078
+ `v1/auth/issuers/${url_exports.encodePathParam(issuerId)}`
4079
+ ),
4080
+ method: "PUT",
4081
+ headers: _headers,
4082
+ contentType: "application/json",
4083
+ queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
4084
+ requestType: "json",
4085
+ body: _body,
4086
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
4087
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
4088
+ abortSignal: requestOptions?.abortSignal,
4089
+ fetchFn: this._options?.fetch,
4090
+ logging: this._options.logging
4091
+ });
4092
+ if (_response.ok) {
4093
+ return { data: _response.body, rawResponse: _response.rawResponse };
4094
+ }
4095
+ if (_response.error.reason === "status-code") {
4096
+ switch (_response.error.statusCode) {
4097
+ case 400:
4098
+ throw new BadRequestError(_response.error.body, _response.rawResponse);
4099
+ case 403:
4100
+ throw new ForbiddenError(_response.error.body, _response.rawResponse);
4101
+ case 404:
4102
+ throw new NotFoundError(_response.error.body, _response.rawResponse);
4103
+ case 429:
4104
+ throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
4105
+ default:
4106
+ throw new VectrosError({
4107
+ statusCode: _response.error.statusCode,
4108
+ body: _response.error.body,
4109
+ rawResponse: _response.rawResponse
4110
+ });
4111
+ }
4112
+ }
4113
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v1/auth/issuers/{issuerId}");
4114
+ }
4048
4115
  /**
4049
4116
  * Deregisters a trusted third-party IdP issuer. Requires a root API key or the bootstrap's provisioning capability. A credential confined to one app context may only deregister an issuer registered in that context; naming one registered in another context returns 404, identically to a nonexistent issuerId. A root API key may deregister any issuer. Refused if any user account was ever created or matched via this issuer (by a prior self-signup or accepted invite, through `POST /v1/auth/token/exchange`) — that access cannot be silently orphaned. Deactivate the affected users first if you intend to cut off their access, or register a replacement issuer before removing this one. An issuer that has never been used for an exchange (no bound users yet) can always be deregistered.
4050
4117
  *
@@ -4115,7 +4182,7 @@ var AuthClient = class {
4115
4182
  );
4116
4183
  }
4117
4184
  /**
4118
- * Returns the issuers registered in your tenant. Requires a root API key or the bootstrap's provisioning capability. A credential confined to one app context sees only the issuers registered in that context; a root API key sees every context. Returns a `{data, nextCursor}` envelope.
4185
+ * Returns the issuers registered in your tenant. Requires a root API key or the bootstrap's provisioning capability. A credential confined to one app context sees only the issuers registered in that context; a root API key sees every context. An ordinary bootstrap credential that didn't specify a context resolves to the `default` app context specifically, not every context — so this call returns an empty page for a tenant whose issuers are all registered under a different context unless you re-minted the bootstrap token pinned to that context. Returns a `{data, nextCursor}` envelope.
4119
4186
  *
4120
4187
  * @param {Vectros.ListIssuersRequest} request
4121
4188
  * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -4172,7 +4239,7 @@ var AuthClient = class {
4172
4239
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/auth/issuers");
4173
4240
  }
4174
4241
  /**
4175
- * Registers a trusted third-party IdP issuer that BYO-IdP token exchange (`POST /v1/auth/token/exchange`) may accept a `subject_token` from. Requires a root API key or the CLI bootstrap's provisioning capability — never an ordinary partner-grantable scope. Idempotent by `issuerId` within your tenant; the `(issuer, audience)` pair must not already be registered by a different issuerId/tenant. An app context may have at most one active issuer — deregister the existing one first if you need to replace it. One issuer MAY serve several contexts today, each via its own registration row with a distinct `audience`.
4242
+ * Registers a trusted third-party IdP issuer that BYO-IdP token exchange (`POST /v1/auth/token/exchange`) may accept a `subject_token` from. Requires a root API key or the CLI bootstrap's provisioning capability — never an ordinary partner-grantable scope. A credential authorized only via the provisioning capability may register only against the app context it is bound to; naming a different one returns 403. A root API key is unaffected and may register against any of its contexts. Idempotent by `issuerId` within your tenant; the `(issuer, audience)` pair must not already be registered by a different issuerId/tenant. If `issuerId` collides with a registration owned by a different app context than the one you're confined to, the request fails with 400 rather than returning that context's configuration. An app context may have at most one active issuer — deregister the existing one first if you need to replace it. One issuer MAY serve several contexts today, each via its own registration row with a distinct `audience`.
4176
4243
  *
4177
4244
  * @param {Vectros.IssuerRequest} request
4178
4245
  * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -4357,6 +4424,7 @@ var AuthClient = class {
4357
4424
  *
4358
4425
  * @throws {@link Vectros.BadRequestError}
4359
4426
  * @throws {@link Vectros.ForbiddenError}
4427
+ * @throws {@link Vectros.NotFoundError}
4360
4428
  * @throws {@link Vectros.TooManyRequestsError}
4361
4429
  *
4362
4430
  * @example
@@ -4410,6 +4478,8 @@ var AuthClient = class {
4410
4478
  throw new BadRequestError(_response.error.body, _response.rawResponse);
4411
4479
  case 403:
4412
4480
  throw new ForbiddenError(_response.error.body, _response.rawResponse);
4481
+ case 404:
4482
+ throw new NotFoundError(_response.error.body, _response.rawResponse);
4413
4483
  case 429:
4414
4484
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
4415
4485
  default:
@@ -4423,7 +4493,7 @@ var AuthClient = class {
4423
4493
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/auth/token");
4424
4494
  }
4425
4495
  /**
4426
- * Invite a new member to one of your app contexts by email. Creates a pending user with a pre-resolved access profile (their permissions on accept) and signs an invitation token. This call is idempotent on the combination of context and email: re-inviting the same email in the same context rotates the token and resends the invitation rather than creating a duplicate — this requires the `users:r` and `users:u` scopes in addition to `users:c`, because resending rotates a credential on an existing invitation and invalidates any link already sent. Without them the collision returns 409 instead, with no invitation details and no change to the outstanding invitation. Returns HTTP 201 on a new invite or a successful resend. Returns 409 if that email already belongs to an active or suspended member of the app context, or already has an identity elsewhere in your account (an email can currently belong to only one tenant per account, i.e. your test and live environments cannot share an email). When `sendEmail` is false, the response includes the raw token and a ready-to-use accept link so you can deliver the invitation through your own email provider. Requires the `users:c` scope.
4496
+ * Invite a new member to one of your app contexts by email, OR grant an existing member access to an additional app context by inviting their same email again. Idempotent on the combination of context and email: re-inviting the same email into the SAME context rotates the token and resends the invitation rather than creating a duplicate — this requires the `users:r` and `users:u` scopes in addition to `users:c`, because resending rotates a credential on an existing invitation and invalidates any link already sent. Without them the collision returns 409 instead, with no invitation details and no change to the outstanding invitation. Inviting the SAME email into a DIFFERENT app context in this tenant, where that email already resolves to an existing member: if that member is active AND already has (or, once accepted, will have) a credential that works for the new context's own identity provider, this immediately grants them access to the new context (no email is sent — there is nothing to accept, `emailSent` is false) — this additionally requires the `users:r` scope (no `users:u`, since nothing is mutated), because the response names the existing member's userId, a fact about them your credential could not otherwise learn through this endpoint. If that active member's ONLY existing credential is for a DIFFERENT identity provider than the one the new context uses, a normal, independent invitation is created instead (its own new member id, a real token/accept link) — attaching them silently would leave no way for them to ever actually sign in to that context. If the existing member's original invitation is still pending, this attaches the new context's access to that same outstanding invitation and rotates its token (`users:r`+`users:u`, same as an ordinary resend — both the disclosure and the credential rotation apply here). A SUSPENDED member's email does not get new-context access this way — reactivate them explicitly first. Returns HTTP 201 in every one of those cases. Returns 409 if that email already belongs to an active or suspended member of THIS specific app context, already has a PENDING invitation for THIS specific app context, or resolves to an existing member elsewhere in the tenant and your token lacks the additional scope the grant/attach requires (`users:r`, or `users:r`+`users:u` for the still-pending case). An email that already has an identity in your OTHER tenant (test vs. live) is not a collision either — it creates an additional, independent membership in this tenant for that same identity. When `sendEmail` is false, the response includes the raw token and a ready-to-use accept link so you can deliver the invitation through your own email provider. Requires the `users:c` scope — or, for a credential scoped to a single app context, the `member-lifecycle` capability plus the matching `profiles:c`/`profiles:r`/`profiles:u` grant(s) in that context, as an equally sufficient alternative to every `users:c`/`users:r`/`users:u` requirement in this description.
4427
4497
  *
4428
4498
  * @param {Vectros.CreateInviteRequest} request
4429
4499
  * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -4494,7 +4564,7 @@ var AuthClient = class {
4494
4564
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/users/invite");
4495
4565
  }
4496
4566
  /**
4497
- * Resend an outstanding invitation, identified by its email and app context. Rotates the invitation token and extends its expiry, then (when `sendEmail` is true) re-delivers the email. Rotating the token invalidates any previously issued link for this invitation, so only the newest link works. The invitee's pending permissions are left unchanged. Because this rotates a credential on an existing invitation, it requires the `users:c`, `users:r` and `users:u` scopes.
4567
+ * Resend an outstanding invitation, identified by its email and app context. Rotates the invitation token and extends its expiry, then (when `sendEmail` is true) re-delivers the email. Rotating the token invalidates any previously issued link for this invitation, so only the newest link works. The invitee's pending permissions are left unchanged. Because this rotates a credential on an existing invitation, it requires the `users:c`, `users:r` and `users:u` scopes — or, for a credential scoped to a single app context, the `member-lifecycle` capability plus the matching `profiles:c`/`profiles:r`/`profiles:u` grant(s) in that context.
4498
4568
  *
4499
4569
  * @param {Vectros.CreateInviteRequest} request
4500
4570
  * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -4561,6 +4631,83 @@ var AuthClient = class {
4561
4631
  }
4562
4632
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/users/invite/resend");
4563
4633
  }
4634
+ /**
4635
+ * Re-mints the presented `st_*` scoped token with one or more `identity.<namespace>` values changed — for a caller whose ROLE explicitly grants assuming those values (an invited hr-admin, a multi-org case-handler) and needs to change which value new writes place records under. The request body names one or more namespaces in canonical `scope:<namespace>` form, e.g. `{"scope:org": "orgB"}` — each value must be a plain literal, never a `${{ ... }}` placeholder. When you name MORE THAN ONE namespace, a single one of your roles must grant all of them together: the combination is never assembled from two different roles, because no role author would have vouched for it. `st_*`-only — a root API key or `ssk_*` scoped API key gets 403; neither needs this (root already has full authority, and an `ssk_*`'s identity shape is not what this resolves against).
4636
+ *
4637
+ * **Only an original token may assume.** A token produced BY this endpoint cannot assume again (403) — every assume starts from the token you exchanged for, so the identity you end up with is always one a single role explicitly granted rather than a combination reached by chaining calls. Keep your original token if you need to switch more than once, or exchange for a new one.
4638
+ *
4639
+ * **Entitlement is checked LIVE, against your roles as they are right now** — not against a copy frozen into your token when it was minted. The requested value must be explicitly granted by a role's `assumable` field for that namespace: a POINT check against the one value requested, and a deliberately separate, explicitly-authored question from what the role's `data_scope` permits reading or writing. Holding broad `data_scope` reach in a namespace does NOT by itself grant assuming any value in it.
4640
+ *
4641
+ * **What is preserved, and what is not.** Every clause of your token that does not reference a requested namespace is preserved verbatim, as are all other claims (`partner_user_id`, `context_id`, mint attribution). Clauses that DO reference a requested namespace are kept only if they come from a role that authorized the new value. A role that does not authorize it loses all of its clauses touching that namespace — including any scoped to the value you already held. Assume into a value one role grants and you keep that role's reach, not the reach of roles that never vouched for it.
4642
+ *
4643
+ * The re-minted token's `exp` is IDENTICAL to the presented token's — this call can never extend a session's life. A fresh, independently-revocable `jti` is stamped on every call, and (except when the presented token predates jti support and has none to chain from) the token also carries a `root_jti` revocation-lineage claim so revoking the token you started from closes every value ever assumed from it. Uses the ordinary Vectros `{"message":...}` error shape, not the OAuth envelope `POST /v1/auth/token/exchange` uses — this endpoint's caller is always Vectros-SDK code already holding a bearer token, never generic OAuth tooling.
4644
+ *
4645
+ * @param {Record<string, unknown>} request
4646
+ * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
4647
+ *
4648
+ * @throws {@link Vectros.BadRequestError}
4649
+ * @throws {@link Vectros.UnauthorizedError}
4650
+ * @throws {@link Vectros.ForbiddenError}
4651
+ * @throws {@link Vectros.ConflictError}
4652
+ * @throws {@link Vectros.TooManyRequestsError}
4653
+ *
4654
+ * @example
4655
+ * await client.auth.assumeToken({
4656
+ * "scope:org": "orgB"
4657
+ * })
4658
+ */
4659
+ assumeToken(request, requestOptions) {
4660
+ return HttpResponsePromise.fromPromise(this.__assumeToken(request, requestOptions));
4661
+ }
4662
+ async __assumeToken(request, requestOptions) {
4663
+ const _authRequest = await this._options.authProvider.getAuthRequest();
4664
+ const _headers = mergeHeaders(
4665
+ _authRequest.headers,
4666
+ this._options?.headers,
4667
+ requestOptions?.headers
4668
+ );
4669
+ const _response = await fetcher({
4670
+ url: url_exports.join(
4671
+ await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
4672
+ "v1/auth/token/assume"
4673
+ ),
4674
+ method: "POST",
4675
+ headers: _headers,
4676
+ contentType: "application/json",
4677
+ queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
4678
+ requestType: "json",
4679
+ body: request,
4680
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
4681
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
4682
+ abortSignal: requestOptions?.abortSignal,
4683
+ fetchFn: this._options?.fetch,
4684
+ logging: this._options.logging
4685
+ });
4686
+ if (_response.ok) {
4687
+ return { data: _response.body, rawResponse: _response.rawResponse };
4688
+ }
4689
+ if (_response.error.reason === "status-code") {
4690
+ switch (_response.error.statusCode) {
4691
+ case 400:
4692
+ throw new BadRequestError(_response.error.body, _response.rawResponse);
4693
+ case 401:
4694
+ throw new UnauthorizedError(_response.error.body, _response.rawResponse);
4695
+ case 403:
4696
+ throw new ForbiddenError(_response.error.body, _response.rawResponse);
4697
+ case 409:
4698
+ throw new ConflictError(_response.error.body, _response.rawResponse);
4699
+ case 429:
4700
+ throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
4701
+ default:
4702
+ throw new VectrosError({
4703
+ statusCode: _response.error.statusCode,
4704
+ body: _response.error.body,
4705
+ rawResponse: _response.rawResponse
4706
+ });
4707
+ }
4708
+ }
4709
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/auth/token/assume");
4710
+ }
4564
4711
  /**
4565
4712
  * RFC 8693 OAuth 2.0 Token Exchange. Trades a JWT issued by a third-party identity provider you've registered (`POST /v1/auth/issuers`) for a Vectros `st_*` scoped bearer token — no Vectros credential required to call this endpoint. The exchanged token's scope is resolved entirely server-side from the matched user's access profile; this endpoint accepts no caller-supplied scope, resource, or audience parameter (RFC 8693 §2.1's `resource`/`audience`/`scope` are not used in v1 — the registered `(issuer, audience)` pair alone pins the target tenant and app context). On a first-time login (no existing Vectros identity for this subject), two opt-in binding paths exist: `invite_token` (a `PENDING` sub-user invitation), and — if the registration declares one or more self-signup policies — `signup_type` (a brand-new user is created and bound to the policy's configured role). If `invite_token` is present at all, it is the ONLY path tried — a failed invite never falls through to self-signup. Neither field is required for a subject with an existing identity. If your issuer is registered against more than one app context (each via its own audience), `context_id` selects which one to target; omit it when your token's `aud` claim matches only one registered context — the common case, unaffected by this field. Uses the OAuth-standard error envelope (`{"error":..., "error_description":...}`, RFC 6749 §5.2), NOT this API's usual `{"message":...}` shape — its client is generic OAuth tooling, not the Vectros SDK.
4566
4713
  *
@@ -4638,9 +4785,9 @@ var ComplianceClient = class {
4638
4785
  * @param {Vectros.ErasureRequest} request
4639
4786
  * @param {ComplianceClient.RequestOptions} requestOptions - Request-specific configuration.
4640
4787
  *
4788
+ * @throws {@link Vectros.BadRequestError}
4641
4789
  * @throws {@link Vectros.ForbiddenError}
4642
4790
  * @throws {@link Vectros.TooManyRequestsError}
4643
- * @throws {@link Vectros.NotImplementedError}
4644
4791
  *
4645
4792
  * @example
4646
4793
  * await client.compliance.createErasureRequest({
@@ -4679,12 +4826,12 @@ var ComplianceClient = class {
4679
4826
  }
4680
4827
  if (_response.error.reason === "status-code") {
4681
4828
  switch (_response.error.statusCode) {
4829
+ case 400:
4830
+ throw new BadRequestError(_response.error.body, _response.rawResponse);
4682
4831
  case 403:
4683
4832
  throw new ForbiddenError(_response.error.body, _response.rawResponse);
4684
4833
  case 429:
4685
4834
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
4686
- case 501:
4687
- throw new NotImplementedError(_response.error.body, _response.rawResponse);
4688
4835
  default:
4689
4836
  throw new VectrosError({
4690
4837
  statusCode: _response.error.statusCode,
@@ -4703,7 +4850,6 @@ var ComplianceClient = class {
4703
4850
  *
4704
4851
  * @throws {@link Vectros.ForbiddenError}
4705
4852
  * @throws {@link Vectros.NotFoundError}
4706
- * @throws {@link Vectros.NotImplementedError}
4707
4853
  *
4708
4854
  * @example
4709
4855
  * await client.compliance.getErasureRequest({
@@ -4744,8 +4890,6 @@ var ComplianceClient = class {
4744
4890
  throw new ForbiddenError(_response.error.body, _response.rawResponse);
4745
4891
  case 404:
4746
4892
  throw new NotFoundError(_response.error.body, _response.rawResponse);
4747
- case 501:
4748
- throw new NotImplementedError(_response.error.body, _response.rawResponse);
4749
4893
  default:
4750
4894
  throw new VectrosError({
4751
4895
  statusCode: _response.error.statusCode,
@@ -5293,7 +5437,21 @@ var DocumentsClient = class {
5293
5437
  return HttpResponsePromise.fromPromise(this.__lookupDocuments(request, requestOptions));
5294
5438
  }
5295
5439
  async __lookupDocuments(request, requestOptions) {
5296
- const { type: type_, field, value, from: from_, to, prefix, startFrom, limit, order, userId, scope } = request;
5440
+ const {
5441
+ type: type_,
5442
+ field,
5443
+ value,
5444
+ from: from_,
5445
+ to,
5446
+ prefix,
5447
+ sortFrom,
5448
+ sortTo,
5449
+ startFrom,
5450
+ limit,
5451
+ order,
5452
+ userId,
5453
+ scope
5454
+ } = request;
5297
5455
  const _queryParams = {
5298
5456
  type: type_,
5299
5457
  field,
@@ -5301,6 +5459,8 @@ var DocumentsClient = class {
5301
5459
  from: from_,
5302
5460
  to,
5303
5461
  prefix,
5462
+ sortFrom,
5463
+ sortTo,
5304
5464
  startFrom,
5305
5465
  limit,
5306
5466
  order: order != null ? order : void 0,
@@ -6585,7 +6745,7 @@ var IdentityClient = class {
6585
6745
  );
6586
6746
  }
6587
6747
  /**
6588
- * Retrieves a single scope-namespace registration by name. The reserved built-ins `org` and `client` are always resolvable.
6748
+ * Retrieves a single scope-namespace registration by name.
6589
6749
  *
6590
6750
  * @param {Vectros.GetNamespaceRequest} request
6591
6751
  * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -6778,7 +6938,7 @@ var IdentityClient = class {
6778
6938
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v1/namespaces/{namespace}");
6779
6939
  }
6780
6940
  /**
6781
- * Returns the scope namespaces in your account, including `org` and `client`, which are provisioned for you when the account is created. Returns a `{data, nextCursor}` envelope.
6941
+ * Returns the scope namespaces registered in your account. Returns a `{data, nextCursor}` envelope.
6782
6942
  *
6783
6943
  * @param {Vectros.ListNamespacesRequest} request
6784
6944
  * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -6829,7 +6989,7 @@ var IdentityClient = class {
6829
6989
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/namespaces");
6830
6990
  }
6831
6991
  /**
6832
- * Registers a new scope namespace and declares whether its values resolve to identity entities (`entityBacked`). Also requires `specificityRank`, an explicit, account-unique position in the specificity order used to break recordType schema-resolution ties. Requires a root API key or the CLI bootstrap's provisioning capability — never an ordinary partner-grantable scope. `org` and `client` are provisioned when your account is created, so registering either returns the already-registered error.
6992
+ * Registers a new scope namespace and declares whether its values resolve to identity entities (`entityBacked`). Also requires `specificityRank`, an explicit, account-unique position in the specificity order used to break recordType schema-resolution ties. Requires a root API key or one of the CLI bootstrap's two provisioning capabilities — never an ordinary partner-grantable scope. A bootstrap credential's registration is confined to its own app context UNLESS it additionally holds the tenant-wide namespace-provisioning capability and `contextId` is omitted, in which case it may register a TENANT-WIDE namespace (visible to every context). `org` and `client` are reserved names, registered the same way as any other namespace.
6833
6993
  *
6834
6994
  * @param {Vectros.RegisterNamespaceRequest} request
6835
6995
  * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -6899,7 +7059,7 @@ var IdentityClient = class {
6899
7059
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/namespaces");
6900
7060
  }
6901
7061
  /**
6902
- * Returns a paginated list of the users in your account. Pass `externalId` to look up a single user by your own identifier. To filter on schema-declared lookup fields, supply `type` and `field` together with one lookup mode: `value` (exact match), `from`+`to` (range), or `prefix`. Requires the `users:r` scope.
7062
+ * Returns a paginated list of the users in your account. Pass `externalId` to look up a single user by your own identifier. To filter on schema-declared lookup fields, supply `type` and `field` together with one lookup mode: `value` (exact match), `from`+`to` (range), or `prefix`. Requires the `users:r` scope. A context-confined credential only sees users who hold an access profile in the credential's own app context — others are silently absent from the page, not an error.
6903
7063
  *
6904
7064
  * @param {Vectros.ListUsersRequest} request
6905
7065
  * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -6964,7 +7124,7 @@ var IdentityClient = class {
6964
7124
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/users");
6965
7125
  }
6966
7126
  /**
6967
- * 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 to create. Being returned the existing user on a collision is a read of that user's data and additionally requires the `users:r` scope — a credential holding `users:c` alone receives a `400` ("already exists") on collision instead of the user.
7127
+ * 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 to create. Being returned the existing user on a collision is a read of that user's data and additionally requires the `users:r` scope — a credential holding `users:c` alone receives a `400` ("already exists") on collision instead of the user. A context-confined credential additionally receives the collision echo (or, with `?upsert=true`, is allowed to overwrite) only when the colliding user holds an access profile in the credential's own app context — a cross-context collision otherwise gets the same uniform `400` instead of the other context's user data. One narrow exception on the plain (non-upsert) echo only: the CLI's no-code bootstrap credential can be echoed a colliding user across app contexts, needed for a blueprint to idempotently re-apply against a service principal it provisioned in a non-default context; this does not extend to `?upsert=true`.
6968
7128
  *
6969
7129
  * @param {Vectros.CreateUserRequest} request
6970
7130
  * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -7088,7 +7248,7 @@ var IdentityClient = class {
7088
7248
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/users/{id}");
7089
7249
  }
7090
7250
  /**
7091
- * Updates mutable fields on an existing user (such as email, status, payload, or schema binding). The `type` field is immutable after creation, and `email` cannot be changed while an invitation to that user is still outstanding — revoke the invitation, or invite the new address instead. This endpoint also activates an invited user: a PUT that moves a PENDING user to ACTIVE and carries `inviteToken`, `externalSubject`, and `emailVerifiedAttestation=true` completes the invitation. Requires the `users:u` scope.
7251
+ * Updates mutable fields on an existing user (such as email, status, payload, or schema binding). The `type` field is immutable after creation, and `email` cannot be changed while an invitation to that user is still outstanding — revoke the invitation, or invite the new address instead. This endpoint also activates an invited user: a PUT that moves a PENDING user to ACTIVE and carries `inviteToken`, `externalSubject`, and `emailVerifiedAttestation=true` completes the invitation. **`externalSubject` set this way is NOT an authentication binding and does not enable sign-in anywhere** — not the Vectros DevPortal/Admin App/web apps, and not `/v1/auth/token/exchange` either; both are granted only by the invitee authenticating themselves. If the invitee needs dev-portal/web-app access, send them the invitation link and let them accept it directly. If the invitee needs to sign in via token exchange, have them redeem `inviteToken` themselves at `/v1/auth/token/exchange` with their own credential — Vectros verifies it there and computes its own value for this field from the verified credential. The value you send here is stored exactly as-is, with no normalization, and does NOT automatically match or deduplicate against what a later token-exchange sign-in computes for the same real-world identity. Call this endpoint directly only if you run your own backend and want Vectros to record which of your own users a given account corresponds to — treat this field as informational for that purpose, not as a way to pre-authorize sign-in. Requires the `users:u` scope.
7092
7252
  *
7093
7253
  * @param {Vectros.UpdateUserRequest} request
7094
7254
  * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -7155,7 +7315,7 @@ var IdentityClient = class {
7155
7315
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v1/users/{id}");
7156
7316
  }
7157
7317
  /**
7158
- * Permanently deletes a user identity. This cannot be undone. If the user is a pending invitation, the associated access profile created for that invitation is also removed. Requires the `users:d` scope. Deleting your account's last OWNER is refused (409) — an account must always retain at least one owner.
7318
+ * Permanently deletes a user identity. This cannot be undone. If the user is a pending invitation, the associated access profile created for that invitation is also removed. Requires the `users:d` scope. Deleting your account's last OWNER is refused (409) — an account must always retain at least one owner. Called by a context-confined credential, deletion is also refused (409) when the user holds access in an app context other than the caller's own — remove the user from the caller's own context first, or use a credential with cross-context reach.
7159
7319
  *
7160
7320
  * @param {Vectros.DeleteUserRequest} request
7161
7321
  * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -7216,7 +7376,7 @@ var IdentityClient = class {
7216
7376
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v1/users/{id}");
7217
7377
  }
7218
7378
  /**
7219
- * Looks up users by a schema lookup field, with the query criteria carried in the request body rather than the URL. Use this when looking up by a sensitive (blind-indexed) field: the value is blind-indexed server-side and never appears in the URL, request logs, or proxies. The query semantics are identical to the GET /v1/users lookup, which rejects sensitive-field values and directs you here. Returns a page in the `{data, nextCursor}` envelope. Requires the `users:r` scope.
7379
+ * Looks up users by a schema lookup field, with the query criteria carried in the request body rather than the URL. Use this when looking up by a sensitive (blind-indexed) field: the value is blind-indexed server-side and never appears in the URL, request logs, or proxies. The query semantics are identical to the GET /v1/users lookup, which rejects sensitive-field values and directs you here. Returns a page in the `{data, nextCursor}` envelope. Requires the `users:r` scope. A context-confined credential only sees users who hold an access profile in the credential's own app context — others are silently absent from the page, not an error.
7220
7380
  *
7221
7381
  * @param {Vectros.IdentityLookupRequest} request
7222
7382
  * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -7659,14 +7819,14 @@ var RecordsClient = class {
7659
7819
  this._options = normalizeClientOptionsWithAuth(options);
7660
7820
  }
7661
7821
  /**
7662
- * Reserved endpoint for fetching multiple records by ID in one call. When available, the response will contain only the records you can see; any IDs that do not exist or are outside your scope are silently omitted (there is no per-ID existence signal), matching the not-found behavior of the single-record GET. It currently returns 501 (not implemented). The documented 200 response schema is the stable shape this endpoint will use once available. Requires the `records:r` scope.
7822
+ * Fetches multiple records by ID in one call (`ids`, maximum 100). The response contains only the records you can access — any id that does not exist, belongs to another account/AppContext, or is outside your token's scope is silently omitted, with no per-id existence signal, matching the not-found behavior of the single-record GET. Payloads are hydrated the same way a by-id GET hydrates them (payloads externalized to object storage are rehydrated for this response). Requires the `records:r` scope (and, for a scoped token, `records:r:<type>` per record type).
7663
7823
  *
7664
7824
  * @param {Vectros.BatchGetRequest} request
7665
7825
  * @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
7666
7826
  *
7827
+ * @throws {@link Vectros.BadRequestError}
7667
7828
  * @throws {@link Vectros.ForbiddenError}
7668
7829
  * @throws {@link Vectros.TooManyRequestsError}
7669
- * @throws {@link Vectros.NotImplementedError}
7670
7830
  *
7671
7831
  * @example
7672
7832
  * await client.records.batchGetRecords()
@@ -7703,12 +7863,12 @@ var RecordsClient = class {
7703
7863
  }
7704
7864
  if (_response.error.reason === "status-code") {
7705
7865
  switch (_response.error.statusCode) {
7866
+ case 400:
7867
+ throw new BadRequestError(_response.error.body, _response.rawResponse);
7706
7868
  case 403:
7707
7869
  throw new ForbiddenError(_response.error.body, _response.rawResponse);
7708
7870
  case 429:
7709
7871
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
7710
- case 501:
7711
- throw new NotImplementedError(_response.error.body, _response.rawResponse);
7712
7872
  default:
7713
7873
  throw new VectrosError({
7714
7874
  statusCode: _response.error.statusCode,
@@ -8522,7 +8682,7 @@ var SchemasClient = class {
8522
8682
  this._options = normalizeClientOptionsWithAuth(options);
8523
8683
  }
8524
8684
  /**
8525
- * Returns a paginated list of the record schemas defined in your account. Filter by `userId` or `scope` to scope to an owner, by `surface` to list the types bindable to one surface, or by `recordType` to resolve the single schema for a type directly. Filtering by an identity surface (`user` or `entity`) lists your account-wide identity schemas regardless of the calling context; filtering by record or document lists within the calling context. Requires the `schemas:r` scope.
8685
+ * Returns a paginated list of the record schemas defined in your account. Filter by `userId` or `scope` to scope to an owner, by `surface` to list the types bindable to one surface, or by `recordType` to resolve the single schema for a type directly. Filtering by `surface=user` lists your account-wide identity schemas regardless of the calling context (a `user`-surfaced schema always has one tenant-wide home). Filtering by `surface=entity` reads your own app context's entity schemas AND the tenant-wide home together, newest first, through a single cursor — an entity schema may live in either home depending on where its namespace is placed (see `POST /v1/namespaces`). Filtering by `record` or `document` lists within the calling context only. Requires the `schemas:r` scope.
8526
8686
  *
8527
8687
  * @param {Vectros.ListSchemasRequest} request
8528
8688
  * @param {SchemasClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -8810,6 +8970,7 @@ var SchemasClient = class {
8810
8970
  * @param {Vectros.DeleteSchemaRequest} request
8811
8971
  * @param {SchemasClient.RequestOptions} requestOptions - Request-specific configuration.
8812
8972
  *
8973
+ * @throws {@link Vectros.ForbiddenError}
8813
8974
  * @throws {@link Vectros.NotFoundError}
8814
8975
  * @throws {@link Vectros.ConflictError}
8815
8976
  * @throws {@link Vectros.TooManyRequestsError}
@@ -8849,6 +9010,8 @@ var SchemasClient = class {
8849
9010
  }
8850
9011
  if (_response.error.reason === "status-code") {
8851
9012
  switch (_response.error.statusCode) {
9013
+ case 403:
9014
+ throw new ForbiddenError(_response.error.body, _response.rawResponse);
8852
9015
  case 404:
8853
9016
  throw new NotFoundError(_response.error.body, _response.rawResponse);
8854
9017
  case 409:
@@ -9063,7 +9226,7 @@ import {
9063
9226
  ListToolsRequestSchema,
9064
9227
  ReadResourceRequestSchema
9065
9228
  } from "@modelcontextprotocol/sdk/types.js";
9066
- import { z as z22 } from "zod";
9229
+ import { z as z23 } from "zod";
9067
9230
 
9068
9231
  // src/auth.ts
9069
9232
  var KEY_RE = /^(sk|ssk|st)_(live|test)_/;
@@ -9107,8 +9270,8 @@ function warnOnSuboptimalKey(key, log) {
9107
9270
 
9108
9271
  // src/build-info.ts
9109
9272
  var BUILD_INFO = {
9110
- mcpServer: true ? "0.15.0" : "dev",
9111
- sdk: true ? "0.40.0" : "dev"
9273
+ mcpServer: true ? "0.16.1" : "dev",
9274
+ sdk: true ? "0.42.0" : "dev"
9112
9275
  };
9113
9276
 
9114
9277
  // src/log.ts
@@ -9790,23 +9953,70 @@ var recordGet = ({ client, log }) => ({
9790
9953
  });
9791
9954
  var record_get_default = recordGet;
9792
9955
 
9793
- // src/tools/record_create.ts
9956
+ // src/tools/record_batch_get.ts
9794
9957
  import { z as z4 } from "zod";
9958
+ var MAX_PAYLOAD_CHARS2 = 32e3;
9959
+ var MCP_MAX_IDS = 100;
9795
9960
  var inputSchema4 = {
9796
- type: z4.string().min(1, "type is required").describe('Record type / schema name (e.g. "task"). Must match an existing schema \u2014 see list_schemas.'),
9797
- fields: z4.record(z4.string(), z4.unknown()).describe(
9961
+ ids: z4.array(z4.string()).min(1).max(MCP_MAX_IDS).describe(
9962
+ `Record ids to fetch in one call (1-${MCP_MAX_IDS}). Any id you cannot access \u2014 nonexistent, wrong account, or outside your token's scope \u2014 is silently omitted from the response (no per-id existence signal); compare against the response's \`missingIds\` to see which requested ids came back empty.`
9963
+ )
9964
+ };
9965
+ var recordBatchGet = ({ client, log }) => ({
9966
+ name: "record_batch_get",
9967
+ title: "Get multiple records by id in one call",
9968
+ description: "Fetch several structured records by id in a single call (1-100 ids), each with its full payload \u2014 the same hydration record_get gives a single id. Use this instead of N record_get calls when you already hold several ids (e.g. a page of record_query/hybrid_search results). Any id you can't access is silently omitted from `data`; the response also returns `missingIds` \u2014 every requested id not present in `data` \u2014 so you can tell a partial result from a complete one. As with record_get, an oversized payload is truncated into a labelled `payloadPreview` rather than shipped whole.",
9969
+ inputSchema: inputSchema4,
9970
+ handler: async (args) => {
9971
+ const ids = args.ids;
9972
+ try {
9973
+ const response = await client.records.batchGetRecords({ ids });
9974
+ const records = response.data ?? [];
9975
+ const data = records.map((record) => {
9976
+ const item = { ...record };
9977
+ if (record.payload !== void 0) {
9978
+ const json = JSON.stringify(record.payload);
9979
+ if (json.length > MAX_PAYLOAD_CHARS2) {
9980
+ delete item.payload;
9981
+ item.payloadPreview = json.slice(0, MAX_PAYLOAD_CHARS2);
9982
+ item.payloadTruncated = true;
9983
+ item.payloadTotalChars = json.length;
9984
+ }
9985
+ }
9986
+ return item;
9987
+ });
9988
+ const returnedIds = new Set(records.map((r) => r.id));
9989
+ const missingIds = ids.filter((id) => !returnedIds.has(id));
9990
+ log.debug(
9991
+ { tool: "record_batch_get", requested: ids.length, returned: data.length, missing: missingIds.length },
9992
+ "record_batch_get ok"
9993
+ );
9994
+ return { content: [{ type: "text", text: JSON.stringify({ data, missingIds }, null, 2) }] };
9995
+ } catch (err) {
9996
+ log.warn({ tool: "record_batch_get", idsCount: ids?.length, err: String(err) }, "record_batch_get failed");
9997
+ return toolError("record_batch_get", err);
9998
+ }
9999
+ }
10000
+ });
10001
+ var record_batch_get_default = recordBatchGet;
10002
+
10003
+ // src/tools/record_create.ts
10004
+ import { z as z5 } from "zod";
10005
+ var inputSchema5 = {
10006
+ type: z5.string().min(1, "type is required").describe('Record type / schema name (e.g. "task"). Must match an existing schema \u2014 see list_schemas.'),
10007
+ fields: z5.record(z5.string(), z5.unknown()).describe(
9798
10008
  "The record payload \u2014 a JSON object of field\u2192value, validated against the type schema. Call list_schemas to learn required fields, types, and enum values. Every number must fall within the signed 64-bit range (a value outside it, or with >38 significant digits, is refused with a 400 naming the field) \u2014 send a larger whole number (e.g. a big external id) as a STRING, which stores it exactly and supports exact-match lookup."
9799
10009
  ),
9800
- externalId: z4.string().optional().describe(
10010
+ externalId: z5.string().optional().describe(
9801
10011
  "Stable caller-supplied id. Immutable; unique per type. Re-creating with the same externalId returns the existing record (idempotent) \u2014 use it to make creates safely retryable."
9802
10012
  ),
9803
- indexMode: z4.enum(["HYBRID", "SEMANTIC", "TEXT", "NONE"]).optional().describe(
10013
+ indexMode: z5.enum(["HYBRID", "SEMANTIC", "TEXT", "NONE"]).optional().describe(
9804
10014
  "Search-index strategy for this record, set at create only (immutable after). HYBRID (BM25 + dense), SEMANTIC (dense only), TEXT (BM25 only), NONE (store-only \u2014 never appears in hybrid_search/rag_ask; still retrievable by id and structured-field lookup). Omit to inherit the type schema's default; if the schema default is NONE and you want this record searchable, set it here \u2014 it cannot be changed later."
9805
10015
  ),
9806
- status: z4.string().optional().describe("Record lifecycle status. Defaults to ACTIVE server-side."),
9807
- folderId: z4.string().optional().describe("Group this record into a folder."),
9808
- userId: z4.string().optional().describe("Owning user id."),
9809
- scopes: z4.array(z4.string()).optional().describe(
10016
+ status: z5.string().optional().describe("Record lifecycle status. Defaults to ACTIVE server-side."),
10017
+ folderId: z5.string().optional().describe("Group this record into a folder."),
10018
+ userId: z5.string().optional().describe("Owning user id."),
10019
+ scopes: z5.array(z5.string()).optional().describe(
9810
10020
  'Scope ownership as `namespace:value` entries, at most 2 (e.g. ["org:<uuid>", "group:eng-team"]). `org` and `client` are reserved namespace names, registered like any other; others are namespaces you registered yourself. This is the record\'s COMPLETE scope declaration and values must come from the credential\'s own identity. An empty array `[]` creates a PRIVATE record owned by the calling user alone. Omit to stamp the credential\'s full identity \u2014 the default.'
9811
10021
  )
9812
10022
  };
@@ -9814,7 +10024,7 @@ var recordCreate = ({ client, log }) => ({
9814
10024
  name: "record_create",
9815
10025
  title: "Create a record",
9816
10026
  description: "Create a structured record of a given type. Provide `type` and `fields` (the payload, validated against the type schema \u2014 call list_schemas first to learn required fields and enums). Idempotent by `externalId`. Requires the key to allow records:c (and records:r to receive the existing record on a collision).",
9817
- inputSchema: inputSchema4,
10027
+ inputSchema: inputSchema5,
9818
10028
  handler: async (args) => {
9819
10029
  const type = args.type;
9820
10030
  try {
@@ -9841,18 +10051,18 @@ var recordCreate = ({ client, log }) => ({
9841
10051
  var record_create_default = recordCreate;
9842
10052
 
9843
10053
  // src/tools/record_update.ts
9844
- import { z as z5 } from "zod";
9845
- var inputSchema5 = {
9846
- id: z5.string().optional().describe("The Vectros record id to update. Provide this OR externalId+type."),
9847
- externalId: z5.string().optional().describe(
10054
+ import { z as z6 } from "zod";
10055
+ var inputSchema6 = {
10056
+ id: z6.string().optional().describe("The Vectros record id to update. Provide this OR externalId+type."),
10057
+ externalId: z6.string().optional().describe(
9848
10058
  "Your caller-owned externalId \u2014 an alternative selector to `id` (requires `type`). Updates the record you created under that externalId without a manual record_query lookup first."
9849
10059
  ),
9850
- type: z5.string().optional().describe("Record type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
9851
- fields: z5.record(z5.string(), z5.unknown()).describe(
10060
+ type: z6.string().optional().describe("Record type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
10061
+ fields: z6.record(z6.string(), z6.unknown()).describe(
9852
10062
  "Field\u2192value changes DEEP-MERGED into the existing payload: keys you send overwrite (recursing into nested objects), a key set to `null` is deleted, and unspecified fields are preserved."
9853
10063
  ),
9854
- status: z5.string().optional().describe("Set the record lifecycle status (e.g. ARCHIVED) \u2014 archive/workflow without physical deletion."),
9855
- expectedVersion: z5.number().int().optional().describe(
10064
+ status: z6.string().optional().describe("Set the record lifecycle status (e.g. ARCHIVED) \u2014 archive/workflow without physical deletion."),
10065
+ expectedVersion: z6.number().int().optional().describe(
9856
10066
  "Optimistic concurrency: the version you last read. If the record changed since, the update is refused as a conflict (re-read and retry). Omit for last-write-wins."
9857
10067
  )
9858
10068
  };
@@ -9860,7 +10070,7 @@ var recordUpdate = ({ client, log }) => ({
9860
10070
  name: "record_update",
9861
10071
  title: "Update a record by id or externalId",
9862
10072
  description: "Update a record \u2014 select it by its Vectros `id` OR by your own `externalId` + `type` (the same key you passed to record_create, resolved for you). The provided `fields` are DEEP-MERGED into the existing payload (unspecified fields are preserved; a field set to `null` is deleted). Pass `expectedVersion` (the version you last read) for safe concurrent edits \u2014 a stale update is refused (409). Use `status` to archive without deleting. Requires the key to allow records:u.",
9863
- inputSchema: inputSchema5,
10073
+ inputSchema: inputSchema6,
9864
10074
  handler: async (args) => {
9865
10075
  const id = args.id;
9866
10076
  const externalId = args.externalId;
@@ -9886,15 +10096,15 @@ var recordUpdate = ({ client, log }) => ({
9886
10096
  var record_update_default = recordUpdate;
9887
10097
 
9888
10098
  // src/tools/record_delete.ts
9889
- import { z as z6 } from "zod";
9890
- var inputSchema6 = {
9891
- id: z6.string().min(1, "id is required").describe("The Vectros record id to delete.")
10099
+ import { z as z7 } from "zod";
10100
+ var inputSchema7 = {
10101
+ id: z7.string().min(1, "id is required").describe("The Vectros record id to delete.")
9892
10102
  };
9893
10103
  var recordDelete = ({ client, log }) => ({
9894
10104
  name: "record_delete",
9895
10105
  title: "Delete a record",
9896
10106
  description: "Permanently delete a record by id (leaves a tombstone). Requires the key to allow records:d \u2014 a key without it gets a permission error. To archive without deleting, use record_update to set status instead.",
9897
- inputSchema: inputSchema6,
10107
+ inputSchema: inputSchema7,
9898
10108
  handler: async (args) => {
9899
10109
  const id = args.id;
9900
10110
  try {
@@ -9910,48 +10120,48 @@ var recordDelete = ({ client, log }) => ({
9910
10120
  var record_delete_default = recordDelete;
9911
10121
 
9912
10122
  // src/tools/rag_ask.ts
9913
- import { z as z7 } from "zod";
10123
+ import { z as z8 } from "zod";
9914
10124
  var SEARCH_MCP_DEFAULT_LIMIT = 5;
9915
10125
  var SEARCH_MCP_MAX_LIMIT = 50;
9916
- var inputSchema7 = {
9917
- query: z7.string().min(1, "query must be non-empty").describe("Question to ground against retrieved content."),
9918
- instructions: z7.string().optional().describe(
10126
+ var inputSchema8 = {
10127
+ query: z8.string().min(1, "query must be non-empty").describe("Question to ground against retrieved content."),
10128
+ instructions: z8.string().optional().describe(
9919
10129
  'System prompt that overrides the default for the generation step \u2014 e.g. "answer only from the provided context, cite sources, be concise". Default: a generic answer-from-context instruction.'
9920
10130
  ),
9921
- model: z7.string().optional().describe(
10131
+ model: z8.string().optional().describe(
9922
10132
  "Inference model alias (e.g. claude-haiku-4-5, claude-sonnet-5, claude-opus-4-8). Default = tier-appropriate Haiku. See GET /v1/models for the catalog the calling key can reach."
9923
10133
  ),
9924
- search: z7.object({
9925
- mode: z7.enum(["HYBRID", "TEXT", "SEMANTIC"]).optional().describe("Retrieval mode. Default HYBRID."),
9926
- limit: z7.number().int().min(1).max(SEARCH_MCP_MAX_LIMIT).optional().describe(
10134
+ search: z8.object({
10135
+ mode: z8.enum(["HYBRID", "TEXT", "SEMANTIC"]).optional().describe("Retrieval mode. Default HYBRID."),
10136
+ limit: z8.number().int().min(1).max(SEARCH_MCP_MAX_LIMIT).optional().describe(
9927
10137
  `Passages to retrieve before generating (the grounding-corpus size). Default ${SEARCH_MCP_DEFAULT_LIMIT}; raise up to ${SEARCH_MCP_MAX_LIMIT} (the RAG search API max) for a broader corpus when the extra grounding is worth the larger prompt.`
9928
10138
  ),
9929
10139
  // Retrieval scoping — parity with hybrid_search so an agent can ground the
9930
10140
  // answer on a specific owner / folder / type / metadata subset, not just the
9931
10141
  // whole-tenant corpus.
9932
- userId: z7.string().optional().describe("Restrict retrieval to content owned by this user (Vectros UUID)."),
9933
- scope: z7.string().optional().describe(
10142
+ userId: z8.string().optional().describe("Restrict retrieval to content owned by this user (Vectros UUID)."),
10143
+ scope: z8.string().optional().describe(
9934
10144
  'Restrict retrieval to content carrying this scope value, in `namespace:value` form (e.g. "org:<uuid>", "client:<uuid>", "group:eng-team"). `org` and `client` are reserved namespace names, registered like any other; others are namespaces you registered yourself.'
9935
10145
  ),
9936
- folderId: z7.string().optional().describe("Restrict retrieval to this exact folder."),
9937
- rootFolderId: z7.string().optional().describe("Restrict retrieval to this folder and all its descendants."),
9938
- typeName: z7.string().optional().describe("Restrict record retrieval to this schema type."),
9939
- contentTypes: z7.array(z7.enum(["documents", "records"])).optional().describe('Narrow retrieval to content types. ["documents"] or ["records"]; omit for both.'),
9940
- filters: z7.record(z7.unknown()).optional().describe(
10146
+ folderId: z8.string().optional().describe("Restrict retrieval to this exact folder."),
10147
+ rootFolderId: z8.string().optional().describe("Restrict retrieval to this folder and all its descendants."),
10148
+ typeName: z8.string().optional().describe("Restrict record retrieval to this schema type."),
10149
+ contentTypes: z8.array(z8.enum(["documents", "records"])).optional().describe('Narrow retrieval to content types. ["documents"] or ["records"]; omit for both.'),
10150
+ filters: z8.record(z8.unknown()).optional().describe(
9941
10151
  'Field-level metadata filters (AND-combined). Value = scalar (equality), array (OR-set), or operator map ($eq/$ne/$gt/$gte/$lt/$lte, $in/$nin). e.g. {"status":"open"}.'
9942
10152
  ),
9943
- createdAfter: z7.string().optional().describe("Restrict to content created at/after this ISO 8601 UTC timestamp."),
9944
- createdBefore: z7.string().optional().describe("Restrict to content created at/before this ISO 8601 UTC timestamp."),
9945
- requireComplete: z7.boolean().optional().describe("Fail closed (503) on a degraded search backend instead of grounding on partial results. Default false.")
10153
+ createdAfter: z8.string().optional().describe("Restrict to content created at/after this ISO 8601 UTC timestamp."),
10154
+ createdBefore: z8.string().optional().describe("Restrict to content created at/before this ISO 8601 UTC timestamp."),
10155
+ requireComplete: z8.boolean().optional().describe("Fail closed (503) on a degraded search backend instead of grounding on partial results. Default false.")
9946
10156
  }).optional().describe("Retrieval params + scoping. Default mode HYBRID, limit " + SEARCH_MCP_DEFAULT_LIMIT + "."),
9947
- maxTokens: z7.number().int().min(1).optional().describe("Max output tokens."),
9948
- temperature: z7.number().min(0).max(1).optional().describe("Sampling temperature (0.0\u20131.0). Default 0.3 \u2014 lower favors deterministic, retrieval-grounded answers.")
10157
+ maxTokens: z8.number().int().min(1).optional().describe("Max output tokens."),
10158
+ temperature: z8.number().min(0).max(1).optional().describe("Sampling temperature (0.0\u20131.0). Default 0.3 \u2014 lower favors deterministic, retrieval-grounded answers.")
9949
10159
  };
9950
10160
  var ragAsk = ({ client, log }) => ({
9951
10161
  name: "rag_ask",
9952
10162
  title: "RAG ask (corpus-wide)",
9953
10163
  description: "Ask a question grounded against your tenant's indexed content. Vectros performs a hybrid search, injects the top-K passages into the prompt, and streams a model answer back. Scope retrieval with `search` (ownership, folder, type, metadata filters, date window) to ground on a subset \u2014 e.g. one patient or one folder \u2014 and steer generation with `instructions` / `temperature`. The full answer is returned as a single response; progress notifications keep the call alive during the 30-45s generation window. Inference runs in-perimeter against AWS Bedrock \u2014 PHI never leaves the BAA boundary.",
9954
- inputSchema: inputSchema7,
10164
+ inputSchema: inputSchema8,
9955
10165
  handler: async (args, extra) => {
9956
10166
  try {
9957
10167
  const searchArg = args.search ?? {};
@@ -10027,20 +10237,20 @@ var ragAsk = ({ client, log }) => ({
10027
10237
  var rag_ask_default = ragAsk;
10028
10238
 
10029
10239
  // src/tools/document_ask.ts
10030
- import { z as z8 } from "zod";
10031
- var inputSchema8 = {
10032
- documentId: z8.string().min(1, "documentId is required").describe("ID of the document to ask against."),
10033
- prompt: z8.string().min(1, "prompt is required").describe("Question to ask about the document."),
10034
- model: z8.string().optional().describe(
10240
+ import { z as z9 } from "zod";
10241
+ var inputSchema9 = {
10242
+ documentId: z9.string().min(1, "documentId is required").describe("ID of the document to ask against."),
10243
+ prompt: z9.string().min(1, "prompt is required").describe("Question to ask about the document."),
10244
+ model: z9.string().optional().describe(
10035
10245
  "Inference model alias. Default = tier-appropriate Haiku. See GET /v1/models for the catalog the calling key can reach."
10036
10246
  ),
10037
- maxTokens: z8.number().int().min(1).optional().describe("Max output tokens.")
10247
+ maxTokens: z9.number().int().min(1).optional().describe("Max output tokens.")
10038
10248
  };
10039
10249
  var documentAsk = ({ client, log }) => ({
10040
10250
  name: "document_ask",
10041
10251
  title: "Document ask (single-document)",
10042
10252
  description: "Ask a question against a single indexed document. Returns a grounded answer with the document context that informed it. For documents exceeding the input-token cap, the API returns a structured 413 with `estimatedTokens` and `limitTokens`. Inference runs in-perimeter against AWS Bedrock \u2014 PHI never leaves the BAA boundary.",
10043
- inputSchema: inputSchema8,
10253
+ inputSchema: inputSchema9,
10044
10254
  handler: async (args, extra) => {
10045
10255
  try {
10046
10256
  const stream = await client.inference.documentAsk({
@@ -10099,18 +10309,18 @@ var documentAsk = ({ client, log }) => ({
10099
10309
  var document_ask_default = documentAsk;
10100
10310
 
10101
10311
  // src/tools/list_schemas.ts
10102
- import { z as z9 } from "zod";
10103
- var inputSchema9 = {
10104
- userId: z9.string().optional().describe(
10312
+ import { z as z10 } from "zod";
10313
+ var inputSchema10 = {
10314
+ userId: z10.string().optional().describe(
10105
10315
  "Filter to schemas visible to a specific user. Optional; default returns all schemas the credential can see."
10106
10316
  ),
10107
- scope: z9.string().optional().describe(
10317
+ scope: z10.string().optional().describe(
10108
10318
  'Filter to schemas carrying this scope value, in `namespace:value` form (e.g. "org:<uuid>", "group:eng-team"). `org` and `client` are reserved namespace names, registered like any other. Optional; default returns all schemas the credential can see.'
10109
10319
  ),
10110
- surface: z9.enum(["record", "document", "user", "entity"]).optional().describe(
10320
+ surface: z10.enum(["record", "document", "user", "entity"]).optional().describe(
10111
10321
  "Filter to schemas bindable to this surface \u2014 e.g. `document` to list only document types, or `record` for record types. Identity entities in any namespace (org/client/one you registered) bind under the single `entity` surface; `user` and `entity` are account-wide. Optional."
10112
10322
  ),
10113
- recordType: z9.string().optional().describe(
10323
+ recordType: z10.string().optional().describe(
10114
10324
  'Resolve the single schema for this record type (its natural handle, e.g. "patient") instead of listing \u2014 returns a one-element result, or empty if none. Combine with `surface=user|entity` for an identity schema. Takes precedence over userId. Optional.'
10115
10325
  )
10116
10326
  };
@@ -10118,7 +10328,7 @@ var listSchemas = ({ client, log }) => ({
10118
10328
  name: "list_schemas",
10119
10329
  title: "List record schemas",
10120
10330
  description: 'List the structured-record schema catalog for your tenant. Each schema describes a record type (e.g. "patient", "clinical_note") \u2014 its fields, lookup-indexed fields, and capabilities. Use this to discover what record types exist before calling `record_query`. Filter with `surface` (record/document/user/entity \u2014 e.g. only document types), `recordType` (resolve one schema by its type name), or `userId`/`scope`; default returns everything the credential can see.',
10121
- inputSchema: inputSchema9,
10331
+ inputSchema: inputSchema10,
10122
10332
  handler: async (args) => {
10123
10333
  const userId = args.userId;
10124
10334
  const scope = args.scope;
@@ -10144,18 +10354,18 @@ var listSchemas = ({ client, log }) => ({
10144
10354
  var list_schemas_default = listSchemas;
10145
10355
 
10146
10356
  // src/tools/document_get.ts
10147
- import { z as z10 } from "zod";
10357
+ import { z as z11 } from "zod";
10148
10358
  var MAX_TEXT_CHARS = 32e3;
10149
- var inputSchema10 = {
10150
- documentId: z10.string().optional().describe("The document ID returned by document_ingest or hybrid_search. Provide this OR externalId+type."),
10151
- externalId: z10.string().optional().describe(
10359
+ var inputSchema11 = {
10360
+ documentId: z11.string().optional().describe("The document ID returned by document_ingest or hybrid_search. Provide this OR externalId+type."),
10361
+ externalId: z11.string().optional().describe(
10152
10362
  "Your caller-owned externalId \u2014 an alternative selector to `documentId` (requires `type`). Fetches the document you ingested under that externalId without a manual lookup first."
10153
10363
  ),
10154
- type: z10.string().optional().describe("Document type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
10155
- includeText: z10.boolean().optional().describe(
10364
+ type: z11.string().optional().describe("Document type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
10365
+ includeText: z11.boolean().optional().describe(
10156
10366
  "If true, fetch and include the document text (capped at ~8K tokens, truncated: true flag if cut). Default false \u2014 metadata only. For larger documents, prefer `document_ask` over dumping text into context."
10157
10367
  ),
10158
- includeDownloadUrl: z10.boolean().optional().describe(
10368
+ includeDownloadUrl: z11.boolean().optional().describe(
10159
10369
  "If true, also return a short-lived presigned `downloadUrl` for the original file (file-backed documents only \u2014 the way to retrieve the raw bytes of a document ingested via file mode). Default false. Unavailable for text-only documents \u2014 `downloadAvailable: false` is set instead."
10160
10370
  )
10161
10371
  };
@@ -10172,7 +10382,7 @@ var documentGet = ({ client, log }) => ({
10172
10382
  name: "document_get",
10173
10383
  title: "Get document metadata (and optionally text)",
10174
10384
  description: "Fetch metadata for a single document \u2014 select it by its Vectros `documentId` OR by your own `externalId` + `type` (resolved for you). Pass `includeText: true` to also fetch the text body (capped at ~8K tokens; `truncated: true` flag if cut). Text is available for every text-ingested document and for file-ingested documents unless they were uploaded with `storeText: false` (extracted text discarded after indexing) \u2014 then `textAvailable: false` is set; the original file is still retrievable via `includeDownloadUrl`. Pass `includeDownloadUrl: true` to also get a short-lived presigned `downloadUrl` for the original file (file-backed documents only). Returns the full document metadata, including its lifecycle `status` (ACTIVE, or ARCHIVED when soft-retracted from search \u2014 restorable via document_update) and its processing `indexStatus`. When `indexStatus` is FAILED the response also carries `indexFailure` with a machine-readable `code` telling you whether the content is still findable \u2014 e.g. TEXT_INDEX_FAILED / VECTOR_LIMIT_EXCEEDED (one leg still serves it) vs INDEXING_FAILED (not findable by search at all). Branch on `code`, not on the message.",
10175
- inputSchema: inputSchema10,
10385
+ inputSchema: inputSchema11,
10176
10386
  handler: async (args) => {
10177
10387
  const documentId = args.documentId;
10178
10388
  const externalId = args.externalId;
@@ -10237,28 +10447,28 @@ var documentGet = ({ client, log }) => ({
10237
10447
  var document_get_default = documentGet;
10238
10448
 
10239
10449
  // src/tools/document_query.ts
10240
- import { z as z11 } from "zod";
10450
+ import { z as z12 } from "zod";
10241
10451
  var MCP_DEFAULT_LIMIT3 = 3;
10242
10452
  var MCP_MAX_LIMIT3 = 100;
10243
- var inputSchema11 = {
10453
+ var inputSchema12 = {
10244
10454
  // Lookup-mode args — provide `field` plus EXACTLY ONE of: value | from+to | prefix.
10245
- field: z11.string().optional().describe("Lookup mode: name of the lookup-indexed field to query by."),
10246
- value: z11.string().optional().describe("Lookup mode (equality): exact-match value for `field`. Works on sensitive fields too."),
10247
- from: z11.string().optional().describe("Lookup mode (range): inclusive lower bound; requires `to`. Range-enabled, non-sensitive fields only."),
10248
- to: z11.string().optional().describe("Lookup mode (range): inclusive upper bound; requires `from`."),
10249
- prefix: z11.string().optional().describe("Lookup mode (prefix): match values starting with this. Range-enabled string fields only."),
10250
- order: z11.enum(["asc", "desc"]).optional().describe(
10455
+ field: z12.string().optional().describe("Lookup mode: name of the lookup-indexed field to query by."),
10456
+ value: z12.string().optional().describe("Lookup mode (equality): exact-match value for `field`. Works on sensitive fields too."),
10457
+ from: z12.string().optional().describe("Lookup mode (range): inclusive lower bound; requires `to`. Range-enabled, non-sensitive fields only."),
10458
+ to: z12.string().optional().describe("Lookup mode (range): inclusive upper bound; requires `from`."),
10459
+ prefix: z12.string().optional().describe("Lookup mode (prefix): match values starting with this. Range-enabled string fields only."),
10460
+ order: z12.enum(["asc", "desc"]).optional().describe(
10251
10461
  "Lookup mode: sort direction by the looked-up field. `asc` (default) or `desc` \u2014 use `desc` with a range/prefix lookup to get the most-recent / highest values first (e.g. latest-N). Ignored in list mode."
10252
10462
  ),
10253
- type: z11.string().optional().describe("Lookup mode: the document type (the bound schema's type). Required with `field`."),
10463
+ type: z12.string().optional().describe("Lookup mode: the document type (the bound schema's type). Required with `field`."),
10254
10464
  // List-mode args:
10255
- folderId: z11.string().optional().describe("List mode: only documents in this folder (Vectros folder id)."),
10256
- userId: z11.string().optional().describe("List mode: scope to documents owned by this user."),
10257
- scope: z11.string().optional().describe(
10465
+ folderId: z12.string().optional().describe("List mode: only documents in this folder (Vectros folder id)."),
10466
+ userId: z12.string().optional().describe("List mode: scope to documents owned by this user."),
10467
+ scope: z12.string().optional().describe(
10258
10468
  'List mode: filter to documents carrying this scope value, in `namespace:value` form (e.g. "org:<uuid>", "client:<uuid>", "group:eng-team"). `org` and `client` are reserved namespace names, registered like any other; others are namespaces you registered yourself.'
10259
10469
  ),
10260
- startFrom: z11.string().optional().describe("Pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next. Works in both list and lookup mode."),
10261
- limit: z11.number().int().min(1).max(MCP_MAX_LIMIT3).optional().describe(
10470
+ startFrom: z12.string().optional().describe("Pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next. Works in both list and lookup mode."),
10471
+ limit: z12.number().int().min(1).max(MCP_MAX_LIMIT3).optional().describe(
10262
10472
  `Max documents per page. Defaults to a low ${MCP_DEFAULT_LIMIT3} to protect the agent context window; raise up to ${MCP_MAX_LIMIT3} (the documents API max) in one call when you can accept the larger payload, or page with \`startFrom\` instead.`
10263
10473
  )
10264
10474
  };
@@ -10266,7 +10476,7 @@ var documentQuery = ({ client, log }) => ({
10266
10476
  name: "document_query",
10267
10477
  title: "Document query (list or lookup)",
10268
10478
  description: "Query document metadata. Two modes:\n \u2022 Lookup on a lookup-indexed field: pass `type` and `field` plus exactly one of `value` (exact), `from`+`to` (range), or `prefix`. Works on sensitive fields (equality only there); range/prefix need a range-enabled field.\n \u2022 List: omit `field`; optionally filter by `folderId`/`userId`/`scope` (`namespace:value`).\nReturns a `{ data, nextCursor }` page: `data` holds up to `limit` documents (default 3, max 100 \u2014 raise it in one call when you can accept the payload), and a non-null `nextCursor` means more remain \u2014 pass it back as `startFrom` to page. Mode is auto-detected. Use document_get for the full text/download URL of one document.",
10269
- inputSchema: inputSchema11,
10479
+ inputSchema: inputSchema12,
10270
10480
  handler: async (args) => {
10271
10481
  const limit = args.limit ?? MCP_DEFAULT_LIMIT3;
10272
10482
  const field = args.field;
@@ -10346,29 +10556,29 @@ var documentQuery = ({ client, log }) => ({
10346
10556
  var document_query_default = documentQuery;
10347
10557
 
10348
10558
  // src/tools/document_update.ts
10349
- import { z as z12 } from "zod";
10350
- var inputSchema12 = {
10351
- documentId: z12.string().optional().describe("The Vectros document id to update. Provide this OR externalId+type."),
10352
- externalId: z12.string().optional().describe(
10559
+ import { z as z13 } from "zod";
10560
+ var inputSchema13 = {
10561
+ documentId: z13.string().optional().describe("The Vectros document id to update. Provide this OR externalId+type."),
10562
+ externalId: z13.string().optional().describe(
10353
10563
  "Your caller-owned externalId \u2014 an alternative selector to `documentId` (requires `type`). Updates the document you ingested under that externalId without a manual lookup first."
10354
10564
  ),
10355
- type: z12.string().optional().describe("Document type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
10356
- title: z12.string().optional().describe("New title. Omit to keep the current title."),
10357
- fields: z12.record(z12.string(), z12.unknown()).optional().describe(
10565
+ type: z13.string().optional().describe("Document type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
10566
+ title: z13.string().optional().describe("New title. Omit to keep the current title."),
10567
+ fields: z13.record(z13.string(), z13.unknown()).optional().describe(
10358
10568
  "Typed-payload field\u2192value changes DEEP-MERGED into the existing payload (a field set to `null` is deleted; unspecified fields preserved). Omit to leave the payload unchanged."
10359
10569
  ),
10360
- text: z12.string().optional().describe(
10570
+ text: z13.string().optional().describe(
10361
10571
  "New raw text body. Supplying it re-ingests the document body and re-queues it for indexing, so the search index reflects the edit (text-ingested documents only \u2014 not file-backed ones). Omit to leave the stored text unchanged. This is the in-place alternative to re-ingesting with upsert:true."
10362
10572
  ),
10363
- folderId: z12.string().optional().describe("Move the document into this folder (cannot be cleared once set)."),
10364
- status: z12.enum(["ACTIVE", "ARCHIVED"]).optional().describe(
10573
+ folderId: z13.string().optional().describe("Move the document into this folder (cannot be cleared once set)."),
10574
+ status: z13.enum(["ACTIVE", "ARCHIVED"]).optional().describe(
10365
10575
  "Lifecycle status. `ARCHIVED` soft-retracts the document \u2014 it is pulled from search and recall but kept and recoverable; set it back to `ACTIVE` to re-index and restore it. The way to retire superseded content when the credential has no delete authority. Omit to leave unchanged."
10366
10576
  ),
10367
- userId: z12.string().optional().describe("Reassign the owning user (Vectros UUID)."),
10368
- scopes: z12.array(z12.string()).optional().describe(
10577
+ userId: z13.string().optional().describe("Reassign the owning user (Vectros UUID)."),
10578
+ scopes: z13.array(z13.string()).optional().describe(
10369
10579
  'Reassign scope ownership as `namespace:value` entries, at most 2 (e.g. ["org:<uuid>", "group:eng-team"]) \u2014 the COMPLETE new parent set. `org`/`client` are reserved namespace names, registered like any other. Omit to leave ownership unchanged; `[]` clears it (private to the owning user).'
10370
10580
  ),
10371
- expectedVersion: z12.number().int().optional().describe(
10581
+ expectedVersion: z13.number().int().optional().describe(
10372
10582
  "Optimistic concurrency: the version you last read. If the document changed since, the update is refused as a conflict (re-read and retry). Omit for last-write-wins."
10373
10583
  )
10374
10584
  };
@@ -10376,7 +10586,7 @@ var documentUpdate = ({ client, log }) => ({
10376
10586
  name: "document_update",
10377
10587
  title: "Update a document",
10378
10588
  description: 'Update a document \u2014 select it by its Vectros `documentId` OR by your own `externalId` + `type` (resolved for you). `fields` are DEEP-MERGED into the existing typed payload (unspecified fields preserved; a field set to `null` is deleted); title/folderId/status/ownership are updated when provided and preserved otherwise. Supply `text` to re-ingest and re-index the document body in place (text documents only). Set `status: "ARCHIVED"` to soft-retract a document (pulled from search, kept and recoverable) and `status: "ACTIVE"` to restore it. Pass `expectedVersion` (the version you last read) for safe concurrent edits \u2014 a stale update is refused (409). Requires the key to allow documents:u.',
10379
- inputSchema: inputSchema12,
10589
+ inputSchema: inputSchema13,
10380
10590
  handler: async (args) => {
10381
10591
  const documentId = args.documentId;
10382
10592
  const externalId = args.externalId;
@@ -10416,15 +10626,15 @@ var documentUpdate = ({ client, log }) => ({
10416
10626
  var document_update_default = documentUpdate;
10417
10627
 
10418
10628
  // src/tools/document_delete.ts
10419
- import { z as z13 } from "zod";
10420
- var inputSchema13 = {
10421
- documentId: z13.string().min(1, "documentId is required").describe("The Vectros document id to delete.")
10629
+ import { z as z14 } from "zod";
10630
+ var inputSchema14 = {
10631
+ documentId: z14.string().min(1, "documentId is required").describe("The Vectros document id to delete.")
10422
10632
  };
10423
10633
  var documentDelete = ({ client, log }) => ({
10424
10634
  name: "document_delete",
10425
10635
  title: "Delete a document",
10426
10636
  description: 'Permanently delete a document by id (removes it and its indexed content). Requires the key to allow documents:d \u2014 a key without it gets a permission error. To archive without deleting, use document_update to set status: "ARCHIVED" instead (recoverable, and needs no delete authority).',
10427
- inputSchema: inputSchema13,
10637
+ inputSchema: inputSchema14,
10428
10638
  handler: async (args) => {
10429
10639
  const documentId = args.documentId;
10430
10640
  try {
@@ -10442,18 +10652,18 @@ var documentDelete = ({ client, log }) => ({
10442
10652
  var document_delete_default = documentDelete;
10443
10653
 
10444
10654
  // src/tools/folder_query.ts
10445
- import { z as z14 } from "zod";
10655
+ import { z as z15 } from "zod";
10446
10656
  var MCP_DEFAULT_LIMIT4 = 10;
10447
10657
  var MCP_MAX_LIMIT4 = 100;
10448
- var inputSchema14 = {
10449
- id: z14.string().optional().describe("Get mode: fetch this single folder by id."),
10450
- parentId: z14.string().optional().describe("List mode: direct children of this folder (tree navigation). Omit for a flat tenant list."),
10451
- userId: z14.string().optional().describe("List mode: scope to folders owned by this user."),
10452
- scope: z14.string().optional().describe(
10658
+ var inputSchema15 = {
10659
+ id: z15.string().optional().describe("Get mode: fetch this single folder by id."),
10660
+ parentId: z15.string().optional().describe("List mode: direct children of this folder (tree navigation). Omit for a flat tenant list."),
10661
+ userId: z15.string().optional().describe("List mode: scope to folders owned by this user."),
10662
+ scope: z15.string().optional().describe(
10453
10663
  'List mode: filter to folders carrying this scope value, in `namespace:value` form (e.g. "org:<uuid>", "client:<uuid>", "group:eng-team"). `org` and `client` are reserved namespace names, registered like any other; others are namespaces you registered yourself.'
10454
10664
  ),
10455
- startFrom: z14.string().optional().describe("List mode: pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next."),
10456
- limit: z14.number().int().min(1).max(MCP_MAX_LIMIT4).optional().describe(
10665
+ startFrom: z15.string().optional().describe("List mode: pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next."),
10666
+ limit: z15.number().int().min(1).max(MCP_MAX_LIMIT4).optional().describe(
10457
10667
  `List mode: max folders per page. Default 10; raise up to ${MCP_MAX_LIMIT4} (the folders API max) in one call when you can accept the larger page, or page with \`startFrom\`.`
10458
10668
  )
10459
10669
  };
@@ -10461,7 +10671,7 @@ var folderQuery = ({ client, log }) => ({
10461
10671
  name: "folder_query",
10462
10672
  title: "Folder query (list or get)",
10463
10673
  description: "Read folders. Two modes:\n \u2022 Get: pass `id` \u2192 returns the single folder.\n \u2022 List: omit `id`; pass `parentId` for a folder's direct children (tree navigation) or omit for a flat tenant list. Optionally filter by `userId` or `scope` (`namespace:value`).\nList mode returns `{ data, nextCursor }` (default 10, max 100 per page \u2014 raise it in one call when you can accept the larger page); a non-null `nextCursor` means more remain \u2014 pass it back as `startFrom` to page through all folders. Get mode returns the single folder object.",
10464
- inputSchema: inputSchema14,
10674
+ inputSchema: inputSchema15,
10465
10675
  handler: async (args) => {
10466
10676
  const id = args.id;
10467
10677
  try {
@@ -10491,14 +10701,14 @@ var folderQuery = ({ client, log }) => ({
10491
10701
  var folder_query_default = folderQuery;
10492
10702
 
10493
10703
  // src/tools/folder_create.ts
10494
- import { z as z15 } from "zod";
10495
- var inputSchema15 = {
10496
- name: z15.string().min(1, "name is required").describe("Folder display name."),
10497
- description: z15.string().optional().describe("Optional description of the folder's purpose."),
10498
- parentId: z15.string().optional().describe("Parent folder id \u2014 places the folder under this parent. Omit for the context default root. Create-only."),
10499
- slug: z15.string().optional().describe("Optional stable slug (sibling-unique; idempotency key). Lowercase letters/digits/hyphens. Derived from name when omitted."),
10500
- userId: z15.string().optional().describe("Owning user (Vectros UUID)."),
10501
- scopes: z15.array(z15.string()).optional().describe(
10704
+ import { z as z16 } from "zod";
10705
+ var inputSchema16 = {
10706
+ name: z16.string().min(1, "name is required").describe("Folder display name."),
10707
+ description: z16.string().optional().describe("Optional description of the folder's purpose."),
10708
+ parentId: z16.string().optional().describe("Parent folder id \u2014 places the folder under this parent. Omit for the context default root. Create-only."),
10709
+ slug: z16.string().optional().describe("Optional stable slug (sibling-unique; idempotency key). Lowercase letters/digits/hyphens. Derived from name when omitted."),
10710
+ userId: z16.string().optional().describe("Owning user (Vectros UUID)."),
10711
+ scopes: z16.array(z16.string()).optional().describe(
10502
10712
  'Scope ownership as `namespace:value` entries, at most 2 (e.g. ["org:<uuid>", "group:eng-team"]). `org` and `client` are reserved namespace names, registered like any other; others are namespaces you registered yourself. This is the folder\'s COMPLETE scope declaration and values must come from the credential\'s own identity. An empty array `[]` creates a PRIVATE folder owned by the calling user alone. Omit to stamp the credential\'s full identity \u2014 the default.'
10503
10713
  )
10504
10714
  };
@@ -10506,7 +10716,7 @@ var folderCreate = ({ client, log }) => ({
10506
10716
  name: "folder_create",
10507
10717
  title: "Create a folder",
10508
10718
  description: "Create a folder to organize documents and records. Pass `parentId` to nest it (create-only \u2014 folders cannot be moved later). Idempotent by `slug` within the parent. Requires the key to allow folders:c (and folders:r to receive the existing folder on a collision).",
10509
- inputSchema: inputSchema15,
10719
+ inputSchema: inputSchema16,
10510
10720
  handler: async (args) => {
10511
10721
  try {
10512
10722
  const folder = await client.folders.createFolder({
@@ -10530,16 +10740,16 @@ var folderCreate = ({ client, log }) => ({
10530
10740
  var folder_create_default = folderCreate;
10531
10741
 
10532
10742
  // src/tools/folder_update.ts
10533
- import { z as z16 } from "zod";
10534
- var inputSchema16 = {
10535
- id: z16.string().min(1, "id is required").describe("The Vectros folder id to update."),
10536
- name: z16.string().optional().describe("New folder name. Omit to keep the current name."),
10537
- description: z16.string().optional().describe("New description. Omit to leave unchanged."),
10538
- userId: z16.string().optional().describe("Reassign the owning user (Vectros UUID)."),
10539
- scopes: z16.array(z16.string()).optional().describe(
10743
+ import { z as z17 } from "zod";
10744
+ var inputSchema17 = {
10745
+ id: z17.string().min(1, "id is required").describe("The Vectros folder id to update."),
10746
+ name: z17.string().optional().describe("New folder name. Omit to keep the current name."),
10747
+ description: z17.string().optional().describe("New description. Omit to leave unchanged."),
10748
+ userId: z17.string().optional().describe("Reassign the owning user (Vectros UUID)."),
10749
+ scopes: z17.array(z17.string()).optional().describe(
10540
10750
  'Reassign scope ownership as `namespace:value` entries, at most 2 (e.g. ["org:<uuid>", "group:eng-team"]) \u2014 the COMPLETE new parent set. `org`/`client` are reserved namespace names, registered like any other. Omit to leave ownership unchanged; `[]` clears it (private to the owning user).'
10541
10751
  ),
10542
- expectedVersion: z16.number().int().optional().describe(
10752
+ expectedVersion: z17.number().int().optional().describe(
10543
10753
  "Optimistic concurrency: the version you last read. If the folder changed since, the update is refused as a conflict (re-read and retry). Omit for last-write-wins."
10544
10754
  )
10545
10755
  };
@@ -10547,7 +10757,7 @@ var folderUpdate = ({ client, log }) => ({
10547
10757
  name: "folder_update",
10548
10758
  title: "Update a folder",
10549
10759
  description: "Update a folder's name / description / ownership by id (RFC-7386 merge \u2014 omitted fields preserved). Pass `expectedVersion` (the version you last read) for safe concurrent edits \u2014 a stale update is refused (409). Folders cannot be moved (re-parenting is not supported by the API). Requires the key to allow folders:u.",
10550
- inputSchema: inputSchema16,
10760
+ inputSchema: inputSchema17,
10551
10761
  handler: async (args) => {
10552
10762
  const id = args.id;
10553
10763
  const name = args.name;
@@ -10574,15 +10784,15 @@ var folderUpdate = ({ client, log }) => ({
10574
10784
  var folder_update_default = folderUpdate;
10575
10785
 
10576
10786
  // src/tools/folder_delete.ts
10577
- import { z as z17 } from "zod";
10578
- var inputSchema17 = {
10579
- id: z17.string().min(1, "id is required").describe("The Vectros folder id to delete.")
10787
+ import { z as z18 } from "zod";
10788
+ var inputSchema18 = {
10789
+ id: z18.string().min(1, "id is required").describe("The Vectros folder id to delete.")
10580
10790
  };
10581
10791
  var folderDelete = ({ client, log }) => ({
10582
10792
  name: "folder_delete",
10583
10793
  title: "Delete a folder",
10584
10794
  description: "Permanently delete a folder by id. Requires the key to allow folders:d \u2014 a key without it gets a permission error. Protected folders (e.g. a context root) cannot be deleted.",
10585
- inputSchema: inputSchema17,
10795
+ inputSchema: inputSchema18,
10586
10796
  handler: async (args) => {
10587
10797
  const id = args.id;
10588
10798
  try {
@@ -10598,14 +10808,14 @@ var folderDelete = ({ client, log }) => ({
10598
10808
  var folder_delete_default = folderDelete;
10599
10809
 
10600
10810
  // src/tools/current_identity.ts
10601
- var inputSchema18 = {
10811
+ var inputSchema19 = {
10602
10812
  // No args — current_identity describes the current credential.
10603
10813
  };
10604
10814
  var currentIdentity = ({ log, apiKey, environment }) => ({
10605
10815
  name: "current_identity",
10606
10816
  title: "Current identity (tenant + principal scope)",
10607
- description: "Describe the credential the MCP server is operating under. Returns tenantId, environment (staging|production), principalType (root_key|scoped_key|token), principalKeyId, principalLabel, and (for scoped credentials) allowedActions plus dataScope \u2014 the credential's verb+ownership reach as { userId, scopes[] }, where each scope is a `namespace:value` string (e.g. \"org:<uuid>\"). Note: this does not yet include granted_capabilities (member-lifecycle / forensic-read / context-directory-read / delegate-mint) \u2014 a separate reach dimension a scope clause can carry as of API 0.40.0 that /v1/ping does not report yet, so allowedActions+dataScope may understate a credential's true reach. Also reports mcpServerVersion (this server's own package version) and sdkVersion (the bundled @vectros-ai/sdk version) so a caller can tell what build it's talking to. Use this when the user asks 'what can you do here?', 'what tenant am I in?', or 'what version is this?'. Calls GET /v1/ping under the hood.",
10608
- inputSchema: inputSchema18,
10817
+ description: "Describe the credential the MCP server is operating under. Returns tenantId, environment (staging|production), principalType (root_key|scoped_key|token), principalKeyId, principalLabel, and (for scoped credentials) allowedActions plus dataScope \u2014 the credential's verb+ownership reach as { userId, scopes[] }, where each scope is a `namespace:value` string (e.g. \"org:<uuid>\"). Note: this does not yet include granted_capabilities (member-lifecycle / forensic-read / context-directory-read / delegate-mint, as of API 0.40.0, joined by delegate-principal-stamp in 0.42.0) \u2014 a separate reach dimension a scope clause can carry that /v1/ping does not report yet, so allowedActions+dataScope may understate a credential's true reach. Also reports mcpServerVersion (this server's own package version) and sdkVersion (the bundled @vectros-ai/sdk version) so a caller can tell what build it's talking to. Use this when the user asks 'what can you do here?', 'what tenant am I in?', or 'what version is this?'. Calls GET /v1/ping under the hood.",
10818
+ inputSchema: inputSchema19,
10609
10819
  handler: async () => {
10610
10820
  try {
10611
10821
  const identity = await resolveIdentity({ log, apiKey, environment });
@@ -10621,7 +10831,7 @@ var currentIdentity = ({ log, apiKey, environment }) => ({
10621
10831
  var current_identity_default = currentIdentity;
10622
10832
 
10623
10833
  // src/tools/document_ingest.ts
10624
- import { z as z18 } from "zod";
10834
+ import { z as z19 } from "zod";
10625
10835
  import { readFile, realpath } from "fs/promises";
10626
10836
  import { basename, extname, resolve, relative, isAbsolute } from "path";
10627
10837
  var IngestPathError = class extends Error {
@@ -10696,37 +10906,37 @@ function inferMimeType(filePath) {
10696
10906
  const ext = extname(filePath).toLowerCase();
10697
10907
  return EXT_TO_MIME[ext] ?? "application/octet-stream";
10698
10908
  }
10699
- var inputSchema19 = {
10700
- title: z18.string().min(1, "title is required").describe("Human-readable document title \u2014 appears in search results and the UI."),
10701
- indexMode: z18.enum(["HYBRID", "SEMANTIC", "TEXT", "NONE"]).optional().describe(
10909
+ var inputSchema20 = {
10910
+ title: z19.string().min(1, "title is required").describe("Human-readable document title \u2014 appears in search results and the UI."),
10911
+ indexMode: z19.enum(["HYBRID", "SEMANTIC", "TEXT", "NONE"]).optional().describe(
10702
10912
  "Index strategy. HYBRID (BM25 + dense, default; best for general retrieval), SEMANTIC (dense only; concept-driven queries), TEXT (BM25 only; exact-match / keyword), NONE (store-only / archival \u2014 retrievable by id and structured-field lookup but never in search results). Omit to inherit the bound schema's default."
10703
10913
  ),
10704
- externalId: z18.string().optional().describe(
10914
+ externalId: z19.string().optional().describe(
10705
10915
  'Stable caller-supplied id. Immutable; unique per type within your context. Re-ingesting with the same externalId returns the existing document (idempotent) instead of creating a duplicate \u2014 use it to make ingests safely retryable and as the key other records reference. Mirrors record_create. Receiving the existing document back is a read of it and needs documents:r in addition to documents:c; a create-only key gets an "already exists" error instead of the document.'
10706
10916
  ),
10707
- upsert: z18.boolean().optional().describe(
10917
+ upsert: z19.boolean().optional().describe(
10708
10918
  "When true, re-ingesting an existing externalId OVERWRITES that document and re-indexes the new body (text mode) / re-uploads and re-indexes the new file (file mode), instead of returning the existing one unchanged. This is the curation/re-sync primitive: edit a source, re-ingest with upsert:true, and the search index reflects the new content. Requires the documents:u scope. IMPORTANT: pass the SAME schemaId (and type) you used originally \u2014 externalId is unique WITHIN a type, so omitting schemaId resolves in the untyped namespace and mints a duplicate instead of updating. The response `created` flag confirms which happened (created:true = a new document was minted)."
10709
10919
  ),
10710
- schemaId: z18.string().optional().describe(
10920
+ schemaId: z19.string().optional().describe(
10711
10921
  "Bind this document to a record schema. When set, `payload` is validated against the schema and its lookup fields become directly queryable via document_query (records parity). Resolve a schema id from its type via list_schemas. Omit for an untyped document."
10712
10922
  ),
10713
- payload: z18.record(z18.string(), z18.unknown()).optional().describe(
10923
+ payload: z19.record(z19.string(), z19.unknown()).optional().describe(
10714
10924
  "The document's structured data \u2014 a flat key/value object. With `schemaId`, declared fields are validated and lookup fields indexed; undeclared keys pass through as free-form and are searchable via the hybrid_search `filters` param. Without a schema it is stored as free-form metadata. Every number must fall within the signed 64-bit range \u2014 send a larger whole number as a STRING (stored exactly, exact-match lookup), else the ingest is refused with a 400 naming the field."
10715
10925
  ),
10716
10926
  // Inline text mode (mutually exclusive with filePath):
10717
- text: z18.string().min(1).optional().describe("Text body to ingest inline. Mutually exclusive with filePath. Either text or filePath is required."),
10718
- storeText: z18.boolean().optional().describe(
10927
+ text: z19.string().min(1).optional().describe("Text body to ingest inline. Mutually exclusive with filePath. Either text or filePath is required."),
10928
+ storeText: z19.boolean().optional().describe(
10719
10929
  "FILE MODE ONLY. Whether the uploaded file's EXTRACTED text is retained after indexing (default true), fixed at ingest. true keeps the extracted text retrievable via document_get(includeText:true) and usable by document_ask; false discards it once indexing completes \u2014 search still works and the original file remains downloadable, but includeText returns textAvailable:false and document_ask is unavailable. NOT accepted with `text`: a text-ingested body is the document itself and is ALWAYS retained, so the backend has no storeText knob on the text path \u2014 passing it with `text` is rejected rather than silently ignored."
10720
10930
  ),
10721
10931
  // File upload mode (mutually exclusive with text; stdio-transport-only):
10722
- filePath: z18.string().min(1).optional().describe(
10932
+ filePath: z19.string().min(1).optional().describe(
10723
10933
  "Local filesystem path to upload. Mutually exclusive with text. STDIO TRANSPORT ONLY \u2014 rejected on HTTP transport (remote MCP servers can't read your filesystem; use text mode or call the SDK's uploadDocument directly). Must resolve INSIDE the configured ingest root (VECTROS_MCP_INGEST_ROOT, else the server's working directory); paths that escape it (traversal/absolute/symlink) or match a sensitive pattern are rejected."
10724
10934
  ),
10725
- fileType: z18.string().optional().describe('MIME type of the file (e.g. "application/pdf"). Inferred from filePath extension if omitted.'),
10935
+ fileType: z19.string().optional().describe('MIME type of the file (e.g. "application/pdf"). Inferred from filePath extension if omitted.'),
10726
10936
  // Common (both modes):
10727
- folderId: z18.string().optional().describe("Optional folder to ingest into. Default: tenant root."),
10728
- userId: z18.string().optional().describe("Owning user ID. Optional."),
10729
- scopes: z18.array(z18.string()).optional().describe(
10937
+ folderId: z19.string().optional().describe("Optional folder to ingest into. Default: tenant root."),
10938
+ userId: z19.string().optional().describe("Owning user ID. Optional."),
10939
+ scopes: z19.array(z19.string()).optional().describe(
10730
10940
  "TEXT MODE ONLY. Scope ownership as `namespace:value` entries, at most 2 (e.g. [\"org:<uuid>\", \"group:eng-team\"]). `org` and `client` are reserved namespace names, registered like any other; others are namespaces you registered yourself. This is the document's COMPLETE scope declaration and values must come from the credential's own identity. An empty array `[]` creates a PRIVATE document owned by the calling user alone. Omit to stamp the credential's full identity \u2014 the default. Rejected with `filePath` (file uploads do not accept a scope declaration): a file-uploaded document is stamped with the credential's full identity."
10731
10941
  )
10732
10942
  };
@@ -10734,7 +10944,7 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
10734
10944
  name: "document_ingest",
10735
10945
  title: "Ingest a new document (text body or file upload)",
10736
10946
  description: "Create a new document in your Vectros tenant. Two modes:\n \u2022 Text mode: pass `text` (string body). Single-call. Use for crawled content, notes, generated text.\n \u2022 File mode: pass `filePath` (local path on the MCP server's host machine). STDIO-TRANSPORT ONLY \u2014 rejected on HTTP transport. MCP server reads the bytes, requests a presigned upload URL, and PUTs them. Returns when the upload is accepted (indexStatus: PENDING_INDEX); poll with `document_get` until indexStatus is INDEXED.\nEither `text` or `filePath` must be present; both is an error. Idempotent by `externalId` (re-ingest returns the existing document, not a duplicate \u2014 requires documents:r in addition to documents:c, since being handed the existing document is a read of it). To UPDATE an existing document instead \u2014 re-index an edited body \u2014 pass `upsert:true` with the same `externalId` (and the same `schemaId`); this is the re-sync primitive for keeping a knowledge base current. Pass `schemaId` + `payload` for a typed, lookup-queryable document (records parity). indexMode defaults to HYBRID for untyped documents (omit to inherit a bound schema's default). storeText is a FILE-MODE knob (default true): false discards the uploaded file's extracted text after indexing (search + file download keep working; text retrieval and document_ask do not). Text-mode bodies are always retained, so storeText is not accepted with `text`.",
10737
- inputSchema: inputSchema19,
10947
+ inputSchema: inputSchema20,
10738
10948
  handler: async (args) => {
10739
10949
  const title = args.title;
10740
10950
  const text = args.text;
@@ -10886,29 +11096,29 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
10886
11096
  var document_ingest_default = documentIngest;
10887
11097
 
10888
11098
  // src/tools/lookup_principal.ts
10889
- import { z as z19 } from "zod";
11099
+ import { z as z20 } from "zod";
10890
11100
  var MCP_DEFAULT_LIMIT5 = 10;
10891
11101
  var MCP_MAX_LIMIT5 = 100;
10892
- var inputSchema20 = {
10893
- kind: z19.string().describe(
11102
+ var inputSchema21 = {
11103
+ kind: z20.string().describe(
10894
11104
  'Which principal to look up: "user" (the fixed principal surface), or an entity namespace \u2014 "org", "client" (reserved, registered like any other), or a namespace you registered.'
10895
11105
  ),
10896
- externalId: z19.string().optional().describe(
11106
+ externalId: z20.string().optional().describe(
10897
11107
  "Resolve mode: your own stable identifier for the principal. Returns the single matching principal (with its Vectros UUID), or an empty array if none. The fastest path to the UUID the ownership filters need. Takes precedence if both this and a `field` lookup are supplied."
10898
11108
  ),
10899
- contextId: z19.string().optional().describe(
11109
+ contextId: z20.string().optional().describe(
10900
11110
  "Entity kinds only (not `user`, which is always tenant-wide): the app context to look up entities in, for a namespace registered as context-owned rather than tenant-wide. A context-confined credential's own context is used automatically without this; supply it to name a context explicitly (required for an unconfined/root credential to reach a context-owned namespace). Rejected if the namespace turns out to be tenant-wide."
10901
11111
  ),
10902
11112
  // Lookup-mode args — provide `field` plus EXACTLY ONE of: value | from+to | prefix.
10903
- type: z19.string().optional().describe('Lookup mode: the identity schema\'s record type (e.g. "person_v1"). Required with `field`.'),
10904
- field: z19.string().optional().describe('Lookup mode: name of the schema-declared lookup field to query by (e.g. "email").'),
10905
- value: z19.string().optional().describe("Lookup mode (equality): exact-match value for `field`. Works on sensitive fields."),
10906
- from: z19.string().optional().describe("Lookup mode (range): inclusive lower bound; requires `to`. Non-sensitive fields only."),
10907
- to: z19.string().optional().describe("Lookup mode (range): inclusive upper bound; requires `from`."),
10908
- prefix: z19.string().optional().describe("Lookup mode (prefix): match values starting with this. Range-enabled string fields only."),
10909
- order: z19.enum(["asc", "desc"]).optional().describe("Lookup mode: sort direction by the looked-up field. `asc` (default) or `desc`."),
10910
- startFrom: z19.string().optional().describe("Lookup mode: pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next."),
10911
- limit: z19.number().int().min(1).max(MCP_MAX_LIMIT5).optional().describe(
11113
+ type: z20.string().optional().describe('Lookup mode: the identity schema\'s record type (e.g. "person_v1"). Required with `field`.'),
11114
+ field: z20.string().optional().describe('Lookup mode: name of the schema-declared lookup field to query by (e.g. "email").'),
11115
+ value: z20.string().optional().describe("Lookup mode (equality): exact-match value for `field`. Works on sensitive fields."),
11116
+ from: z20.string().optional().describe("Lookup mode (range): inclusive lower bound; requires `to`. Non-sensitive fields only."),
11117
+ to: z20.string().optional().describe("Lookup mode (range): inclusive upper bound; requires `from`."),
11118
+ prefix: z20.string().optional().describe("Lookup mode (prefix): match values starting with this. Range-enabled string fields only."),
11119
+ order: z20.enum(["asc", "desc"]).optional().describe("Lookup mode: sort direction by the looked-up field. `asc` (default) or `desc`."),
11120
+ startFrom: z20.string().optional().describe("Lookup mode: pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next."),
11121
+ limit: z20.number().int().min(1).max(MCP_MAX_LIMIT5).optional().describe(
10912
11122
  `Max principals per page. Defaults to ${MCP_DEFAULT_LIMIT5}; raise up to ${MCP_MAX_LIMIT5} (the principals API max) in one call when you can accept the payload, or page with \`startFrom\`.`
10913
11123
  )
10914
11124
  };
@@ -10916,7 +11126,7 @@ var lookupPrincipal = ({ client, log }) => ({
10916
11126
  name: "lookup_principal",
10917
11127
  title: "Look up a user identity or a namespaced identity entity",
10918
11128
  description: "Resolve a user, or an identity entity in a namespace (org/client/one you registered). Two modes:\n \u2022 Resolve by your own id: pass `externalId` \u2192 the matching principal incl. its Vectros UUID (the id the ownership filters on record_query / hybrid_search / rag_ask expect).\n \u2022 Lookup by a schema field: pass `type` and `field` plus exactly one of `value` (exact), `from`+`to` (range), or `prefix`. Sensitive-field-safe. (If both `externalId` and a `field` lookup are given, `externalId` wins.) For an entity kind, `contextId` names a specific app context when the namespace is context-owned rather than tenant-wide; a context-confined credential's own context is used automatically without it. Returns a `{ data, nextCursor }` page (default 10, max 100 \u2014 raise it in one call when you can accept the payload); a non-null `nextCursor` means more remain \u2014 pass it back as `startFrom`. Read-only \u2014 does not create or modify identities.",
10919
- inputSchema: inputSchema20,
11129
+ inputSchema: inputSchema21,
10920
11130
  handler: async (args) => {
10921
11131
  const kind = args.kind;
10922
11132
  const isUser = kind === "user";
@@ -10990,17 +11200,17 @@ var lookupPrincipal = ({ client, log }) => ({
10990
11200
  var lookup_principal_default = lookupPrincipal;
10991
11201
 
10992
11202
  // src/tools/version_history.ts
10993
- import { z as z20 } from "zod";
10994
- var inputSchema21 = {
10995
- resourceType: z20.enum(["record", "document"]).describe("Which kind of entity the id refers to: a record or a document."),
10996
- id: z20.string().min(1, "id is required").describe("The Vectros id of the record or document whose history you want."),
10997
- startFrom: z20.string().optional().describe("Pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch older entries.")
11203
+ import { z as z21 } from "zod";
11204
+ var inputSchema22 = {
11205
+ resourceType: z21.enum(["record", "document"]).describe("Which kind of entity the id refers to: a record or a document."),
11206
+ id: z21.string().min(1, "id is required").describe("The Vectros id of the record or document whose history you want."),
11207
+ startFrom: z21.string().optional().describe("Pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch older entries.")
10998
11208
  };
10999
11209
  var versionHistory = ({ client, log }) => ({
11000
11210
  name: "version_history",
11001
11211
  title: "Version history (record or document)",
11002
11212
  description: "Read the audit/version trail (CREATE/UPDATE/DELETE, with actor, timestamp, and diff) for a single record or document. Pass `resourceType` (record|document) and `id`. Returns `{ data, nextCursor }`; pass `nextCursor` back as `startFrom` to page through older entries. Entities without audit history (untyped) return an empty trail. Read-only.",
11003
- inputSchema: inputSchema21,
11213
+ inputSchema: inputSchema22,
11004
11214
  handler: async (args) => {
11005
11215
  const resourceType = args.resourceType;
11006
11216
  const id = args.id;
@@ -11027,6 +11237,7 @@ var TOOL_NAMES = [
11027
11237
  "hybrid_search",
11028
11238
  "record_query",
11029
11239
  "record_get",
11240
+ "record_batch_get",
11030
11241
  "record_create",
11031
11242
  "record_update",
11032
11243
  "record_delete",
@@ -11052,6 +11263,7 @@ var ALL_TOOL_FACTORIES = {
11052
11263
  hybrid_search: hybrid_search_default,
11053
11264
  record_query: record_query_default,
11054
11265
  record_get: record_get_default,
11266
+ record_batch_get: record_batch_get_default,
11055
11267
  record_create: record_create_default,
11056
11268
  record_update: record_update_default,
11057
11269
  record_delete: record_delete_default,
@@ -11093,7 +11305,7 @@ var identityResource = ({ log, apiKey, environment }) => ({
11093
11305
  name: "identity",
11094
11306
  uri: "vectros://identity",
11095
11307
  title: "Current identity (tenant + principal scope)",
11096
- description: "The tenant + principal scope the MCP server is authenticated as. Returns the same payload as the `current_identity` tool: status, tenantId, environment, principalType, principalKeyId, principalLabel, (for scoped credentials) allowedActions + dataScope ({ userId, scopes[] }). Note: this does not yet include granted_capabilities (member-lifecycle / forensic-read / context-directory-read / delegate-mint) \u2014 a separate reach dimension a scope clause can carry as of API 0.40.0 that /v1/ping does not report yet, so allowedActions+dataScope may understate a credential's true reach. Also reports mcpServerVersion and sdkVersion (this build's own version and the bundled @vectros-ai/sdk version). The /v1/ping backing call ships the extended shape today; the version fields are always client-derived.",
11308
+ description: "The tenant + principal scope the MCP server is authenticated as. Returns the same payload as the `current_identity` tool: status, tenantId, environment, principalType, principalKeyId, principalLabel, (for scoped credentials) allowedActions + dataScope ({ userId, scopes[] }). Note: this does not yet include granted_capabilities (member-lifecycle / forensic-read / context-directory-read / delegate-mint, as of API 0.40.0, joined by delegate-principal-stamp in 0.42.0) \u2014 a separate reach dimension a scope clause can carry that /v1/ping does not report yet, so allowedActions+dataScope may understate a credential's true reach. Also reports mcpServerVersion and sdkVersion (this build's own version and the bundled @vectros-ai/sdk version). The /v1/ping backing call ships the extended shape today; the version fields are always client-derived.",
11097
11309
  mimeType: "application/json",
11098
11310
  read: async () => {
11099
11311
  const identity = await resolveIdentity({ log, apiKey, environment });
@@ -11112,7 +11324,7 @@ var ALL_RESOURCE_FACTORIES = {
11112
11324
  };
11113
11325
 
11114
11326
  // src/zod-to-json-schema.ts
11115
- import { z as z21 } from "zod";
11327
+ import { z as z22 } from "zod";
11116
11328
  function zodShapeToJsonSchema(shape) {
11117
11329
  const properties = {};
11118
11330
  const required = [];
@@ -11127,40 +11339,40 @@ function zodShapeToJsonSchema(shape) {
11127
11339
  function zodTypeToJsonSchema(schema) {
11128
11340
  const description = schema.description;
11129
11341
  let current = schema;
11130
- while (current instanceof z21.ZodOptional || current instanceof z21.ZodDefault || current instanceof z21.ZodNullable) {
11342
+ while (current instanceof z22.ZodOptional || current instanceof z22.ZodDefault || current instanceof z22.ZodNullable) {
11131
11343
  current = current._def.innerType;
11132
11344
  }
11133
11345
  const base = description ? { description } : {};
11134
- if (current instanceof z21.ZodString) {
11346
+ if (current instanceof z22.ZodString) {
11135
11347
  return { ...base, type: "string" };
11136
11348
  }
11137
- if (current instanceof z21.ZodNumber) {
11349
+ if (current instanceof z22.ZodNumber) {
11138
11350
  return { ...base, type: "number" };
11139
11351
  }
11140
- if (current instanceof z21.ZodBoolean) {
11352
+ if (current instanceof z22.ZodBoolean) {
11141
11353
  return { ...base, type: "boolean" };
11142
11354
  }
11143
- if (current instanceof z21.ZodEnum) {
11355
+ if (current instanceof z22.ZodEnum) {
11144
11356
  return {
11145
11357
  ...base,
11146
11358
  type: "string",
11147
11359
  enum: current.options
11148
11360
  };
11149
11361
  }
11150
- if (current instanceof z21.ZodArray) {
11362
+ if (current instanceof z22.ZodArray) {
11151
11363
  return {
11152
11364
  ...base,
11153
11365
  type: "array",
11154
11366
  items: zodTypeToJsonSchema(current.element)
11155
11367
  };
11156
11368
  }
11157
- if (current instanceof z21.ZodObject) {
11369
+ if (current instanceof z22.ZodObject) {
11158
11370
  return {
11159
11371
  ...base,
11160
11372
  ...zodShapeToJsonSchema(current.shape)
11161
11373
  };
11162
11374
  }
11163
- if (current instanceof z21.ZodRecord) {
11375
+ if (current instanceof z22.ZodRecord) {
11164
11376
  const valueType = current._def.valueType;
11165
11377
  return {
11166
11378
  ...base,
@@ -11284,7 +11496,7 @@ var VectrosMCPServer = class {
11284
11496
  if (!tool) {
11285
11497
  result = toolError(req.params.name ?? "unknown", new Error("No such tool."));
11286
11498
  } else {
11287
- const parsed = z22.object(tool.inputSchema).strict().safeParse(req.params.arguments ?? {});
11499
+ const parsed = z23.object(tool.inputSchema).strict().safeParse(req.params.arguments ?? {});
11288
11500
  if (!parsed.success) {
11289
11501
  result = toolError(tool.name, new Error(formatArgError(tool, parsed.error)));
11290
11502
  } else {