@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/CHANGELOG.md +42 -0
- package/README.md +22 -6
- package/dist/cli-http.js +422 -210
- package/dist/cli-http.js.map +1 -1
- package/dist/cli-http.mjs +422 -210
- package/dist/cli-http.mjs.map +1 -1
- package/dist/cli.js +422 -210
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +422 -210
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +422 -210
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +422 -210
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -2515,7 +2515,7 @@ var AuthClient = class {
|
|
|
2515
2515
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/admin/keys/scoped");
|
|
2516
2516
|
}
|
|
2517
2517
|
/**
|
|
2518
|
-
* 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
|
|
2518
|
+
* 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.
|
|
2519
2519
|
*
|
|
2520
2520
|
* @param {Vectros.CreateScopedKeyRequest} request
|
|
2521
2521
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4011,7 +4011,7 @@ var AuthClient = class {
|
|
|
4011
4011
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/usage");
|
|
4012
4012
|
}
|
|
4013
4013
|
/**
|
|
4014
|
-
* 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.
|
|
4014
|
+
* 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.
|
|
4015
4015
|
*
|
|
4016
4016
|
* @param {Vectros.GetIssuerRequest} request
|
|
4017
4017
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4068,6 +4068,73 @@ var AuthClient = class {
|
|
|
4068
4068
|
}
|
|
4069
4069
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/auth/issuers/{issuerId}");
|
|
4070
4070
|
}
|
|
4071
|
+
/**
|
|
4072
|
+
* 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.
|
|
4073
|
+
*
|
|
4074
|
+
* @param {Vectros.IssuerUpdateRequest} request
|
|
4075
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4076
|
+
*
|
|
4077
|
+
* @throws {@link Vectros.BadRequestError}
|
|
4078
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
4079
|
+
* @throws {@link Vectros.NotFoundError}
|
|
4080
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4081
|
+
*
|
|
4082
|
+
* @example
|
|
4083
|
+
* await client.auth.updateIssuer({
|
|
4084
|
+
* issuerId: "auth0-prod"
|
|
4085
|
+
* })
|
|
4086
|
+
*/
|
|
4087
|
+
updateIssuer(request, requestOptions) {
|
|
4088
|
+
return HttpResponsePromise.fromPromise(this.__updateIssuer(request, requestOptions));
|
|
4089
|
+
}
|
|
4090
|
+
async __updateIssuer(request, requestOptions) {
|
|
4091
|
+
const { issuerId, ..._body } = request;
|
|
4092
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4093
|
+
const _headers = mergeHeaders(
|
|
4094
|
+
_authRequest.headers,
|
|
4095
|
+
this._options?.headers,
|
|
4096
|
+
requestOptions?.headers
|
|
4097
|
+
);
|
|
4098
|
+
const _response = await fetcher({
|
|
4099
|
+
url: url_exports.join(
|
|
4100
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4101
|
+
`v1/auth/issuers/${url_exports.encodePathParam(issuerId)}`
|
|
4102
|
+
),
|
|
4103
|
+
method: "PUT",
|
|
4104
|
+
headers: _headers,
|
|
4105
|
+
contentType: "application/json",
|
|
4106
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4107
|
+
requestType: "json",
|
|
4108
|
+
body: _body,
|
|
4109
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4110
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4111
|
+
abortSignal: requestOptions?.abortSignal,
|
|
4112
|
+
fetchFn: this._options?.fetch,
|
|
4113
|
+
logging: this._options.logging
|
|
4114
|
+
});
|
|
4115
|
+
if (_response.ok) {
|
|
4116
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4117
|
+
}
|
|
4118
|
+
if (_response.error.reason === "status-code") {
|
|
4119
|
+
switch (_response.error.statusCode) {
|
|
4120
|
+
case 400:
|
|
4121
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4122
|
+
case 403:
|
|
4123
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4124
|
+
case 404:
|
|
4125
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4126
|
+
case 429:
|
|
4127
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4128
|
+
default:
|
|
4129
|
+
throw new VectrosError({
|
|
4130
|
+
statusCode: _response.error.statusCode,
|
|
4131
|
+
body: _response.error.body,
|
|
4132
|
+
rawResponse: _response.rawResponse
|
|
4133
|
+
});
|
|
4134
|
+
}
|
|
4135
|
+
}
|
|
4136
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v1/auth/issuers/{issuerId}");
|
|
4137
|
+
}
|
|
4071
4138
|
/**
|
|
4072
4139
|
* 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.
|
|
4073
4140
|
*
|
|
@@ -4138,7 +4205,7 @@ var AuthClient = class {
|
|
|
4138
4205
|
);
|
|
4139
4206
|
}
|
|
4140
4207
|
/**
|
|
4141
|
-
* 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.
|
|
4208
|
+
* 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.
|
|
4142
4209
|
*
|
|
4143
4210
|
* @param {Vectros.ListIssuersRequest} request
|
|
4144
4211
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4195,7 +4262,7 @@ var AuthClient = class {
|
|
|
4195
4262
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/auth/issuers");
|
|
4196
4263
|
}
|
|
4197
4264
|
/**
|
|
4198
|
-
* 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`.
|
|
4265
|
+
* 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`.
|
|
4199
4266
|
*
|
|
4200
4267
|
* @param {Vectros.IssuerRequest} request
|
|
4201
4268
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4380,6 +4447,7 @@ var AuthClient = class {
|
|
|
4380
4447
|
*
|
|
4381
4448
|
* @throws {@link Vectros.BadRequestError}
|
|
4382
4449
|
* @throws {@link Vectros.ForbiddenError}
|
|
4450
|
+
* @throws {@link Vectros.NotFoundError}
|
|
4383
4451
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
4384
4452
|
*
|
|
4385
4453
|
* @example
|
|
@@ -4433,6 +4501,8 @@ var AuthClient = class {
|
|
|
4433
4501
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4434
4502
|
case 403:
|
|
4435
4503
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4504
|
+
case 404:
|
|
4505
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4436
4506
|
case 429:
|
|
4437
4507
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4438
4508
|
default:
|
|
@@ -4446,7 +4516,7 @@ var AuthClient = class {
|
|
|
4446
4516
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/auth/token");
|
|
4447
4517
|
}
|
|
4448
4518
|
/**
|
|
4449
|
-
* Invite a new member to one of your app contexts by email
|
|
4519
|
+
* 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.
|
|
4450
4520
|
*
|
|
4451
4521
|
* @param {Vectros.CreateInviteRequest} request
|
|
4452
4522
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4517,7 +4587,7 @@ var AuthClient = class {
|
|
|
4517
4587
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/users/invite");
|
|
4518
4588
|
}
|
|
4519
4589
|
/**
|
|
4520
|
-
* 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.
|
|
4590
|
+
* 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.
|
|
4521
4591
|
*
|
|
4522
4592
|
* @param {Vectros.CreateInviteRequest} request
|
|
4523
4593
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4584,6 +4654,83 @@ var AuthClient = class {
|
|
|
4584
4654
|
}
|
|
4585
4655
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/users/invite/resend");
|
|
4586
4656
|
}
|
|
4657
|
+
/**
|
|
4658
|
+
* 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).
|
|
4659
|
+
*
|
|
4660
|
+
* **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.
|
|
4661
|
+
*
|
|
4662
|
+
* **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.
|
|
4663
|
+
*
|
|
4664
|
+
* **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.
|
|
4665
|
+
*
|
|
4666
|
+
* 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.
|
|
4667
|
+
*
|
|
4668
|
+
* @param {Record<string, unknown>} request
|
|
4669
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4670
|
+
*
|
|
4671
|
+
* @throws {@link Vectros.BadRequestError}
|
|
4672
|
+
* @throws {@link Vectros.UnauthorizedError}
|
|
4673
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
4674
|
+
* @throws {@link Vectros.ConflictError}
|
|
4675
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4676
|
+
*
|
|
4677
|
+
* @example
|
|
4678
|
+
* await client.auth.assumeToken({
|
|
4679
|
+
* "scope:org": "orgB"
|
|
4680
|
+
* })
|
|
4681
|
+
*/
|
|
4682
|
+
assumeToken(request, requestOptions) {
|
|
4683
|
+
return HttpResponsePromise.fromPromise(this.__assumeToken(request, requestOptions));
|
|
4684
|
+
}
|
|
4685
|
+
async __assumeToken(request, requestOptions) {
|
|
4686
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4687
|
+
const _headers = mergeHeaders(
|
|
4688
|
+
_authRequest.headers,
|
|
4689
|
+
this._options?.headers,
|
|
4690
|
+
requestOptions?.headers
|
|
4691
|
+
);
|
|
4692
|
+
const _response = await fetcher({
|
|
4693
|
+
url: url_exports.join(
|
|
4694
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4695
|
+
"v1/auth/token/assume"
|
|
4696
|
+
),
|
|
4697
|
+
method: "POST",
|
|
4698
|
+
headers: _headers,
|
|
4699
|
+
contentType: "application/json",
|
|
4700
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4701
|
+
requestType: "json",
|
|
4702
|
+
body: request,
|
|
4703
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4704
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4705
|
+
abortSignal: requestOptions?.abortSignal,
|
|
4706
|
+
fetchFn: this._options?.fetch,
|
|
4707
|
+
logging: this._options.logging
|
|
4708
|
+
});
|
|
4709
|
+
if (_response.ok) {
|
|
4710
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4711
|
+
}
|
|
4712
|
+
if (_response.error.reason === "status-code") {
|
|
4713
|
+
switch (_response.error.statusCode) {
|
|
4714
|
+
case 400:
|
|
4715
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4716
|
+
case 401:
|
|
4717
|
+
throw new UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
4718
|
+
case 403:
|
|
4719
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4720
|
+
case 409:
|
|
4721
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
4722
|
+
case 429:
|
|
4723
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4724
|
+
default:
|
|
4725
|
+
throw new VectrosError({
|
|
4726
|
+
statusCode: _response.error.statusCode,
|
|
4727
|
+
body: _response.error.body,
|
|
4728
|
+
rawResponse: _response.rawResponse
|
|
4729
|
+
});
|
|
4730
|
+
}
|
|
4731
|
+
}
|
|
4732
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/auth/token/assume");
|
|
4733
|
+
}
|
|
4587
4734
|
/**
|
|
4588
4735
|
* 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.
|
|
4589
4736
|
*
|
|
@@ -4661,9 +4808,9 @@ var ComplianceClient = class {
|
|
|
4661
4808
|
* @param {Vectros.ErasureRequest} request
|
|
4662
4809
|
* @param {ComplianceClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4663
4810
|
*
|
|
4811
|
+
* @throws {@link Vectros.BadRequestError}
|
|
4664
4812
|
* @throws {@link Vectros.ForbiddenError}
|
|
4665
4813
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
4666
|
-
* @throws {@link Vectros.NotImplementedError}
|
|
4667
4814
|
*
|
|
4668
4815
|
* @example
|
|
4669
4816
|
* await client.compliance.createErasureRequest({
|
|
@@ -4702,12 +4849,12 @@ var ComplianceClient = class {
|
|
|
4702
4849
|
}
|
|
4703
4850
|
if (_response.error.reason === "status-code") {
|
|
4704
4851
|
switch (_response.error.statusCode) {
|
|
4852
|
+
case 400:
|
|
4853
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4705
4854
|
case 403:
|
|
4706
4855
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4707
4856
|
case 429:
|
|
4708
4857
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4709
|
-
case 501:
|
|
4710
|
-
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
4711
4858
|
default:
|
|
4712
4859
|
throw new VectrosError({
|
|
4713
4860
|
statusCode: _response.error.statusCode,
|
|
@@ -4726,7 +4873,6 @@ var ComplianceClient = class {
|
|
|
4726
4873
|
*
|
|
4727
4874
|
* @throws {@link Vectros.ForbiddenError}
|
|
4728
4875
|
* @throws {@link Vectros.NotFoundError}
|
|
4729
|
-
* @throws {@link Vectros.NotImplementedError}
|
|
4730
4876
|
*
|
|
4731
4877
|
* @example
|
|
4732
4878
|
* await client.compliance.getErasureRequest({
|
|
@@ -4767,8 +4913,6 @@ var ComplianceClient = class {
|
|
|
4767
4913
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4768
4914
|
case 404:
|
|
4769
4915
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4770
|
-
case 501:
|
|
4771
|
-
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
4772
4916
|
default:
|
|
4773
4917
|
throw new VectrosError({
|
|
4774
4918
|
statusCode: _response.error.statusCode,
|
|
@@ -5316,7 +5460,21 @@ var DocumentsClient = class {
|
|
|
5316
5460
|
return HttpResponsePromise.fromPromise(this.__lookupDocuments(request, requestOptions));
|
|
5317
5461
|
}
|
|
5318
5462
|
async __lookupDocuments(request, requestOptions) {
|
|
5319
|
-
const {
|
|
5463
|
+
const {
|
|
5464
|
+
type: type_,
|
|
5465
|
+
field,
|
|
5466
|
+
value,
|
|
5467
|
+
from: from_,
|
|
5468
|
+
to,
|
|
5469
|
+
prefix,
|
|
5470
|
+
sortFrom,
|
|
5471
|
+
sortTo,
|
|
5472
|
+
startFrom,
|
|
5473
|
+
limit,
|
|
5474
|
+
order,
|
|
5475
|
+
userId,
|
|
5476
|
+
scope
|
|
5477
|
+
} = request;
|
|
5320
5478
|
const _queryParams = {
|
|
5321
5479
|
type: type_,
|
|
5322
5480
|
field,
|
|
@@ -5324,6 +5482,8 @@ var DocumentsClient = class {
|
|
|
5324
5482
|
from: from_,
|
|
5325
5483
|
to,
|
|
5326
5484
|
prefix,
|
|
5485
|
+
sortFrom,
|
|
5486
|
+
sortTo,
|
|
5327
5487
|
startFrom,
|
|
5328
5488
|
limit,
|
|
5329
5489
|
order: order != null ? order : void 0,
|
|
@@ -6608,7 +6768,7 @@ var IdentityClient = class {
|
|
|
6608
6768
|
);
|
|
6609
6769
|
}
|
|
6610
6770
|
/**
|
|
6611
|
-
* Retrieves a single scope-namespace registration by name.
|
|
6771
|
+
* Retrieves a single scope-namespace registration by name.
|
|
6612
6772
|
*
|
|
6613
6773
|
* @param {Vectros.GetNamespaceRequest} request
|
|
6614
6774
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -6801,7 +6961,7 @@ var IdentityClient = class {
|
|
|
6801
6961
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v1/namespaces/{namespace}");
|
|
6802
6962
|
}
|
|
6803
6963
|
/**
|
|
6804
|
-
* Returns the scope namespaces in your account
|
|
6964
|
+
* Returns the scope namespaces registered in your account. Returns a `{data, nextCursor}` envelope.
|
|
6805
6965
|
*
|
|
6806
6966
|
* @param {Vectros.ListNamespacesRequest} request
|
|
6807
6967
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -6852,7 +7012,7 @@ var IdentityClient = class {
|
|
|
6852
7012
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/namespaces");
|
|
6853
7013
|
}
|
|
6854
7014
|
/**
|
|
6855
|
-
* 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
|
|
7015
|
+
* 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.
|
|
6856
7016
|
*
|
|
6857
7017
|
* @param {Vectros.RegisterNamespaceRequest} request
|
|
6858
7018
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -6922,7 +7082,7 @@ var IdentityClient = class {
|
|
|
6922
7082
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/namespaces");
|
|
6923
7083
|
}
|
|
6924
7084
|
/**
|
|
6925
|
-
* 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.
|
|
7085
|
+
* 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.
|
|
6926
7086
|
*
|
|
6927
7087
|
* @param {Vectros.ListUsersRequest} request
|
|
6928
7088
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -6987,7 +7147,7 @@ var IdentityClient = class {
|
|
|
6987
7147
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/users");
|
|
6988
7148
|
}
|
|
6989
7149
|
/**
|
|
6990
|
-
* 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.
|
|
7150
|
+
* 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`.
|
|
6991
7151
|
*
|
|
6992
7152
|
* @param {Vectros.CreateUserRequest} request
|
|
6993
7153
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -7111,7 +7271,7 @@ var IdentityClient = class {
|
|
|
7111
7271
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/users/{id}");
|
|
7112
7272
|
}
|
|
7113
7273
|
/**
|
|
7114
|
-
* 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.
|
|
7274
|
+
* 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.
|
|
7115
7275
|
*
|
|
7116
7276
|
* @param {Vectros.UpdateUserRequest} request
|
|
7117
7277
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -7178,7 +7338,7 @@ var IdentityClient = class {
|
|
|
7178
7338
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v1/users/{id}");
|
|
7179
7339
|
}
|
|
7180
7340
|
/**
|
|
7181
|
-
* 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.
|
|
7341
|
+
* 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.
|
|
7182
7342
|
*
|
|
7183
7343
|
* @param {Vectros.DeleteUserRequest} request
|
|
7184
7344
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -7239,7 +7399,7 @@ var IdentityClient = class {
|
|
|
7239
7399
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v1/users/{id}");
|
|
7240
7400
|
}
|
|
7241
7401
|
/**
|
|
7242
|
-
* 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.
|
|
7402
|
+
* 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.
|
|
7243
7403
|
*
|
|
7244
7404
|
* @param {Vectros.IdentityLookupRequest} request
|
|
7245
7405
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -7682,14 +7842,14 @@ var RecordsClient = class {
|
|
|
7682
7842
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
7683
7843
|
}
|
|
7684
7844
|
/**
|
|
7685
|
-
*
|
|
7845
|
+
* 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).
|
|
7686
7846
|
*
|
|
7687
7847
|
* @param {Vectros.BatchGetRequest} request
|
|
7688
7848
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7689
7849
|
*
|
|
7850
|
+
* @throws {@link Vectros.BadRequestError}
|
|
7690
7851
|
* @throws {@link Vectros.ForbiddenError}
|
|
7691
7852
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
7692
|
-
* @throws {@link Vectros.NotImplementedError}
|
|
7693
7853
|
*
|
|
7694
7854
|
* @example
|
|
7695
7855
|
* await client.records.batchGetRecords()
|
|
@@ -7726,12 +7886,12 @@ var RecordsClient = class {
|
|
|
7726
7886
|
}
|
|
7727
7887
|
if (_response.error.reason === "status-code") {
|
|
7728
7888
|
switch (_response.error.statusCode) {
|
|
7889
|
+
case 400:
|
|
7890
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
7729
7891
|
case 403:
|
|
7730
7892
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7731
7893
|
case 429:
|
|
7732
7894
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7733
|
-
case 501:
|
|
7734
|
-
throw new NotImplementedError(_response.error.body, _response.rawResponse);
|
|
7735
7895
|
default:
|
|
7736
7896
|
throw new VectrosError({
|
|
7737
7897
|
statusCode: _response.error.statusCode,
|
|
@@ -8545,7 +8705,7 @@ var SchemasClient = class {
|
|
|
8545
8705
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
8546
8706
|
}
|
|
8547
8707
|
/**
|
|
8548
|
-
* 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
|
|
8708
|
+
* 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.
|
|
8549
8709
|
*
|
|
8550
8710
|
* @param {Vectros.ListSchemasRequest} request
|
|
8551
8711
|
* @param {SchemasClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -8833,6 +8993,7 @@ var SchemasClient = class {
|
|
|
8833
8993
|
* @param {Vectros.DeleteSchemaRequest} request
|
|
8834
8994
|
* @param {SchemasClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8835
8995
|
*
|
|
8996
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
8836
8997
|
* @throws {@link Vectros.NotFoundError}
|
|
8837
8998
|
* @throws {@link Vectros.ConflictError}
|
|
8838
8999
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
@@ -8872,6 +9033,8 @@ var SchemasClient = class {
|
|
|
8872
9033
|
}
|
|
8873
9034
|
if (_response.error.reason === "status-code") {
|
|
8874
9035
|
switch (_response.error.statusCode) {
|
|
9036
|
+
case 403:
|
|
9037
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
8875
9038
|
case 404:
|
|
8876
9039
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
8877
9040
|
case 409:
|
|
@@ -9081,7 +9244,7 @@ var logging;
|
|
|
9081
9244
|
|
|
9082
9245
|
// src/server.ts
|
|
9083
9246
|
var import_types3 = require("@modelcontextprotocol/sdk/types.js");
|
|
9084
|
-
var
|
|
9247
|
+
var import_zod23 = require("zod");
|
|
9085
9248
|
|
|
9086
9249
|
// src/auth.ts
|
|
9087
9250
|
var KEY_RE = /^(sk|ssk|st)_(live|test)_/;
|
|
@@ -9125,8 +9288,8 @@ function warnOnSuboptimalKey(key, log) {
|
|
|
9125
9288
|
|
|
9126
9289
|
// src/build-info.ts
|
|
9127
9290
|
var BUILD_INFO = {
|
|
9128
|
-
mcpServer: true ? "0.
|
|
9129
|
-
sdk: true ? "0.
|
|
9291
|
+
mcpServer: true ? "0.16.1" : "dev",
|
|
9292
|
+
sdk: true ? "0.42.0" : "dev"
|
|
9130
9293
|
};
|
|
9131
9294
|
function formatBuildInfo() {
|
|
9132
9295
|
return `vectros-mcp-server ${BUILD_INFO.mcpServer} (sdk ${BUILD_INFO.sdk})`;
|
|
@@ -9811,23 +9974,70 @@ var recordGet = ({ client, log }) => ({
|
|
|
9811
9974
|
});
|
|
9812
9975
|
var record_get_default = recordGet;
|
|
9813
9976
|
|
|
9814
|
-
// src/tools/
|
|
9977
|
+
// src/tools/record_batch_get.ts
|
|
9815
9978
|
var import_zod4 = require("zod");
|
|
9979
|
+
var MAX_PAYLOAD_CHARS2 = 32e3;
|
|
9980
|
+
var MCP_MAX_IDS = 100;
|
|
9816
9981
|
var inputSchema4 = {
|
|
9817
|
-
|
|
9818
|
-
|
|
9982
|
+
ids: import_zod4.z.array(import_zod4.z.string()).min(1).max(MCP_MAX_IDS).describe(
|
|
9983
|
+
`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.`
|
|
9984
|
+
)
|
|
9985
|
+
};
|
|
9986
|
+
var recordBatchGet = ({ client, log }) => ({
|
|
9987
|
+
name: "record_batch_get",
|
|
9988
|
+
title: "Get multiple records by id in one call",
|
|
9989
|
+
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.",
|
|
9990
|
+
inputSchema: inputSchema4,
|
|
9991
|
+
handler: async (args) => {
|
|
9992
|
+
const ids = args.ids;
|
|
9993
|
+
try {
|
|
9994
|
+
const response = await client.records.batchGetRecords({ ids });
|
|
9995
|
+
const records = response.data ?? [];
|
|
9996
|
+
const data = records.map((record) => {
|
|
9997
|
+
const item = { ...record };
|
|
9998
|
+
if (record.payload !== void 0) {
|
|
9999
|
+
const json = JSON.stringify(record.payload);
|
|
10000
|
+
if (json.length > MAX_PAYLOAD_CHARS2) {
|
|
10001
|
+
delete item.payload;
|
|
10002
|
+
item.payloadPreview = json.slice(0, MAX_PAYLOAD_CHARS2);
|
|
10003
|
+
item.payloadTruncated = true;
|
|
10004
|
+
item.payloadTotalChars = json.length;
|
|
10005
|
+
}
|
|
10006
|
+
}
|
|
10007
|
+
return item;
|
|
10008
|
+
});
|
|
10009
|
+
const returnedIds = new Set(records.map((r) => r.id));
|
|
10010
|
+
const missingIds = ids.filter((id) => !returnedIds.has(id));
|
|
10011
|
+
log.debug(
|
|
10012
|
+
{ tool: "record_batch_get", requested: ids.length, returned: data.length, missing: missingIds.length },
|
|
10013
|
+
"record_batch_get ok"
|
|
10014
|
+
);
|
|
10015
|
+
return { content: [{ type: "text", text: JSON.stringify({ data, missingIds }, null, 2) }] };
|
|
10016
|
+
} catch (err) {
|
|
10017
|
+
log.warn({ tool: "record_batch_get", idsCount: ids?.length, err: String(err) }, "record_batch_get failed");
|
|
10018
|
+
return toolError("record_batch_get", err);
|
|
10019
|
+
}
|
|
10020
|
+
}
|
|
10021
|
+
});
|
|
10022
|
+
var record_batch_get_default = recordBatchGet;
|
|
10023
|
+
|
|
10024
|
+
// src/tools/record_create.ts
|
|
10025
|
+
var import_zod5 = require("zod");
|
|
10026
|
+
var inputSchema5 = {
|
|
10027
|
+
type: import_zod5.z.string().min(1, "type is required").describe('Record type / schema name (e.g. "task"). Must match an existing schema \u2014 see list_schemas.'),
|
|
10028
|
+
fields: import_zod5.z.record(import_zod5.z.string(), import_zod5.z.unknown()).describe(
|
|
9819
10029
|
"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."
|
|
9820
10030
|
),
|
|
9821
|
-
externalId:
|
|
10031
|
+
externalId: import_zod5.z.string().optional().describe(
|
|
9822
10032
|
"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."
|
|
9823
10033
|
),
|
|
9824
|
-
indexMode:
|
|
10034
|
+
indexMode: import_zod5.z.enum(["HYBRID", "SEMANTIC", "TEXT", "NONE"]).optional().describe(
|
|
9825
10035
|
"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."
|
|
9826
10036
|
),
|
|
9827
|
-
status:
|
|
9828
|
-
folderId:
|
|
9829
|
-
userId:
|
|
9830
|
-
scopes:
|
|
10037
|
+
status: import_zod5.z.string().optional().describe("Record lifecycle status. Defaults to ACTIVE server-side."),
|
|
10038
|
+
folderId: import_zod5.z.string().optional().describe("Group this record into a folder."),
|
|
10039
|
+
userId: import_zod5.z.string().optional().describe("Owning user id."),
|
|
10040
|
+
scopes: import_zod5.z.array(import_zod5.z.string()).optional().describe(
|
|
9831
10041
|
'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.'
|
|
9832
10042
|
)
|
|
9833
10043
|
};
|
|
@@ -9835,7 +10045,7 @@ var recordCreate = ({ client, log }) => ({
|
|
|
9835
10045
|
name: "record_create",
|
|
9836
10046
|
title: "Create a record",
|
|
9837
10047
|
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).",
|
|
9838
|
-
inputSchema:
|
|
10048
|
+
inputSchema: inputSchema5,
|
|
9839
10049
|
handler: async (args) => {
|
|
9840
10050
|
const type = args.type;
|
|
9841
10051
|
try {
|
|
@@ -9862,18 +10072,18 @@ var recordCreate = ({ client, log }) => ({
|
|
|
9862
10072
|
var record_create_default = recordCreate;
|
|
9863
10073
|
|
|
9864
10074
|
// src/tools/record_update.ts
|
|
9865
|
-
var
|
|
9866
|
-
var
|
|
9867
|
-
id:
|
|
9868
|
-
externalId:
|
|
10075
|
+
var import_zod6 = require("zod");
|
|
10076
|
+
var inputSchema6 = {
|
|
10077
|
+
id: import_zod6.z.string().optional().describe("The Vectros record id to update. Provide this OR externalId+type."),
|
|
10078
|
+
externalId: import_zod6.z.string().optional().describe(
|
|
9869
10079
|
"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."
|
|
9870
10080
|
),
|
|
9871
|
-
type:
|
|
9872
|
-
fields:
|
|
10081
|
+
type: import_zod6.z.string().optional().describe("Record type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
|
|
10082
|
+
fields: import_zod6.z.record(import_zod6.z.string(), import_zod6.z.unknown()).describe(
|
|
9873
10083
|
"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."
|
|
9874
10084
|
),
|
|
9875
|
-
status:
|
|
9876
|
-
expectedVersion:
|
|
10085
|
+
status: import_zod6.z.string().optional().describe("Set the record lifecycle status (e.g. ARCHIVED) \u2014 archive/workflow without physical deletion."),
|
|
10086
|
+
expectedVersion: import_zod6.z.number().int().optional().describe(
|
|
9877
10087
|
"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."
|
|
9878
10088
|
)
|
|
9879
10089
|
};
|
|
@@ -9881,7 +10091,7 @@ var recordUpdate = ({ client, log }) => ({
|
|
|
9881
10091
|
name: "record_update",
|
|
9882
10092
|
title: "Update a record by id or externalId",
|
|
9883
10093
|
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.",
|
|
9884
|
-
inputSchema:
|
|
10094
|
+
inputSchema: inputSchema6,
|
|
9885
10095
|
handler: async (args) => {
|
|
9886
10096
|
const id = args.id;
|
|
9887
10097
|
const externalId = args.externalId;
|
|
@@ -9907,15 +10117,15 @@ var recordUpdate = ({ client, log }) => ({
|
|
|
9907
10117
|
var record_update_default = recordUpdate;
|
|
9908
10118
|
|
|
9909
10119
|
// src/tools/record_delete.ts
|
|
9910
|
-
var
|
|
9911
|
-
var
|
|
9912
|
-
id:
|
|
10120
|
+
var import_zod7 = require("zod");
|
|
10121
|
+
var inputSchema7 = {
|
|
10122
|
+
id: import_zod7.z.string().min(1, "id is required").describe("The Vectros record id to delete.")
|
|
9913
10123
|
};
|
|
9914
10124
|
var recordDelete = ({ client, log }) => ({
|
|
9915
10125
|
name: "record_delete",
|
|
9916
10126
|
title: "Delete a record",
|
|
9917
10127
|
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.",
|
|
9918
|
-
inputSchema:
|
|
10128
|
+
inputSchema: inputSchema7,
|
|
9919
10129
|
handler: async (args) => {
|
|
9920
10130
|
const id = args.id;
|
|
9921
10131
|
try {
|
|
@@ -9931,48 +10141,48 @@ var recordDelete = ({ client, log }) => ({
|
|
|
9931
10141
|
var record_delete_default = recordDelete;
|
|
9932
10142
|
|
|
9933
10143
|
// src/tools/rag_ask.ts
|
|
9934
|
-
var
|
|
10144
|
+
var import_zod8 = require("zod");
|
|
9935
10145
|
var SEARCH_MCP_DEFAULT_LIMIT = 5;
|
|
9936
10146
|
var SEARCH_MCP_MAX_LIMIT = 50;
|
|
9937
|
-
var
|
|
9938
|
-
query:
|
|
9939
|
-
instructions:
|
|
10147
|
+
var inputSchema8 = {
|
|
10148
|
+
query: import_zod8.z.string().min(1, "query must be non-empty").describe("Question to ground against retrieved content."),
|
|
10149
|
+
instructions: import_zod8.z.string().optional().describe(
|
|
9940
10150
|
'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.'
|
|
9941
10151
|
),
|
|
9942
|
-
model:
|
|
10152
|
+
model: import_zod8.z.string().optional().describe(
|
|
9943
10153
|
"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."
|
|
9944
10154
|
),
|
|
9945
|
-
search:
|
|
9946
|
-
mode:
|
|
9947
|
-
limit:
|
|
10155
|
+
search: import_zod8.z.object({
|
|
10156
|
+
mode: import_zod8.z.enum(["HYBRID", "TEXT", "SEMANTIC"]).optional().describe("Retrieval mode. Default HYBRID."),
|
|
10157
|
+
limit: import_zod8.z.number().int().min(1).max(SEARCH_MCP_MAX_LIMIT).optional().describe(
|
|
9948
10158
|
`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.`
|
|
9949
10159
|
),
|
|
9950
10160
|
// Retrieval scoping — parity with hybrid_search so an agent can ground the
|
|
9951
10161
|
// answer on a specific owner / folder / type / metadata subset, not just the
|
|
9952
10162
|
// whole-tenant corpus.
|
|
9953
|
-
userId:
|
|
9954
|
-
scope:
|
|
10163
|
+
userId: import_zod8.z.string().optional().describe("Restrict retrieval to content owned by this user (Vectros UUID)."),
|
|
10164
|
+
scope: import_zod8.z.string().optional().describe(
|
|
9955
10165
|
'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.'
|
|
9956
10166
|
),
|
|
9957
|
-
folderId:
|
|
9958
|
-
rootFolderId:
|
|
9959
|
-
typeName:
|
|
9960
|
-
contentTypes:
|
|
9961
|
-
filters:
|
|
10167
|
+
folderId: import_zod8.z.string().optional().describe("Restrict retrieval to this exact folder."),
|
|
10168
|
+
rootFolderId: import_zod8.z.string().optional().describe("Restrict retrieval to this folder and all its descendants."),
|
|
10169
|
+
typeName: import_zod8.z.string().optional().describe("Restrict record retrieval to this schema type."),
|
|
10170
|
+
contentTypes: import_zod8.z.array(import_zod8.z.enum(["documents", "records"])).optional().describe('Narrow retrieval to content types. ["documents"] or ["records"]; omit for both.'),
|
|
10171
|
+
filters: import_zod8.z.record(import_zod8.z.unknown()).optional().describe(
|
|
9962
10172
|
'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"}.'
|
|
9963
10173
|
),
|
|
9964
|
-
createdAfter:
|
|
9965
|
-
createdBefore:
|
|
9966
|
-
requireComplete:
|
|
10174
|
+
createdAfter: import_zod8.z.string().optional().describe("Restrict to content created at/after this ISO 8601 UTC timestamp."),
|
|
10175
|
+
createdBefore: import_zod8.z.string().optional().describe("Restrict to content created at/before this ISO 8601 UTC timestamp."),
|
|
10176
|
+
requireComplete: import_zod8.z.boolean().optional().describe("Fail closed (503) on a degraded search backend instead of grounding on partial results. Default false.")
|
|
9967
10177
|
}).optional().describe("Retrieval params + scoping. Default mode HYBRID, limit " + SEARCH_MCP_DEFAULT_LIMIT + "."),
|
|
9968
|
-
maxTokens:
|
|
9969
|
-
temperature:
|
|
10178
|
+
maxTokens: import_zod8.z.number().int().min(1).optional().describe("Max output tokens."),
|
|
10179
|
+
temperature: import_zod8.z.number().min(0).max(1).optional().describe("Sampling temperature (0.0\u20131.0). Default 0.3 \u2014 lower favors deterministic, retrieval-grounded answers.")
|
|
9970
10180
|
};
|
|
9971
10181
|
var ragAsk = ({ client, log }) => ({
|
|
9972
10182
|
name: "rag_ask",
|
|
9973
10183
|
title: "RAG ask (corpus-wide)",
|
|
9974
10184
|
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.",
|
|
9975
|
-
inputSchema:
|
|
10185
|
+
inputSchema: inputSchema8,
|
|
9976
10186
|
handler: async (args, extra) => {
|
|
9977
10187
|
try {
|
|
9978
10188
|
const searchArg = args.search ?? {};
|
|
@@ -10048,20 +10258,20 @@ var ragAsk = ({ client, log }) => ({
|
|
|
10048
10258
|
var rag_ask_default = ragAsk;
|
|
10049
10259
|
|
|
10050
10260
|
// src/tools/document_ask.ts
|
|
10051
|
-
var
|
|
10052
|
-
var
|
|
10053
|
-
documentId:
|
|
10054
|
-
prompt:
|
|
10055
|
-
model:
|
|
10261
|
+
var import_zod9 = require("zod");
|
|
10262
|
+
var inputSchema9 = {
|
|
10263
|
+
documentId: import_zod9.z.string().min(1, "documentId is required").describe("ID of the document to ask against."),
|
|
10264
|
+
prompt: import_zod9.z.string().min(1, "prompt is required").describe("Question to ask about the document."),
|
|
10265
|
+
model: import_zod9.z.string().optional().describe(
|
|
10056
10266
|
"Inference model alias. Default = tier-appropriate Haiku. See GET /v1/models for the catalog the calling key can reach."
|
|
10057
10267
|
),
|
|
10058
|
-
maxTokens:
|
|
10268
|
+
maxTokens: import_zod9.z.number().int().min(1).optional().describe("Max output tokens.")
|
|
10059
10269
|
};
|
|
10060
10270
|
var documentAsk = ({ client, log }) => ({
|
|
10061
10271
|
name: "document_ask",
|
|
10062
10272
|
title: "Document ask (single-document)",
|
|
10063
10273
|
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.",
|
|
10064
|
-
inputSchema:
|
|
10274
|
+
inputSchema: inputSchema9,
|
|
10065
10275
|
handler: async (args, extra) => {
|
|
10066
10276
|
try {
|
|
10067
10277
|
const stream = await client.inference.documentAsk({
|
|
@@ -10120,18 +10330,18 @@ var documentAsk = ({ client, log }) => ({
|
|
|
10120
10330
|
var document_ask_default = documentAsk;
|
|
10121
10331
|
|
|
10122
10332
|
// src/tools/list_schemas.ts
|
|
10123
|
-
var
|
|
10124
|
-
var
|
|
10125
|
-
userId:
|
|
10333
|
+
var import_zod10 = require("zod");
|
|
10334
|
+
var inputSchema10 = {
|
|
10335
|
+
userId: import_zod10.z.string().optional().describe(
|
|
10126
10336
|
"Filter to schemas visible to a specific user. Optional; default returns all schemas the credential can see."
|
|
10127
10337
|
),
|
|
10128
|
-
scope:
|
|
10338
|
+
scope: import_zod10.z.string().optional().describe(
|
|
10129
10339
|
'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.'
|
|
10130
10340
|
),
|
|
10131
|
-
surface:
|
|
10341
|
+
surface: import_zod10.z.enum(["record", "document", "user", "entity"]).optional().describe(
|
|
10132
10342
|
"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."
|
|
10133
10343
|
),
|
|
10134
|
-
recordType:
|
|
10344
|
+
recordType: import_zod10.z.string().optional().describe(
|
|
10135
10345
|
'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.'
|
|
10136
10346
|
)
|
|
10137
10347
|
};
|
|
@@ -10139,7 +10349,7 @@ var listSchemas = ({ client, log }) => ({
|
|
|
10139
10349
|
name: "list_schemas",
|
|
10140
10350
|
title: "List record schemas",
|
|
10141
10351
|
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.',
|
|
10142
|
-
inputSchema:
|
|
10352
|
+
inputSchema: inputSchema10,
|
|
10143
10353
|
handler: async (args) => {
|
|
10144
10354
|
const userId = args.userId;
|
|
10145
10355
|
const scope = args.scope;
|
|
@@ -10165,18 +10375,18 @@ var listSchemas = ({ client, log }) => ({
|
|
|
10165
10375
|
var list_schemas_default = listSchemas;
|
|
10166
10376
|
|
|
10167
10377
|
// src/tools/document_get.ts
|
|
10168
|
-
var
|
|
10378
|
+
var import_zod11 = require("zod");
|
|
10169
10379
|
var MAX_TEXT_CHARS = 32e3;
|
|
10170
|
-
var
|
|
10171
|
-
documentId:
|
|
10172
|
-
externalId:
|
|
10380
|
+
var inputSchema11 = {
|
|
10381
|
+
documentId: import_zod11.z.string().optional().describe("The document ID returned by document_ingest or hybrid_search. Provide this OR externalId+type."),
|
|
10382
|
+
externalId: import_zod11.z.string().optional().describe(
|
|
10173
10383
|
"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."
|
|
10174
10384
|
),
|
|
10175
|
-
type:
|
|
10176
|
-
includeText:
|
|
10385
|
+
type: import_zod11.z.string().optional().describe("Document type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
|
|
10386
|
+
includeText: import_zod11.z.boolean().optional().describe(
|
|
10177
10387
|
"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."
|
|
10178
10388
|
),
|
|
10179
|
-
includeDownloadUrl:
|
|
10389
|
+
includeDownloadUrl: import_zod11.z.boolean().optional().describe(
|
|
10180
10390
|
"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."
|
|
10181
10391
|
)
|
|
10182
10392
|
};
|
|
@@ -10193,7 +10403,7 @@ var documentGet = ({ client, log }) => ({
|
|
|
10193
10403
|
name: "document_get",
|
|
10194
10404
|
title: "Get document metadata (and optionally text)",
|
|
10195
10405
|
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.",
|
|
10196
|
-
inputSchema:
|
|
10406
|
+
inputSchema: inputSchema11,
|
|
10197
10407
|
handler: async (args) => {
|
|
10198
10408
|
const documentId = args.documentId;
|
|
10199
10409
|
const externalId = args.externalId;
|
|
@@ -10258,28 +10468,28 @@ var documentGet = ({ client, log }) => ({
|
|
|
10258
10468
|
var document_get_default = documentGet;
|
|
10259
10469
|
|
|
10260
10470
|
// src/tools/document_query.ts
|
|
10261
|
-
var
|
|
10471
|
+
var import_zod12 = require("zod");
|
|
10262
10472
|
var MCP_DEFAULT_LIMIT3 = 3;
|
|
10263
10473
|
var MCP_MAX_LIMIT3 = 100;
|
|
10264
|
-
var
|
|
10474
|
+
var inputSchema12 = {
|
|
10265
10475
|
// Lookup-mode args — provide `field` plus EXACTLY ONE of: value | from+to | prefix.
|
|
10266
|
-
field:
|
|
10267
|
-
value:
|
|
10268
|
-
from:
|
|
10269
|
-
to:
|
|
10270
|
-
prefix:
|
|
10271
|
-
order:
|
|
10476
|
+
field: import_zod12.z.string().optional().describe("Lookup mode: name of the lookup-indexed field to query by."),
|
|
10477
|
+
value: import_zod12.z.string().optional().describe("Lookup mode (equality): exact-match value for `field`. Works on sensitive fields too."),
|
|
10478
|
+
from: import_zod12.z.string().optional().describe("Lookup mode (range): inclusive lower bound; requires `to`. Range-enabled, non-sensitive fields only."),
|
|
10479
|
+
to: import_zod12.z.string().optional().describe("Lookup mode (range): inclusive upper bound; requires `from`."),
|
|
10480
|
+
prefix: import_zod12.z.string().optional().describe("Lookup mode (prefix): match values starting with this. Range-enabled string fields only."),
|
|
10481
|
+
order: import_zod12.z.enum(["asc", "desc"]).optional().describe(
|
|
10272
10482
|
"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."
|
|
10273
10483
|
),
|
|
10274
|
-
type:
|
|
10484
|
+
type: import_zod12.z.string().optional().describe("Lookup mode: the document type (the bound schema's type). Required with `field`."),
|
|
10275
10485
|
// List-mode args:
|
|
10276
|
-
folderId:
|
|
10277
|
-
userId:
|
|
10278
|
-
scope:
|
|
10486
|
+
folderId: import_zod12.z.string().optional().describe("List mode: only documents in this folder (Vectros folder id)."),
|
|
10487
|
+
userId: import_zod12.z.string().optional().describe("List mode: scope to documents owned by this user."),
|
|
10488
|
+
scope: import_zod12.z.string().optional().describe(
|
|
10279
10489
|
'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.'
|
|
10280
10490
|
),
|
|
10281
|
-
startFrom:
|
|
10282
|
-
limit:
|
|
10491
|
+
startFrom: import_zod12.z.string().optional().describe("Pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next. Works in both list and lookup mode."),
|
|
10492
|
+
limit: import_zod12.z.number().int().min(1).max(MCP_MAX_LIMIT3).optional().describe(
|
|
10283
10493
|
`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.`
|
|
10284
10494
|
)
|
|
10285
10495
|
};
|
|
@@ -10287,7 +10497,7 @@ var documentQuery = ({ client, log }) => ({
|
|
|
10287
10497
|
name: "document_query",
|
|
10288
10498
|
title: "Document query (list or lookup)",
|
|
10289
10499
|
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.",
|
|
10290
|
-
inputSchema:
|
|
10500
|
+
inputSchema: inputSchema12,
|
|
10291
10501
|
handler: async (args) => {
|
|
10292
10502
|
const limit = args.limit ?? MCP_DEFAULT_LIMIT3;
|
|
10293
10503
|
const field = args.field;
|
|
@@ -10367,29 +10577,29 @@ var documentQuery = ({ client, log }) => ({
|
|
|
10367
10577
|
var document_query_default = documentQuery;
|
|
10368
10578
|
|
|
10369
10579
|
// src/tools/document_update.ts
|
|
10370
|
-
var
|
|
10371
|
-
var
|
|
10372
|
-
documentId:
|
|
10373
|
-
externalId:
|
|
10580
|
+
var import_zod13 = require("zod");
|
|
10581
|
+
var inputSchema13 = {
|
|
10582
|
+
documentId: import_zod13.z.string().optional().describe("The Vectros document id to update. Provide this OR externalId+type."),
|
|
10583
|
+
externalId: import_zod13.z.string().optional().describe(
|
|
10374
10584
|
"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."
|
|
10375
10585
|
),
|
|
10376
|
-
type:
|
|
10377
|
-
title:
|
|
10378
|
-
fields:
|
|
10586
|
+
type: import_zod13.z.string().optional().describe("Document type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
|
|
10587
|
+
title: import_zod13.z.string().optional().describe("New title. Omit to keep the current title."),
|
|
10588
|
+
fields: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.unknown()).optional().describe(
|
|
10379
10589
|
"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."
|
|
10380
10590
|
),
|
|
10381
|
-
text:
|
|
10591
|
+
text: import_zod13.z.string().optional().describe(
|
|
10382
10592
|
"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."
|
|
10383
10593
|
),
|
|
10384
|
-
folderId:
|
|
10385
|
-
status:
|
|
10594
|
+
folderId: import_zod13.z.string().optional().describe("Move the document into this folder (cannot be cleared once set)."),
|
|
10595
|
+
status: import_zod13.z.enum(["ACTIVE", "ARCHIVED"]).optional().describe(
|
|
10386
10596
|
"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."
|
|
10387
10597
|
),
|
|
10388
|
-
userId:
|
|
10389
|
-
scopes:
|
|
10598
|
+
userId: import_zod13.z.string().optional().describe("Reassign the owning user (Vectros UUID)."),
|
|
10599
|
+
scopes: import_zod13.z.array(import_zod13.z.string()).optional().describe(
|
|
10390
10600
|
'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).'
|
|
10391
10601
|
),
|
|
10392
|
-
expectedVersion:
|
|
10602
|
+
expectedVersion: import_zod13.z.number().int().optional().describe(
|
|
10393
10603
|
"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."
|
|
10394
10604
|
)
|
|
10395
10605
|
};
|
|
@@ -10397,7 +10607,7 @@ var documentUpdate = ({ client, log }) => ({
|
|
|
10397
10607
|
name: "document_update",
|
|
10398
10608
|
title: "Update a document",
|
|
10399
10609
|
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.',
|
|
10400
|
-
inputSchema:
|
|
10610
|
+
inputSchema: inputSchema13,
|
|
10401
10611
|
handler: async (args) => {
|
|
10402
10612
|
const documentId = args.documentId;
|
|
10403
10613
|
const externalId = args.externalId;
|
|
@@ -10437,15 +10647,15 @@ var documentUpdate = ({ client, log }) => ({
|
|
|
10437
10647
|
var document_update_default = documentUpdate;
|
|
10438
10648
|
|
|
10439
10649
|
// src/tools/document_delete.ts
|
|
10440
|
-
var
|
|
10441
|
-
var
|
|
10442
|
-
documentId:
|
|
10650
|
+
var import_zod14 = require("zod");
|
|
10651
|
+
var inputSchema14 = {
|
|
10652
|
+
documentId: import_zod14.z.string().min(1, "documentId is required").describe("The Vectros document id to delete.")
|
|
10443
10653
|
};
|
|
10444
10654
|
var documentDelete = ({ client, log }) => ({
|
|
10445
10655
|
name: "document_delete",
|
|
10446
10656
|
title: "Delete a document",
|
|
10447
10657
|
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).',
|
|
10448
|
-
inputSchema:
|
|
10658
|
+
inputSchema: inputSchema14,
|
|
10449
10659
|
handler: async (args) => {
|
|
10450
10660
|
const documentId = args.documentId;
|
|
10451
10661
|
try {
|
|
@@ -10463,18 +10673,18 @@ var documentDelete = ({ client, log }) => ({
|
|
|
10463
10673
|
var document_delete_default = documentDelete;
|
|
10464
10674
|
|
|
10465
10675
|
// src/tools/folder_query.ts
|
|
10466
|
-
var
|
|
10676
|
+
var import_zod15 = require("zod");
|
|
10467
10677
|
var MCP_DEFAULT_LIMIT4 = 10;
|
|
10468
10678
|
var MCP_MAX_LIMIT4 = 100;
|
|
10469
|
-
var
|
|
10470
|
-
id:
|
|
10471
|
-
parentId:
|
|
10472
|
-
userId:
|
|
10473
|
-
scope:
|
|
10679
|
+
var inputSchema15 = {
|
|
10680
|
+
id: import_zod15.z.string().optional().describe("Get mode: fetch this single folder by id."),
|
|
10681
|
+
parentId: import_zod15.z.string().optional().describe("List mode: direct children of this folder (tree navigation). Omit for a flat tenant list."),
|
|
10682
|
+
userId: import_zod15.z.string().optional().describe("List mode: scope to folders owned by this user."),
|
|
10683
|
+
scope: import_zod15.z.string().optional().describe(
|
|
10474
10684
|
'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.'
|
|
10475
10685
|
),
|
|
10476
|
-
startFrom:
|
|
10477
|
-
limit:
|
|
10686
|
+
startFrom: import_zod15.z.string().optional().describe("List mode: pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next."),
|
|
10687
|
+
limit: import_zod15.z.number().int().min(1).max(MCP_MAX_LIMIT4).optional().describe(
|
|
10478
10688
|
`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\`.`
|
|
10479
10689
|
)
|
|
10480
10690
|
};
|
|
@@ -10482,7 +10692,7 @@ var folderQuery = ({ client, log }) => ({
|
|
|
10482
10692
|
name: "folder_query",
|
|
10483
10693
|
title: "Folder query (list or get)",
|
|
10484
10694
|
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.",
|
|
10485
|
-
inputSchema:
|
|
10695
|
+
inputSchema: inputSchema15,
|
|
10486
10696
|
handler: async (args) => {
|
|
10487
10697
|
const id = args.id;
|
|
10488
10698
|
try {
|
|
@@ -10512,14 +10722,14 @@ var folderQuery = ({ client, log }) => ({
|
|
|
10512
10722
|
var folder_query_default = folderQuery;
|
|
10513
10723
|
|
|
10514
10724
|
// src/tools/folder_create.ts
|
|
10515
|
-
var
|
|
10516
|
-
var
|
|
10517
|
-
name:
|
|
10518
|
-
description:
|
|
10519
|
-
parentId:
|
|
10520
|
-
slug:
|
|
10521
|
-
userId:
|
|
10522
|
-
scopes:
|
|
10725
|
+
var import_zod16 = require("zod");
|
|
10726
|
+
var inputSchema16 = {
|
|
10727
|
+
name: import_zod16.z.string().min(1, "name is required").describe("Folder display name."),
|
|
10728
|
+
description: import_zod16.z.string().optional().describe("Optional description of the folder's purpose."),
|
|
10729
|
+
parentId: import_zod16.z.string().optional().describe("Parent folder id \u2014 places the folder under this parent. Omit for the context default root. Create-only."),
|
|
10730
|
+
slug: import_zod16.z.string().optional().describe("Optional stable slug (sibling-unique; idempotency key). Lowercase letters/digits/hyphens. Derived from name when omitted."),
|
|
10731
|
+
userId: import_zod16.z.string().optional().describe("Owning user (Vectros UUID)."),
|
|
10732
|
+
scopes: import_zod16.z.array(import_zod16.z.string()).optional().describe(
|
|
10523
10733
|
'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.'
|
|
10524
10734
|
)
|
|
10525
10735
|
};
|
|
@@ -10527,7 +10737,7 @@ var folderCreate = ({ client, log }) => ({
|
|
|
10527
10737
|
name: "folder_create",
|
|
10528
10738
|
title: "Create a folder",
|
|
10529
10739
|
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).",
|
|
10530
|
-
inputSchema:
|
|
10740
|
+
inputSchema: inputSchema16,
|
|
10531
10741
|
handler: async (args) => {
|
|
10532
10742
|
try {
|
|
10533
10743
|
const folder = await client.folders.createFolder({
|
|
@@ -10551,16 +10761,16 @@ var folderCreate = ({ client, log }) => ({
|
|
|
10551
10761
|
var folder_create_default = folderCreate;
|
|
10552
10762
|
|
|
10553
10763
|
// src/tools/folder_update.ts
|
|
10554
|
-
var
|
|
10555
|
-
var
|
|
10556
|
-
id:
|
|
10557
|
-
name:
|
|
10558
|
-
description:
|
|
10559
|
-
userId:
|
|
10560
|
-
scopes:
|
|
10764
|
+
var import_zod17 = require("zod");
|
|
10765
|
+
var inputSchema17 = {
|
|
10766
|
+
id: import_zod17.z.string().min(1, "id is required").describe("The Vectros folder id to update."),
|
|
10767
|
+
name: import_zod17.z.string().optional().describe("New folder name. Omit to keep the current name."),
|
|
10768
|
+
description: import_zod17.z.string().optional().describe("New description. Omit to leave unchanged."),
|
|
10769
|
+
userId: import_zod17.z.string().optional().describe("Reassign the owning user (Vectros UUID)."),
|
|
10770
|
+
scopes: import_zod17.z.array(import_zod17.z.string()).optional().describe(
|
|
10561
10771
|
'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).'
|
|
10562
10772
|
),
|
|
10563
|
-
expectedVersion:
|
|
10773
|
+
expectedVersion: import_zod17.z.number().int().optional().describe(
|
|
10564
10774
|
"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."
|
|
10565
10775
|
)
|
|
10566
10776
|
};
|
|
@@ -10568,7 +10778,7 @@ var folderUpdate = ({ client, log }) => ({
|
|
|
10568
10778
|
name: "folder_update",
|
|
10569
10779
|
title: "Update a folder",
|
|
10570
10780
|
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.",
|
|
10571
|
-
inputSchema:
|
|
10781
|
+
inputSchema: inputSchema17,
|
|
10572
10782
|
handler: async (args) => {
|
|
10573
10783
|
const id = args.id;
|
|
10574
10784
|
const name = args.name;
|
|
@@ -10595,15 +10805,15 @@ var folderUpdate = ({ client, log }) => ({
|
|
|
10595
10805
|
var folder_update_default = folderUpdate;
|
|
10596
10806
|
|
|
10597
10807
|
// src/tools/folder_delete.ts
|
|
10598
|
-
var
|
|
10599
|
-
var
|
|
10600
|
-
id:
|
|
10808
|
+
var import_zod18 = require("zod");
|
|
10809
|
+
var inputSchema18 = {
|
|
10810
|
+
id: import_zod18.z.string().min(1, "id is required").describe("The Vectros folder id to delete.")
|
|
10601
10811
|
};
|
|
10602
10812
|
var folderDelete = ({ client, log }) => ({
|
|
10603
10813
|
name: "folder_delete",
|
|
10604
10814
|
title: "Delete a folder",
|
|
10605
10815
|
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.",
|
|
10606
|
-
inputSchema:
|
|
10816
|
+
inputSchema: inputSchema18,
|
|
10607
10817
|
handler: async (args) => {
|
|
10608
10818
|
const id = args.id;
|
|
10609
10819
|
try {
|
|
@@ -10619,14 +10829,14 @@ var folderDelete = ({ client, log }) => ({
|
|
|
10619
10829
|
var folder_delete_default = folderDelete;
|
|
10620
10830
|
|
|
10621
10831
|
// src/tools/current_identity.ts
|
|
10622
|
-
var
|
|
10832
|
+
var inputSchema19 = {
|
|
10623
10833
|
// No args — current_identity describes the current credential.
|
|
10624
10834
|
};
|
|
10625
10835
|
var currentIdentity = ({ log, apiKey, environment }) => ({
|
|
10626
10836
|
name: "current_identity",
|
|
10627
10837
|
title: "Current identity (tenant + principal scope)",
|
|
10628
|
-
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
|
|
10629
|
-
inputSchema:
|
|
10838
|
+
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.",
|
|
10839
|
+
inputSchema: inputSchema19,
|
|
10630
10840
|
handler: async () => {
|
|
10631
10841
|
try {
|
|
10632
10842
|
const identity = await resolveIdentity({ log, apiKey, environment });
|
|
@@ -10642,7 +10852,7 @@ var currentIdentity = ({ log, apiKey, environment }) => ({
|
|
|
10642
10852
|
var current_identity_default = currentIdentity;
|
|
10643
10853
|
|
|
10644
10854
|
// src/tools/document_ingest.ts
|
|
10645
|
-
var
|
|
10855
|
+
var import_zod19 = require("zod");
|
|
10646
10856
|
var import_promises = require("fs/promises");
|
|
10647
10857
|
var import_node_path = require("path");
|
|
10648
10858
|
var IngestPathError = class extends Error {
|
|
@@ -10717,37 +10927,37 @@ function inferMimeType(filePath) {
|
|
|
10717
10927
|
const ext = (0, import_node_path.extname)(filePath).toLowerCase();
|
|
10718
10928
|
return EXT_TO_MIME[ext] ?? "application/octet-stream";
|
|
10719
10929
|
}
|
|
10720
|
-
var
|
|
10721
|
-
title:
|
|
10722
|
-
indexMode:
|
|
10930
|
+
var inputSchema20 = {
|
|
10931
|
+
title: import_zod19.z.string().min(1, "title is required").describe("Human-readable document title \u2014 appears in search results and the UI."),
|
|
10932
|
+
indexMode: import_zod19.z.enum(["HYBRID", "SEMANTIC", "TEXT", "NONE"]).optional().describe(
|
|
10723
10933
|
"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."
|
|
10724
10934
|
),
|
|
10725
|
-
externalId:
|
|
10935
|
+
externalId: import_zod19.z.string().optional().describe(
|
|
10726
10936
|
'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.'
|
|
10727
10937
|
),
|
|
10728
|
-
upsert:
|
|
10938
|
+
upsert: import_zod19.z.boolean().optional().describe(
|
|
10729
10939
|
"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)."
|
|
10730
10940
|
),
|
|
10731
|
-
schemaId:
|
|
10941
|
+
schemaId: import_zod19.z.string().optional().describe(
|
|
10732
10942
|
"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."
|
|
10733
10943
|
),
|
|
10734
|
-
payload:
|
|
10944
|
+
payload: import_zod19.z.record(import_zod19.z.string(), import_zod19.z.unknown()).optional().describe(
|
|
10735
10945
|
"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."
|
|
10736
10946
|
),
|
|
10737
10947
|
// Inline text mode (mutually exclusive with filePath):
|
|
10738
|
-
text:
|
|
10739
|
-
storeText:
|
|
10948
|
+
text: import_zod19.z.string().min(1).optional().describe("Text body to ingest inline. Mutually exclusive with filePath. Either text or filePath is required."),
|
|
10949
|
+
storeText: import_zod19.z.boolean().optional().describe(
|
|
10740
10950
|
"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."
|
|
10741
10951
|
),
|
|
10742
10952
|
// File upload mode (mutually exclusive with text; stdio-transport-only):
|
|
10743
|
-
filePath:
|
|
10953
|
+
filePath: import_zod19.z.string().min(1).optional().describe(
|
|
10744
10954
|
"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."
|
|
10745
10955
|
),
|
|
10746
|
-
fileType:
|
|
10956
|
+
fileType: import_zod19.z.string().optional().describe('MIME type of the file (e.g. "application/pdf"). Inferred from filePath extension if omitted.'),
|
|
10747
10957
|
// Common (both modes):
|
|
10748
|
-
folderId:
|
|
10749
|
-
userId:
|
|
10750
|
-
scopes:
|
|
10958
|
+
folderId: import_zod19.z.string().optional().describe("Optional folder to ingest into. Default: tenant root."),
|
|
10959
|
+
userId: import_zod19.z.string().optional().describe("Owning user ID. Optional."),
|
|
10960
|
+
scopes: import_zod19.z.array(import_zod19.z.string()).optional().describe(
|
|
10751
10961
|
"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."
|
|
10752
10962
|
)
|
|
10753
10963
|
};
|
|
@@ -10755,7 +10965,7 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
10755
10965
|
name: "document_ingest",
|
|
10756
10966
|
title: "Ingest a new document (text body or file upload)",
|
|
10757
10967
|
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`.",
|
|
10758
|
-
inputSchema:
|
|
10968
|
+
inputSchema: inputSchema20,
|
|
10759
10969
|
handler: async (args) => {
|
|
10760
10970
|
const title = args.title;
|
|
10761
10971
|
const text = args.text;
|
|
@@ -10907,29 +11117,29 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
10907
11117
|
var document_ingest_default = documentIngest;
|
|
10908
11118
|
|
|
10909
11119
|
// src/tools/lookup_principal.ts
|
|
10910
|
-
var
|
|
11120
|
+
var import_zod20 = require("zod");
|
|
10911
11121
|
var MCP_DEFAULT_LIMIT5 = 10;
|
|
10912
11122
|
var MCP_MAX_LIMIT5 = 100;
|
|
10913
|
-
var
|
|
10914
|
-
kind:
|
|
11123
|
+
var inputSchema21 = {
|
|
11124
|
+
kind: import_zod20.z.string().describe(
|
|
10915
11125
|
'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.'
|
|
10916
11126
|
),
|
|
10917
|
-
externalId:
|
|
11127
|
+
externalId: import_zod20.z.string().optional().describe(
|
|
10918
11128
|
"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."
|
|
10919
11129
|
),
|
|
10920
|
-
contextId:
|
|
11130
|
+
contextId: import_zod20.z.string().optional().describe(
|
|
10921
11131
|
"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."
|
|
10922
11132
|
),
|
|
10923
11133
|
// Lookup-mode args — provide `field` plus EXACTLY ONE of: value | from+to | prefix.
|
|
10924
|
-
type:
|
|
10925
|
-
field:
|
|
10926
|
-
value:
|
|
10927
|
-
from:
|
|
10928
|
-
to:
|
|
10929
|
-
prefix:
|
|
10930
|
-
order:
|
|
10931
|
-
startFrom:
|
|
10932
|
-
limit:
|
|
11134
|
+
type: import_zod20.z.string().optional().describe('Lookup mode: the identity schema\'s record type (e.g. "person_v1"). Required with `field`.'),
|
|
11135
|
+
field: import_zod20.z.string().optional().describe('Lookup mode: name of the schema-declared lookup field to query by (e.g. "email").'),
|
|
11136
|
+
value: import_zod20.z.string().optional().describe("Lookup mode (equality): exact-match value for `field`. Works on sensitive fields."),
|
|
11137
|
+
from: import_zod20.z.string().optional().describe("Lookup mode (range): inclusive lower bound; requires `to`. Non-sensitive fields only."),
|
|
11138
|
+
to: import_zod20.z.string().optional().describe("Lookup mode (range): inclusive upper bound; requires `from`."),
|
|
11139
|
+
prefix: import_zod20.z.string().optional().describe("Lookup mode (prefix): match values starting with this. Range-enabled string fields only."),
|
|
11140
|
+
order: import_zod20.z.enum(["asc", "desc"]).optional().describe("Lookup mode: sort direction by the looked-up field. `asc` (default) or `desc`."),
|
|
11141
|
+
startFrom: import_zod20.z.string().optional().describe("Lookup mode: pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next."),
|
|
11142
|
+
limit: import_zod20.z.number().int().min(1).max(MCP_MAX_LIMIT5).optional().describe(
|
|
10933
11143
|
`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\`.`
|
|
10934
11144
|
)
|
|
10935
11145
|
};
|
|
@@ -10937,7 +11147,7 @@ var lookupPrincipal = ({ client, log }) => ({
|
|
|
10937
11147
|
name: "lookup_principal",
|
|
10938
11148
|
title: "Look up a user identity or a namespaced identity entity",
|
|
10939
11149
|
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.",
|
|
10940
|
-
inputSchema:
|
|
11150
|
+
inputSchema: inputSchema21,
|
|
10941
11151
|
handler: async (args) => {
|
|
10942
11152
|
const kind = args.kind;
|
|
10943
11153
|
const isUser = kind === "user";
|
|
@@ -11011,17 +11221,17 @@ var lookupPrincipal = ({ client, log }) => ({
|
|
|
11011
11221
|
var lookup_principal_default = lookupPrincipal;
|
|
11012
11222
|
|
|
11013
11223
|
// src/tools/version_history.ts
|
|
11014
|
-
var
|
|
11015
|
-
var
|
|
11016
|
-
resourceType:
|
|
11017
|
-
id:
|
|
11018
|
-
startFrom:
|
|
11224
|
+
var import_zod21 = require("zod");
|
|
11225
|
+
var inputSchema22 = {
|
|
11226
|
+
resourceType: import_zod21.z.enum(["record", "document"]).describe("Which kind of entity the id refers to: a record or a document."),
|
|
11227
|
+
id: import_zod21.z.string().min(1, "id is required").describe("The Vectros id of the record or document whose history you want."),
|
|
11228
|
+
startFrom: import_zod21.z.string().optional().describe("Pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch older entries.")
|
|
11019
11229
|
};
|
|
11020
11230
|
var versionHistory = ({ client, log }) => ({
|
|
11021
11231
|
name: "version_history",
|
|
11022
11232
|
title: "Version history (record or document)",
|
|
11023
11233
|
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.",
|
|
11024
|
-
inputSchema:
|
|
11234
|
+
inputSchema: inputSchema22,
|
|
11025
11235
|
handler: async (args) => {
|
|
11026
11236
|
const resourceType = args.resourceType;
|
|
11027
11237
|
const id = args.id;
|
|
@@ -11048,6 +11258,7 @@ var TOOL_NAMES = [
|
|
|
11048
11258
|
"hybrid_search",
|
|
11049
11259
|
"record_query",
|
|
11050
11260
|
"record_get",
|
|
11261
|
+
"record_batch_get",
|
|
11051
11262
|
"record_create",
|
|
11052
11263
|
"record_update",
|
|
11053
11264
|
"record_delete",
|
|
@@ -11073,6 +11284,7 @@ var ALL_TOOL_FACTORIES = {
|
|
|
11073
11284
|
hybrid_search: hybrid_search_default,
|
|
11074
11285
|
record_query: record_query_default,
|
|
11075
11286
|
record_get: record_get_default,
|
|
11287
|
+
record_batch_get: record_batch_get_default,
|
|
11076
11288
|
record_create: record_create_default,
|
|
11077
11289
|
record_update: record_update_default,
|
|
11078
11290
|
record_delete: record_delete_default,
|
|
@@ -11114,7 +11326,7 @@ var identityResource = ({ log, apiKey, environment }) => ({
|
|
|
11114
11326
|
name: "identity",
|
|
11115
11327
|
uri: "vectros://identity",
|
|
11116
11328
|
title: "Current identity (tenant + principal scope)",
|
|
11117
|
-
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
|
|
11329
|
+
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.",
|
|
11118
11330
|
mimeType: "application/json",
|
|
11119
11331
|
read: async () => {
|
|
11120
11332
|
const identity = await resolveIdentity({ log, apiKey, environment });
|
|
@@ -11133,7 +11345,7 @@ var ALL_RESOURCE_FACTORIES = {
|
|
|
11133
11345
|
};
|
|
11134
11346
|
|
|
11135
11347
|
// src/zod-to-json-schema.ts
|
|
11136
|
-
var
|
|
11348
|
+
var import_zod22 = require("zod");
|
|
11137
11349
|
function zodShapeToJsonSchema(shape) {
|
|
11138
11350
|
const properties = {};
|
|
11139
11351
|
const required = [];
|
|
@@ -11148,40 +11360,40 @@ function zodShapeToJsonSchema(shape) {
|
|
|
11148
11360
|
function zodTypeToJsonSchema(schema) {
|
|
11149
11361
|
const description = schema.description;
|
|
11150
11362
|
let current = schema;
|
|
11151
|
-
while (current instanceof
|
|
11363
|
+
while (current instanceof import_zod22.z.ZodOptional || current instanceof import_zod22.z.ZodDefault || current instanceof import_zod22.z.ZodNullable) {
|
|
11152
11364
|
current = current._def.innerType;
|
|
11153
11365
|
}
|
|
11154
11366
|
const base = description ? { description } : {};
|
|
11155
|
-
if (current instanceof
|
|
11367
|
+
if (current instanceof import_zod22.z.ZodString) {
|
|
11156
11368
|
return { ...base, type: "string" };
|
|
11157
11369
|
}
|
|
11158
|
-
if (current instanceof
|
|
11370
|
+
if (current instanceof import_zod22.z.ZodNumber) {
|
|
11159
11371
|
return { ...base, type: "number" };
|
|
11160
11372
|
}
|
|
11161
|
-
if (current instanceof
|
|
11373
|
+
if (current instanceof import_zod22.z.ZodBoolean) {
|
|
11162
11374
|
return { ...base, type: "boolean" };
|
|
11163
11375
|
}
|
|
11164
|
-
if (current instanceof
|
|
11376
|
+
if (current instanceof import_zod22.z.ZodEnum) {
|
|
11165
11377
|
return {
|
|
11166
11378
|
...base,
|
|
11167
11379
|
type: "string",
|
|
11168
11380
|
enum: current.options
|
|
11169
11381
|
};
|
|
11170
11382
|
}
|
|
11171
|
-
if (current instanceof
|
|
11383
|
+
if (current instanceof import_zod22.z.ZodArray) {
|
|
11172
11384
|
return {
|
|
11173
11385
|
...base,
|
|
11174
11386
|
type: "array",
|
|
11175
11387
|
items: zodTypeToJsonSchema(current.element)
|
|
11176
11388
|
};
|
|
11177
11389
|
}
|
|
11178
|
-
if (current instanceof
|
|
11390
|
+
if (current instanceof import_zod22.z.ZodObject) {
|
|
11179
11391
|
return {
|
|
11180
11392
|
...base,
|
|
11181
11393
|
...zodShapeToJsonSchema(current.shape)
|
|
11182
11394
|
};
|
|
11183
11395
|
}
|
|
11184
|
-
if (current instanceof
|
|
11396
|
+
if (current instanceof import_zod22.z.ZodRecord) {
|
|
11185
11397
|
const valueType = current._def.valueType;
|
|
11186
11398
|
return {
|
|
11187
11399
|
...base,
|
|
@@ -11305,7 +11517,7 @@ var VectrosMCPServer = class {
|
|
|
11305
11517
|
if (!tool) {
|
|
11306
11518
|
result = toolError(req.params.name ?? "unknown", new Error("No such tool."));
|
|
11307
11519
|
} else {
|
|
11308
|
-
const parsed =
|
|
11520
|
+
const parsed = import_zod23.z.object(tool.inputSchema).strict().safeParse(req.params.arguments ?? {});
|
|
11309
11521
|
if (!parsed.success) {
|
|
11310
11522
|
result = toolError(tool.name, new Error(formatArgError(tool, parsed.error)));
|
|
11311
11523
|
} else {
|