@vectros-ai/mcp-server 0.17.0 → 0.17.2
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 +113 -0
- package/README.md +52 -10
- package/dist/cli-http.js +246 -33
- package/dist/cli-http.js.map +1 -1
- package/dist/cli-http.mjs +246 -33
- package/dist/cli-http.mjs.map +1 -1
- package/dist/cli.js +253 -41
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +253 -41
- package/dist/cli.mjs.map +1 -1
- package/dist/index.js +232 -26
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +232 -26
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/cli-http.mjs
CHANGED
|
@@ -3402,6 +3402,7 @@ var AuthClient = class {
|
|
|
3402
3402
|
*
|
|
3403
3403
|
* @throws {@link Vectros.ForbiddenError}
|
|
3404
3404
|
* @throws {@link Vectros.NotFoundError}
|
|
3405
|
+
* @throws {@link Vectros.ConflictError}
|
|
3405
3406
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
3406
3407
|
*
|
|
3407
3408
|
* @example
|
|
@@ -3444,6 +3445,8 @@ var AuthClient = class {
|
|
|
3444
3445
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3445
3446
|
case 404:
|
|
3446
3447
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
3448
|
+
case 409:
|
|
3449
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
3447
3450
|
case 429:
|
|
3448
3451
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
3449
3452
|
default:
|
|
@@ -3520,7 +3523,7 @@ var AuthClient = class {
|
|
|
3520
3523
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/app-contexts/{contextId}");
|
|
3521
3524
|
}
|
|
3522
3525
|
/**
|
|
3523
|
-
* Updates
|
|
3526
|
+
* Updates an app context. This is a partial update: any field you omit (or send as null) keeps its existing value. The `contextId` is immutable and is taken from the URL path, so any `contextId` in the request body is ignored. Patchable fields: `name`, `description`, `companyName`; the per-principal metering trio (`meteringAxis`, `principalBurstLimit`, `principalUsageCap` — only takes effect for a partner with the corresponding account-level feature enabled); `readAccessLogDefault` (the PHI read-access-logging context default); and `identityProjectionClaims` (requires the platform provisioning capability on top of the ordinary scope below — see its own field description). Requires the `app-contexts:u` scope.
|
|
3524
3527
|
*
|
|
3525
3528
|
* @param {Vectros.UpdateAppContextRequest} request
|
|
3526
3529
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -3588,7 +3591,7 @@ var AuthClient = class {
|
|
|
3588
3591
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v1/app-contexts/{contextId}");
|
|
3589
3592
|
}
|
|
3590
3593
|
/**
|
|
3591
|
-
* Permanently deletes an app context and everything in it — every record, document, folder, schema, role,
|
|
3594
|
+
* Permanently deletes an app context and everything in it — every record, document, folder, schema, role, access profile, and trusted-issuer registration belonging to the context. This is irreversible. The deletion runs asynchronously: the call returns 202 immediately and the context's data drains in the background. Poll the context's `status` field to observe when the teardown completes (`purging` while draining, then `deleted`). To guard against accidental deletion, you must echo the contextId back in the `confirm` query parameter (`?confirm={contextId}`). The reserved `default` and `vectros-admin` contexts cannot be deleted. This operation requires a root API key (one beginning with `sk_`): no scoped credential, not even one with full wildcard (`*`) scope, can trigger this teardown.
|
|
3592
3595
|
*
|
|
3593
3596
|
* @param {Vectros.DeleteAppContextRequest} request
|
|
3594
3597
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4123,7 +4126,7 @@ var AuthClient = class {
|
|
|
4123
4126
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/auth/issuers/{issuerId}");
|
|
4124
4127
|
}
|
|
4125
4128
|
/**
|
|
4126
|
-
* 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.
|
|
4129
|
+
* Updates the mutable fields of a registered issuer: `subClaim`, `emailClaim`, `userinfoUri`, `capturedClaims`, `restrictedToDomain` (a new non-blank value must already be a VERIFIED domain for your account; an empty string clears it back to domain-less; see `IssuerUpdateRequest.restrictedToDomain` for the full semantics), `status` (`active`/`suspended` — a registration awaiting verification (`pending_verification`) accepts no status change until it is verified; 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. **`subClaim` is identity-determining, not merely cosmetic**: it names which verified JWT claim is read as the federated user's identifier, so changing it on an issuer that already has bound users would silently re-identify (or, under self-signup, orphan) every one of them — changing it is therefore refused once any user has bound through this issuer, the same guard `DELETE` already applies, and is only free before the first real login. 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.
|
|
4127
4130
|
*
|
|
4128
4131
|
* @param {Vectros.IssuerUpdateRequest} request
|
|
4129
4132
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4190,7 +4193,7 @@ var AuthClient = class {
|
|
|
4190
4193
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v1/auth/issuers/{issuerId}");
|
|
4191
4194
|
}
|
|
4192
4195
|
/**
|
|
4193
|
-
* 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.
|
|
4196
|
+
* 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. This is unconditional on the affected users' `status`: suspending them first does not lift the refusal. **A bound registration cannot be replaced, self-service, within its own app context**: registering a replacement issuer under a different issuerId in the SAME context also fails, because the context's one-active-issuer claim is released only when THIS registration is deleted. Two real options: suspend this issuer (stops new exchanges immediately) and register a replacement under a DIFFERENT app context — note that targets a different context, so this context's existing users/roles/access profiles are not carried over; or contact your platform operator, who can force-release this registration so a replacement may be registered in the SAME context under a new issuerId. **The operator path is not a lighter-weight alternative to the first — it PERMANENTLY RETIRES this issuerId and leaves every bound user unable to ever exchange through it again; it does not preserve continuity for them any better than registering under a different context does.** An issuer that has never been used for an exchange (no bound users yet) can always be deregistered.
|
|
4194
4197
|
*
|
|
4195
4198
|
* @param {Vectros.DeleteIssuerRequest} request
|
|
4196
4199
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4316,7 +4319,7 @@ var AuthClient = class {
|
|
|
4316
4319
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/auth/issuers");
|
|
4317
4320
|
}
|
|
4318
4321
|
/**
|
|
4319
|
-
* 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.
|
|
4322
|
+
* 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. A registration without `restrictedToDomain` is created `pending_verification` with a one-time challenge (`verificationClaim`, `verificationNonce`, `verificationExpiresAt`) and accepts no token until you prove you control the issuer with `POST /v1/auth/issuers/{issuerId}/verify`; it claims no `(issuer, audience)` pair until then, so registering never reveals whether another tenant holds one. A registration scoped to an already-verified domain with `restrictedToDomain` is `active` at once. Idempotent by `issuerId` within your 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`. Optionally name `restrictedToDomain` to scope this registration's (issuer, audience) uniqueness to a specific VERIFIED domain rather than the bare pair — see that field's own description. A domain-scoped registration proves control of the DOMAIN, not of the issuer itself: it routes only tokens carrying that domain's `hd` claim.
|
|
4320
4323
|
*
|
|
4321
4324
|
* @param {Vectros.IssuerRequest} request
|
|
4322
4325
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4382,6 +4385,82 @@ var AuthClient = class {
|
|
|
4382
4385
|
}
|
|
4383
4386
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/auth/issuers");
|
|
4384
4387
|
}
|
|
4388
|
+
/**
|
|
4389
|
+
* Proves you administer the IdP application a `pending_verification` registration names, activating it. A registration created without `restrictedToDomain` accepts no tokens until this succeeds. Configure your IdP, with an admin-controlled rule (an Auth0 Action, an Okta inline hook, an Entra claims-mapping policy, a Keycloak protocol mapper), to add the registration's `verificationClaim` to the tokens it issues, set to its `verificationNonce`; sign in once; and send that token here. The `jwksUri` you registered must be exactly the `jwks_uri` your issuer's OpenID Connect discovery document (`<issuer>/.well-known/openid-configuration`) publishes, and the token must verify against that key set — an issuer that publishes no discovery document cannot be verified this way. The token is checked and discarded; it is never stored. The `(issuer, audience)` pair is claimed at this moment, so a pair another registration already holds is refused with 400. A challenge expires 7 days after registration; an expired registration cannot be verified — delete it and register again. 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 verify an issuer registered in that context; naming one registered in another context returns 404, identically to a nonexistent issuerId.
|
|
4390
|
+
*
|
|
4391
|
+
* @param {Vectros.IssuerVerifyRequest} request
|
|
4392
|
+
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4393
|
+
*
|
|
4394
|
+
* @throws {@link Vectros.BadRequestError}
|
|
4395
|
+
* @throws {@link Vectros.ForbiddenError}
|
|
4396
|
+
* @throws {@link Vectros.NotFoundError}
|
|
4397
|
+
* @throws {@link Vectros.ConflictError}
|
|
4398
|
+
* @throws {@link Vectros.TooManyRequestsError}
|
|
4399
|
+
*
|
|
4400
|
+
* @example
|
|
4401
|
+
* await client.auth.verifyIssuer({
|
|
4402
|
+
* issuerId: "auth0-prod",
|
|
4403
|
+
* token: "token"
|
|
4404
|
+
* })
|
|
4405
|
+
*/
|
|
4406
|
+
verifyIssuer(request, requestOptions) {
|
|
4407
|
+
return HttpResponsePromise.fromPromise(this.__verifyIssuer(request, requestOptions));
|
|
4408
|
+
}
|
|
4409
|
+
async __verifyIssuer(request, requestOptions) {
|
|
4410
|
+
const { issuerId, ..._body } = request;
|
|
4411
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4412
|
+
const _headers = mergeHeaders(
|
|
4413
|
+
_authRequest.headers,
|
|
4414
|
+
this._options?.headers,
|
|
4415
|
+
requestOptions?.headers
|
|
4416
|
+
);
|
|
4417
|
+
const _response = await fetcher({
|
|
4418
|
+
url: url_exports.join(
|
|
4419
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4420
|
+
`v1/auth/issuers/${url_exports.encodePathParam(issuerId)}/verify`
|
|
4421
|
+
),
|
|
4422
|
+
method: "POST",
|
|
4423
|
+
headers: _headers,
|
|
4424
|
+
contentType: "application/json",
|
|
4425
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4426
|
+
requestType: "json",
|
|
4427
|
+
body: _body,
|
|
4428
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4429
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4430
|
+
abortSignal: requestOptions?.abortSignal,
|
|
4431
|
+
fetchFn: this._options?.fetch,
|
|
4432
|
+
logging: this._options.logging
|
|
4433
|
+
});
|
|
4434
|
+
if (_response.ok) {
|
|
4435
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4436
|
+
}
|
|
4437
|
+
if (_response.error.reason === "status-code") {
|
|
4438
|
+
switch (_response.error.statusCode) {
|
|
4439
|
+
case 400:
|
|
4440
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4441
|
+
case 403:
|
|
4442
|
+
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4443
|
+
case 404:
|
|
4444
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4445
|
+
case 409:
|
|
4446
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
4447
|
+
case 429:
|
|
4448
|
+
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
4449
|
+
default:
|
|
4450
|
+
throw new VectrosError({
|
|
4451
|
+
statusCode: _response.error.statusCode,
|
|
4452
|
+
body: _response.error.body,
|
|
4453
|
+
rawResponse: _response.rawResponse
|
|
4454
|
+
});
|
|
4455
|
+
}
|
|
4456
|
+
}
|
|
4457
|
+
return handleNonStatusCodeError(
|
|
4458
|
+
_response.error,
|
|
4459
|
+
_response.rawResponse,
|
|
4460
|
+
"POST",
|
|
4461
|
+
"/v1/auth/issuers/{issuerId}/verify"
|
|
4462
|
+
);
|
|
4463
|
+
}
|
|
4385
4464
|
/**
|
|
4386
4465
|
* Returns the identity bound to your credential — your account, principal type, key id, and scope details — so you can confirm who you are authenticated as and that the credential is valid. MCP clients use this to render "signed in as ..." in a chat UI without a separate identity endpoint.
|
|
4387
4466
|
*
|
|
@@ -5814,7 +5893,7 @@ var DocumentsClient = class {
|
|
|
5814
5893
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/documents/{id}/versions");
|
|
5815
5894
|
}
|
|
5816
5895
|
/**
|
|
5817
|
-
* Starts a file-based document by returning a short-lived presigned S3 PUT URL. Upload the file bytes directly to `uploadUrl`; the document is then automatically queued for text extraction and asynchronous indexing. Supplying an `externalId` makes this idempotent — re-initiating an upload with the same `externalId` re-issues a fresh presigned URL
|
|
5896
|
+
* Starts a file-based document by returning a short-lived presigned S3 PUT URL. Upload the file bytes directly to `uploadUrl`; the document is then automatically queued for text extraction and asynchronous indexing. Supplying an `externalId` makes this idempotent — re-initiating an upload with the same `externalId` re-issues a fresh presigned URL for the SAME existing document, targeting a newly-staged object rather than the document's current one — your PUT lands there first, and the document only adopts it once the upload is validated (so a re-upload inherently replaces the file body) rather than creating a duplicate. The response's `created` field (and the HTTP status — 201 when a new document was minted, 200 when an existing one was matched) tells the two apart. With `?upsert=true`, the submitted `payload`/`title` are also applied to the matched document (file-body divergence cannot be diffed at upload-init — the bytes have not arrived yet — so the re-upload itself replaces the body). Creating a NEW document requires the `documents:c` scope. Re-uploading over an EXISTING document overwrites (and re-indexes) its body, so it is an update: it requires the `documents:u` scope (as does `?upsert=true` for the metadata). **Your PUT to `uploadUrl` MUST include the header named in the response's `requiredHeaderName`, set to `requiredHeaderValue` exactly.** It is a signed part of the presigned request — the PUT never reaches this service either way, so neither failure uses this API's JSON error shape. Omitting it, or sending a different value, invalidates the request's signature and S3 rejects it with a 403 `SignatureDoesNotMatch`. Sending it correctly makes the URL single-use: `requiredHeaderName` is always `If-None-Match` and `requiredHeaderValue` is always `*` — a create, a recovery upload for a document whose earlier file is missing, and a re-upload ALL target a freshly-minted, never-written key, so the same S3 conditional-write precondition applies uniformly (S3's own documented conditional-write behavior): a replay after the object already exists (from your own completed PUT, or anyone else's) fails with `412 Precondition Failed`; a replay after the object was deleted and never re-created finds an absent key again and can succeed — single-use is a property of the object's existence, not a one-time token. **Either precondition can also fail with `409 Conflict` if your PUT genuinely races a concurrent delete on the same object.** Whichever of `412` or `409` you receive, the remedy is the same: call this endpoint again for a fresh URL rather than retrying the same PUT — a fresh call always targets a new key, so it is never subject to whatever raced the previous one.
|
|
5818
5897
|
*
|
|
5819
5898
|
* @param {Vectros.FileUploadRequest} request
|
|
5820
5899
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -7580,7 +7659,7 @@ var IdentityClient = class {
|
|
|
7580
7659
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/users/exists-by-email");
|
|
7581
7660
|
}
|
|
7582
7661
|
/**
|
|
7583
|
-
* Returns the audit trail of changes to a user, most recent first. Identity history is always recorded
|
|
7662
|
+
* Returns the audit trail of changes to a user, most recent first, including after the user has been deleted. Identity history is always recorded. Post-delete, this is readable by an account-level (root) API key only — a context-confined credential 404s after the delete, the same response it would get for a nonexistent id. Sensitive field values are redacted in every historical version. Returns a page in the `{data, nextCursor}` envelope. Requires the `users:r` scope.
|
|
7584
7663
|
*
|
|
7585
7664
|
* @param {Vectros.GetUserVersionsRequest} request
|
|
7586
7665
|
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -8650,7 +8729,7 @@ var RecordsClient = class {
|
|
|
8650
8729
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/records/lookup");
|
|
8651
8730
|
}
|
|
8652
8731
|
/**
|
|
8653
|
-
* Returns the tombstone left behind when a record was hard-deleted, confirming the deletion and recording when it happened. Look it up using the deleted record's original ID. Requires the `records:r:<type>` scope.
|
|
8732
|
+
* Returns the tombstone left behind when a record was hard-deleted, confirming the deletion and recording when it happened. Look it up using the deleted record's original ID. Requires the `records:r:<type>` scope, granted without a `data_scope` restriction: the owner of a deleted record cannot be checked, so a credential confined to an ownership compartment (e.g. `data_scope: {scope:org: [org_A]}`) cannot read tombstones, including for records it owned.
|
|
8654
8733
|
*
|
|
8655
8734
|
* @param {Vectros.GetRecordTombstoneRequest} request
|
|
8656
8735
|
* @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -9057,7 +9136,7 @@ var SchemasClient = class {
|
|
|
9057
9136
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v1/schemas/{id}");
|
|
9058
9137
|
}
|
|
9059
9138
|
/**
|
|
9060
|
-
* Permanently deletes a record schema. The request is refused with 409 if records of this type still exist — delete those records first, since every record must reference a live schema. A lineage base (a schema other schemas declare `basedOn`) also cannot be deleted while any such variant still exists — delete the variant schema(s) first. It is likewise refused while any trigger rule fires off this schema — delete those trigger rules first. Requires the `schemas:d` scope.
|
|
9139
|
+
* Permanently deletes a record schema. The request is refused with 409 if records of this type still exist — delete those records first, since every record must reference a live schema. The same applies to documents bound to this schema (for a schema declaring the `document` surface) — delete those documents first. A lineage base (a schema other schemas declare `basedOn`) also cannot be deleted while any such variant still exists — delete the variant schema(s) first. It is likewise refused while any trigger rule fires off this schema — delete those trigger rules first. Requires the `schemas:d` scope.
|
|
9061
9140
|
*
|
|
9062
9141
|
* @param {Vectros.DeleteSchemaRequest} request
|
|
9063
9142
|
* @param {SchemasClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -9192,7 +9271,7 @@ var ScriptsClient = class {
|
|
|
9192
9271
|
*
|
|
9193
9272
|
* **Budget.** Seconds of useful work: the script has 15 s of wall clock (never more than 16) and a bounded number of statements and host calls; a runaway script is stopped early with `RESOURCE_LIMIT_EXCEEDED`. The transaction is bounded by the number of underlying storage rows it writes — 100 rows after merging — rather than by the number of entities: creating a folder costs 3 rows; creating a plain text document or a record costs 1 row plus one per range-indexed lookup field plus one per `reference` field. So "create a folder and file N documents" holds up to 97 plain documents, 48 with one range field or one reference, 32 with both; if a script exceeds the limit the error says so (`WRITE_BUFFER_CAP_EXCEEDED`, with `total` and `limit`) and nothing is committed. This request takes the write-path limits (burst, credit ceiling, principal quota) once, before the script runs — there is no free-read allowance here, so an account over its credit ceiling is refused even for a read-only script. Reads the script performs are metered as reads, writes as writes, and execution time beyond what those operations include is charged as script execution time (see `GET /v1/usage`).
|
|
9194
9273
|
*
|
|
9195
|
-
* **Reads inside the script.** A `get` sees the script's own staged writes. A list, query or lookup never shows a row the script has deleted, shows a row it re-saved with the updated content, and does not
|
|
9274
|
+
* **Reads inside the script.** A `get` sees the script's own staged writes. A list, query or lookup never shows a row the script has deleted, shows a row it re-saved with the updated content, and does not show a row it created — you hold that row's id from `create()`.
|
|
9196
9275
|
*
|
|
9197
9276
|
* **Retries.** Send an optional `Idempotency-Key` header (1–128 characters of letters, digits, `.`, `_`, `:` or `-`) to make a retry safe: a request repeated under the same key within 24 hours receives the same response as the first attempt without executing again — when that first attempt SUCCEEDED (a duplicate still in flight is refused with `409 IDEMPOTENCY_IN_PROGRESS`; the same key on a different request is refused with `422 IDEMPOTENCY_KEY_REUSED`). A first attempt that FAILED with any other status is not remembered: the same key is free to try again, so a retry after a `400` or a `429` executes. If an execution's outcome cannot be determined — the script did not finish inside the budget while its writes may have committed — the response is `500 EXECUTION_OUTCOME_UNKNOWN` carrying `execution.id`, and a keyed retry receives that same answer: inspect what the script would have written, then use a NEW key for a new attempt. When a key is present the serialised `result` is capped at 16 KB instead of 256 KB. Without a key, a lost response cannot be distinguished from a failed one; re-read before retrying.
|
|
9198
9277
|
*
|
|
@@ -9287,11 +9366,14 @@ var ScriptsClient = class {
|
|
|
9287
9366
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/scripts/execute");
|
|
9288
9367
|
}
|
|
9289
9368
|
/**
|
|
9290
|
-
* Returns a paginated list of your scripts. Pass `name` to list every version of one script name (oldest first); omit it for a flat list across every name in your account (newest first). Results are returned as a `{data, nextCursor}` envelope — pass `nextCursor` as `startFrom` to fetch the next page. Requires the `scripts:r` scope.
|
|
9369
|
+
* Returns a paginated list of your scripts. Pass `name` to list every version of one script name (oldest first); omit it for a flat list across every name in your account (newest first). Results are returned as a `{data, nextCursor}` envelope — pass `nextCursor` as `startFrom` to fetch the next page. Requires the `scripts:r` scope. **Each row's `source` is omitted by default** (`sourceOmitted: true`) — scripts are immutable per version, so a name's version history can otherwise carry every version's complete source in one response. Pass `?includeSource=true` to get it back inline, or fetch one version's full source with a by-id GET. **`?name=<n>&latest=true`** answers "what is the current version of this name" in one bounded call — a single `ScriptResponse` object (not a page), instead of draining every page of the name's version history to find the newest yourself.
|
|
9291
9370
|
*
|
|
9292
9371
|
* @param {Vectros.ListScriptsRequest} request
|
|
9293
9372
|
* @param {ScriptsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
9294
9373
|
*
|
|
9374
|
+
* @throws {@link Vectros.BadRequestError}
|
|
9375
|
+
* @throws {@link Vectros.NotFoundError}
|
|
9376
|
+
*
|
|
9295
9377
|
* @example
|
|
9296
9378
|
* await client.scripts.listScripts({
|
|
9297
9379
|
* name: "notify-assignee",
|
|
@@ -9302,11 +9384,13 @@ var ScriptsClient = class {
|
|
|
9302
9384
|
return HttpResponsePromise.fromPromise(this.__listScripts(request, requestOptions));
|
|
9303
9385
|
}
|
|
9304
9386
|
async __listScripts(request = {}, requestOptions) {
|
|
9305
|
-
const { name, startFrom, limit } = request;
|
|
9387
|
+
const { name, startFrom, limit, includeSource, latest } = request;
|
|
9306
9388
|
const _queryParams = {
|
|
9307
9389
|
name,
|
|
9308
9390
|
startFrom,
|
|
9309
|
-
limit
|
|
9391
|
+
limit,
|
|
9392
|
+
includeSource,
|
|
9393
|
+
latest
|
|
9310
9394
|
};
|
|
9311
9395
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
9312
9396
|
const _headers = mergeHeaders(
|
|
@@ -9332,16 +9416,23 @@ var ScriptsClient = class {
|
|
|
9332
9416
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
9333
9417
|
}
|
|
9334
9418
|
if (_response.error.reason === "status-code") {
|
|
9335
|
-
|
|
9336
|
-
|
|
9337
|
-
|
|
9338
|
-
|
|
9339
|
-
|
|
9419
|
+
switch (_response.error.statusCode) {
|
|
9420
|
+
case 400:
|
|
9421
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
9422
|
+
case 404:
|
|
9423
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
9424
|
+
default:
|
|
9425
|
+
throw new VectrosError({
|
|
9426
|
+
statusCode: _response.error.statusCode,
|
|
9427
|
+
body: _response.error.body,
|
|
9428
|
+
rawResponse: _response.rawResponse
|
|
9429
|
+
});
|
|
9430
|
+
}
|
|
9340
9431
|
}
|
|
9341
9432
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/scripts");
|
|
9342
9433
|
}
|
|
9343
9434
|
/**
|
|
9344
|
-
* Stores a new version of a script object. Every POST creates a genuinely new version — this is NOT idempotent-by-name: pushing `name` again always creates a new row with `scriptVersion` auto-incremented (the first version pushed for a name is 1). `source` is stored as-is: nothing parses or validates it at push time. A version runs when a trigger rule references it (`POST /v1/triggers`) or when `POST /v1/scripts/execute` names it. Requires the `scripts:c` scope.
|
|
9435
|
+
* Stores a new version of a script object. Every POST creates a genuinely new version — this is NOT idempotent-by-name: pushing `name` again always creates a new row with `scriptVersion` auto-incremented (the first version pushed for a name is 1). `source` is stored as-is: nothing parses or validates it at push time. A version runs when a trigger rule references it (`POST /v1/triggers`) or when `POST /v1/scripts/execute` names it. `provisionedBy` MAY BE SET ON ABSENT, NEVER CHANGED, evaluated against the CURRENT LATEST version of this `name` at push time: if the latest version has no marker recorded, this push may set any value; if the latest version already has one, an omitted value inherits it forward and a DIFFERENT value is refused — a live comparison against whichever version is newest at push time, not a value fixed for the name's whole history. Pushing onto an EXISTING name with no `provisionedBy` recorded on its current latest version additionally requires that you were the caller who pushed that latest version — a name carrying a `provisionedBy` marker is exempt from this check (proving you can supply or inherit the matching marker is itself the ownership proof there). Requires the `scripts:c` scope.
|
|
9345
9436
|
*
|
|
9346
9437
|
* @param {Vectros.ScriptRequest} request
|
|
9347
9438
|
* @param {ScriptsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -9528,12 +9619,13 @@ var ScriptsClient = class {
|
|
|
9528
9619
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v1/scripts/{id}");
|
|
9529
9620
|
}
|
|
9530
9621
|
/**
|
|
9531
|
-
* Permanently deletes one script version by ID. Deleting one version does not affect any other version of the same name. Requires the `scripts:d` scope.
|
|
9622
|
+
* Permanently deletes one script version by ID. Deleting one version does not affect any other version of the same name. Requires the `scripts:d` scope. Refused with 409 if a live trigger rule still references this version — either directly (a pinned `scriptRef`), or via `"latest"` when this IS the newest version of its name. Delete or re-point those rules first.
|
|
9532
9623
|
*
|
|
9533
9624
|
* @param {Vectros.DeleteScriptRequest} request
|
|
9534
9625
|
* @param {ScriptsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
9535
9626
|
*
|
|
9536
9627
|
* @throws {@link Vectros.NotFoundError}
|
|
9628
|
+
* @throws {@link Vectros.ConflictError}
|
|
9537
9629
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
9538
9630
|
*
|
|
9539
9631
|
* @example
|
|
@@ -9573,6 +9665,8 @@ var ScriptsClient = class {
|
|
|
9573
9665
|
switch (_response.error.statusCode) {
|
|
9574
9666
|
case 404:
|
|
9575
9667
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
9668
|
+
case 409:
|
|
9669
|
+
throw new ConflictError(_response.error.body, _response.rawResponse);
|
|
9576
9670
|
case 429:
|
|
9577
9671
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
9578
9672
|
default:
|
|
@@ -10165,8 +10259,8 @@ function warnOnSuboptimalKey(key, log) {
|
|
|
10165
10259
|
|
|
10166
10260
|
// src/build-info.ts
|
|
10167
10261
|
var BUILD_INFO = {
|
|
10168
|
-
mcpServer: true ? "0.17.
|
|
10169
|
-
sdk: true ? "0.
|
|
10262
|
+
mcpServer: true ? "0.17.2" : "dev",
|
|
10263
|
+
sdk: true ? "0.45.0" : "dev"
|
|
10170
10264
|
};
|
|
10171
10265
|
|
|
10172
10266
|
// src/log.ts
|
|
@@ -10502,6 +10596,8 @@ var hybridSearch = ({ client, log }) => ({
|
|
|
10502
10596
|
title: "Hybrid search",
|
|
10503
10597
|
description: 'Search your tenant\'s indexed content (documents + structured records) using hybrid BM25 + dense ranking. Returns up to `limit` results (default 3, max 50 \u2014 raise it in one call when you can accept the larger result) with citations and surrounding context for grounding follow-up reasoning. Narrow with contentTypes/typeName/filters, ownership (userId, and scope for ONE ownership dimension or scopeFilters for several at once \u2014 e.g. one client within one org), folder scope, a created date window, keyword precision (textMode OR/AND/PHRASE), relevance floors (minSimilarity/minTextRelevance), uniqueDocuments, and requireComplete (fail closed on a degraded backend). Tenant-isolated; the caller\'s scoped key fully constrains which content is visible. ARCHIVED (soft-retracted) documents AND records are excluded from results \u2014 fetch them by id via document_get/record_get, or restore them by setting status back to ACTIVE. One exception to know: an item archived before the platform enforced this can still be returned here until it is next written to, and nothing sweeps for those \u2014 if an archived item does come back as a hit, re-send status ARCHIVED on it (document_update / record_update) to re-assert the retraction. A hit\'s `createdAt` is when the item entered the search INDEX, which is the moment it was created in the common case but is later for anything re-indexed since \u2014 so do not report it to a user as the creation time; fetch the item with document_get/record_get and read its own createdAt for that. (The createdAfter/createdBefore filters are a separate thing and do filter on true creation time.) To stay within the agent context window each hit returns its matched chunkText + a short snippet by default; set includeContext:true for the broader surrounding passage. If the whole result would be too large it is truncated to the top hits (truncated:true). totalResults is the full matching pool and hasMore:true means results remain past this page \u2014 raise limit or advance offset to fetch them. textLegEmpty:true flags that the keyword (BM25) leg matched nothing (all textScores 0) \u2014 typically the default PHRASE mode finding no contiguous match for a long natural-language query. Loosen the keyword leg: shorten the query to its key terms, or set textMode "AND" (all terms, higher precision) or "OR" (any term, broad recall).',
|
|
10504
10598
|
inputSchema,
|
|
10599
|
+
// A pure read — never creates, modifies, or deletes anything server-side.
|
|
10600
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
|
|
10505
10601
|
handler: async (args) => {
|
|
10506
10602
|
const limit = args.limit ?? MCP_DEFAULT_LIMIT;
|
|
10507
10603
|
const mode = args.mode ?? "HYBRID";
|
|
@@ -10650,6 +10746,8 @@ var recordQuery = ({ client, log }) => ({
|
|
|
10650
10746
|
title: "Record query (list or lookup)",
|
|
10651
10747
|
description: "Query structured records of a given type. Two modes:\n \u2022 Lookup on a lookup-indexed field: pass `field` plus exactly one of `value` (exact), `values` (exact, composite \u2014 one value per field; a single-element array is the same as `value`), `from`+`to` (range), or `prefix`. `values` with more than one entry, or a comma-joined `field`, ONLY works for a lookup the schema itself declared over several fields together \u2014 check list_schemas' lookupFields for a fieldNames entry, then pass those field names comma-joined as `field`; `from`/`to`/`prefix` are not valid there. Works on sensitive fields too. Optionally narrow an exact match to a window with `sortFrom`/`sortTo`.\n \u2022 List: omit `field`, then choose ONE of `type` (every record of a type), `folderId` (every record filed in a folder, any type \u2014 combine with `type` for one type within one folder), or `recent` (the account-wide recently-updated feed across every type, newest first \u2014 the only way to read records without naming a type, and standalone: no other filter applies to it). `userId`/`scope` further narrow the type and folder modes.\nReturns a `{ data, nextCursor }` page: `data` holds up to `limit` records (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. A composite lookup given fewer than its full field count returns records grouped by the unspecified fields, ordered within each group. Mode is auto-detected from the arguments present.",
|
|
10652
10748
|
inputSchema: inputSchema2,
|
|
10749
|
+
// A pure read — never creates, modifies, or deletes anything server-side.
|
|
10750
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
|
|
10653
10751
|
handler: async (args) => {
|
|
10654
10752
|
const limit = args.limit ?? MCP_DEFAULT_LIMIT2;
|
|
10655
10753
|
const type = args.type;
|
|
@@ -10895,6 +10993,8 @@ var recordGet = ({ client, log }) => ({
|
|
|
10895
10993
|
title: "Get a record by id or externalId",
|
|
10896
10994
|
description: "Fetch a single structured record, including the full payload. Select it EITHER by its Vectros `id` (e.g. from record_query / hybrid_search) OR by your own `externalId` + `type` \u2014 the same key you passed to record_create, resolved for you (no manual record_query lookup needed). Very large payloads are truncated to protect the agent context window. The response carries the record's processing `indexStatus`; when it is FAILED an `indexFailure.code` explains whether the content is still searchable (e.g. VECTOR_LIMIT_EXCEEDED keeps keyword search vs INDEXING_FAILED = not findable at all) \u2014 branch on the `code`, not the message.",
|
|
10897
10995
|
inputSchema: inputSchema3,
|
|
10996
|
+
// A pure read — never creates, modifies, or deletes anything server-side.
|
|
10997
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
|
|
10898
10998
|
handler: async (args) => {
|
|
10899
10999
|
const id = args.id;
|
|
10900
11000
|
const externalId = args.externalId;
|
|
@@ -10940,6 +11040,8 @@ var recordBatchGet = ({ client, log }) => ({
|
|
|
10940
11040
|
title: "Get multiple records by id in one call",
|
|
10941
11041
|
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.",
|
|
10942
11042
|
inputSchema: inputSchema4,
|
|
11043
|
+
// A pure read — never creates, modifies, or deletes anything server-side.
|
|
11044
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
|
|
10943
11045
|
handler: async (args) => {
|
|
10944
11046
|
const ids = args.ids;
|
|
10945
11047
|
try {
|
|
@@ -10998,6 +11100,13 @@ var recordCreate = ({ client, log }) => ({
|
|
|
10998
11100
|
title: "Create a record",
|
|
10999
11101
|
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).",
|
|
11000
11102
|
inputSchema: inputSchema5,
|
|
11103
|
+
// Creates, never modifies or deletes an existing record. Idempotent ONLY when the caller
|
|
11104
|
+
// supplies `externalId` (optional, per the doc comment above) — re-creating with the same
|
|
11105
|
+
// one returns the existing record rather than duplicating it. `externalId` is not required,
|
|
11106
|
+
// so annotated for the less-safe default (omit it, and a retry creates a second record),
|
|
11107
|
+
// not the safer opt-in — same standard applied to record_batch_write, which has the
|
|
11108
|
+
// identical optional-externalId shape.
|
|
11109
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
|
|
11001
11110
|
handler: async (args) => {
|
|
11002
11111
|
const type = args.type;
|
|
11003
11112
|
try {
|
|
@@ -11063,6 +11172,15 @@ var recordBatchWrite = ({ client, log }) => ({
|
|
|
11063
11172
|
title: "Create or upsert multiple records in one call",
|
|
11064
11173
|
description: 'Write up to 50 structured records in a single call \u2014 use this instead of N record_create calls when you hold several records (e.g. filing a parsed table, or seeding a set of tasks). Items may mix types; each one is schema-validated, externalId-idempotent and scope-checked individually against its own type (records:c:<type> per item), so a batch cannot write a type you could not write one at a time. `atomicity` chooses the commit shape: "best_effort" (default) writes each item independently; "all_or_nothing" commits every item in one transaction, writing nothing at all if any item fails \u2014 prefer it when a half-written set would be worse than none. IMPORTANT: this call reports success whenever the batch was PROCESSED, including when every item failed \u2014 so always read the per-item `results` and the `succeeded`/`failed` counts rather than treating a non-error result as "all written". This differs from record_create, where a failure is an error result. Results are NOT guaranteed to arrive in the order you submitted: match each one to its item by its `index` (zero-based, the position in your `items` array). A result carries the written record\'s `id` (null on failure) and, when it failed, an `error` with a machine-readable `code` and a human-readable `message` \u2014 read it before resubmitting. It does NOT carry the record itself; fetch that with record_get/record_batch_get. A per-item `status` is created (new record written), updated (an existing record matched \u2014 overwritten only if you passed upsert:true, otherwise returned unchanged, so this is not by itself evidence of a write), conflict (uniqueness or version), invalid (validation \u2014 read `error.message` for which field), forbidden (your credential lacks the scope or ownership that item needed \u2014 fix the credential, not the item), or not_committed (this item was fine but an all_or_nothing batch was aborted by a different item, so resubmitting with that one fixed writes this one unchanged).',
|
|
11065
11174
|
inputSchema: inputSchema6,
|
|
11175
|
+
// Creates by default, and can overwrite existing records as a FULL replacement when
|
|
11176
|
+
// `upsert:true` is passed (destructive to whatever fields the old version carried and
|
|
11177
|
+
// this call omits). Idempotent ONLY when every item supplies `externalId` (optional,
|
|
11178
|
+
// per its own field doc above) — re-submitting then converges, with or without
|
|
11179
|
+
// `upsert:true`. `externalId` is not required, so annotated for the less-safe default:
|
|
11180
|
+
// an item with no `externalId` at all has no dedup key, and a resubmit creates a second
|
|
11181
|
+
// record for it regardless of `upsert`. Same standard applied to record_create/
|
|
11182
|
+
// document_ingest's identical optional-externalId shape.
|
|
11183
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
|
|
11066
11184
|
handler: async (args) => {
|
|
11067
11185
|
const items = args.items;
|
|
11068
11186
|
const atomicity = args.atomicity;
|
|
@@ -11126,6 +11244,10 @@ var recordUpdate = ({ client, log }) => ({
|
|
|
11126
11244
|
title: "Update a record by id or externalId",
|
|
11127
11245
|
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.",
|
|
11128
11246
|
inputSchema: inputSchema7,
|
|
11247
|
+
// A JSON Merge Patch — overwrites the fields it names, so it can destroy a prior field
|
|
11248
|
+
// value the caller did not mean to lose. Re-applying the same patch converges to the
|
|
11249
|
+
// same state, so it is idempotent.
|
|
11250
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true },
|
|
11129
11251
|
handler: async (args) => {
|
|
11130
11252
|
const id = args.id;
|
|
11131
11253
|
const externalId = args.externalId;
|
|
@@ -11160,6 +11282,10 @@ var recordDelete = ({ client, log }) => ({
|
|
|
11160
11282
|
title: "Delete a record",
|
|
11161
11283
|
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.",
|
|
11162
11284
|
inputSchema: inputSchema8,
|
|
11285
|
+
// Deletes (leaves a tombstone server-side, but the record is gone from every normal
|
|
11286
|
+
// read path). Idempotent in the standard REST sense: the end state ("this id no longer
|
|
11287
|
+
// resolves") is the same whether this is the first delete or a repeat of one.
|
|
11288
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true },
|
|
11163
11289
|
handler: async (args) => {
|
|
11164
11290
|
const id = args.id;
|
|
11165
11291
|
try {
|
|
@@ -11222,6 +11348,15 @@ var ragAsk = ({ client, log }) => ({
|
|
|
11222
11348
|
title: "RAG ask (corpus-wide)",
|
|
11223
11349
|
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 \u2014 `scope` for one ownership dimension or `scopeFilters` for several at once, e.g. one client within one org \u2014 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.",
|
|
11224
11350
|
inputSchema: inputSchema9,
|
|
11351
|
+
// NOT a pure read: this call reserves an atomic hold against the caller's prepaid inference
|
|
11352
|
+
// balance before generation starts, then debits it on completion — a real financial side
|
|
11353
|
+
// effect that can trigger a configured auto-recharge against the tenant's card.
|
|
11354
|
+
// `readOnlyHint:true` would let a host
|
|
11355
|
+
// skip a confirmation prompt on a call with real, unbounded-under-retry spend; ordinary reads
|
|
11356
|
+
// that merely meter usage stay `readOnlyHint:true` (hybrid_search has no inference-cost leg),
|
|
11357
|
+
// but a call that can debit a balance and possibly charge a card is a different class. Not
|
|
11358
|
+
// idempotent either: every repeat charges again, and generation is non-deterministic.
|
|
11359
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
|
|
11225
11360
|
handler: async (args, extra) => {
|
|
11226
11361
|
const rawSearch = args.search ?? {};
|
|
11227
11362
|
if (rawSearch.scope !== void 0 && rawSearch.scopeFilters !== void 0) {
|
|
@@ -11321,6 +11456,15 @@ var documentAsk = ({ client, log }) => ({
|
|
|
11321
11456
|
title: "Document ask (single-document)",
|
|
11322
11457
|
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.",
|
|
11323
11458
|
inputSchema: inputSchema10,
|
|
11459
|
+
// NOT a pure read: this call reserves an atomic hold against the caller's prepaid inference
|
|
11460
|
+
// balance before generation starts, then debits it on completion — a real financial side
|
|
11461
|
+
// effect that can trigger a configured auto-recharge against the tenant's card.
|
|
11462
|
+
// `readOnlyHint:true` would let a host
|
|
11463
|
+
// skip a confirmation prompt on a call with real, unbounded-under-retry spend; ordinary reads
|
|
11464
|
+
// that merely meter usage stay `readOnlyHint:true` (hybrid_search has no inference-cost leg),
|
|
11465
|
+
// but a call that can debit a balance and possibly charge a card is a different class. Not
|
|
11466
|
+
// idempotent either: every repeat charges again, and generation is non-deterministic.
|
|
11467
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
|
|
11324
11468
|
handler: async (args, extra) => {
|
|
11325
11469
|
try {
|
|
11326
11470
|
const stream = await client.inference.documentAsk({
|
|
@@ -11399,6 +11543,8 @@ var listSchemas = ({ client, log }) => ({
|
|
|
11399
11543
|
title: "List record schemas",
|
|
11400
11544
|
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.',
|
|
11401
11545
|
inputSchema: inputSchema11,
|
|
11546
|
+
// A pure read — never creates, modifies, or deletes anything server-side.
|
|
11547
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
|
|
11402
11548
|
handler: async (args) => {
|
|
11403
11549
|
const userId = args.userId;
|
|
11404
11550
|
const scope = args.scope;
|
|
@@ -11453,6 +11599,8 @@ var documentGet = ({ client, log }) => ({
|
|
|
11453
11599
|
title: "Get document metadata (and optionally text)",
|
|
11454
11600
|
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.",
|
|
11455
11601
|
inputSchema: inputSchema12,
|
|
11602
|
+
// A pure read — never creates, modifies, or deletes anything server-side.
|
|
11603
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
|
|
11456
11604
|
handler: async (args) => {
|
|
11457
11605
|
const documentId = args.documentId;
|
|
11458
11606
|
const externalId = args.externalId;
|
|
@@ -11547,6 +11695,8 @@ var documentQuery = ({ client, log }) => ({
|
|
|
11547
11695
|
title: "Document query (list or lookup)",
|
|
11548
11696
|
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.",
|
|
11549
11697
|
inputSchema: inputSchema13,
|
|
11698
|
+
// A pure read — never creates, modifies, or deletes anything server-side.
|
|
11699
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
|
|
11550
11700
|
handler: async (args) => {
|
|
11551
11701
|
const limit = args.limit ?? MCP_DEFAULT_LIMIT3;
|
|
11552
11702
|
const field = args.field;
|
|
@@ -11657,6 +11807,10 @@ var documentUpdate = ({ client, log }) => ({
|
|
|
11657
11807
|
title: "Update a document",
|
|
11658
11808
|
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.',
|
|
11659
11809
|
inputSchema: inputSchema14,
|
|
11810
|
+
// A JSON Merge Patch — overwrites the fields it names, so it can destroy a prior field
|
|
11811
|
+
// value the caller did not mean to lose. Re-applying the same patch converges to the
|
|
11812
|
+
// same state, so it is idempotent.
|
|
11813
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true },
|
|
11660
11814
|
handler: async (args) => {
|
|
11661
11815
|
const documentId = args.documentId;
|
|
11662
11816
|
const externalId = args.externalId;
|
|
@@ -11705,6 +11859,9 @@ var documentDelete = ({ client, log }) => ({
|
|
|
11705
11859
|
title: "Delete a document",
|
|
11706
11860
|
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).',
|
|
11707
11861
|
inputSchema: inputSchema15,
|
|
11862
|
+
// Deletes. Idempotent in the standard REST sense: the end state ("this id no longer
|
|
11863
|
+
// resolves") is the same whether this is the first delete or a repeat of one.
|
|
11864
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true },
|
|
11708
11865
|
handler: async (args) => {
|
|
11709
11866
|
const documentId = args.documentId;
|
|
11710
11867
|
try {
|
|
@@ -11742,6 +11899,8 @@ var folderQuery = ({ client, log }) => ({
|
|
|
11742
11899
|
title: "Folder query (list or get)",
|
|
11743
11900
|
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.",
|
|
11744
11901
|
inputSchema: inputSchema16,
|
|
11902
|
+
// A pure read — never creates, modifies, or deletes anything server-side.
|
|
11903
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
|
|
11745
11904
|
handler: async (args) => {
|
|
11746
11905
|
const id = args.id;
|
|
11747
11906
|
try {
|
|
@@ -11776,7 +11935,9 @@ var inputSchema17 = {
|
|
|
11776
11935
|
name: z17.string().min(1, "name is required").describe("Folder display name."),
|
|
11777
11936
|
description: z17.string().optional().describe("Optional description of the folder's purpose."),
|
|
11778
11937
|
parentId: z17.string().optional().describe("Parent folder id \u2014 places the folder under this parent. Omit for the context default root. Create-only."),
|
|
11779
|
-
slug: z17.string().optional().describe(
|
|
11938
|
+
slug: z17.string().optional().describe(
|
|
11939
|
+
"Optional stable slug (sibling-unique; idempotency key). Lowercase letters/digits/hyphens. SUPPLY THIS to make a retry safe \u2014 if omitted, a derived slug is only ever a freshly-proved-free one, so a redelivered call creates a new sibling folder every time rather than matching the first."
|
|
11940
|
+
),
|
|
11780
11941
|
userId: z17.string().optional().describe("Owning user (Vectros UUID)."),
|
|
11781
11942
|
scopes: z17.array(z17.string()).optional().describe(
|
|
11782
11943
|
'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.'
|
|
@@ -11785,8 +11946,18 @@ var inputSchema17 = {
|
|
|
11785
11946
|
var folderCreate = ({ client, log }) => ({
|
|
11786
11947
|
name: "folder_create",
|
|
11787
11948
|
title: "Create a folder",
|
|
11788
|
-
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).",
|
|
11949
|
+
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 ONLY when you pass `slug` explicitly \u2014 omitting it derives a fresh, always-free slug on every call, so a retry creates a new sibling folder rather than matching the first. Requires the key to allow folders:c (and folders:r to receive the existing folder on a collision).",
|
|
11789
11950
|
inputSchema: inputSchema17,
|
|
11951
|
+
// Idempotent ONLY when the caller supplies `slug` explicitly (see the doc comment above): an
|
|
11952
|
+
// omitted slug is derived through a collision-probing suffix loop that returns only a
|
|
11953
|
+
// freshly-proved-free value, so the idempotency check running after that derivation can never
|
|
11954
|
+
// match on the default path. `slug` is optional, so this is annotated for the less-safe default —
|
|
11955
|
+
// the same standard applied to record_create/document_ingest/record_batch_write's identical
|
|
11956
|
+
// optional-dedupe-key shape. (A prior version of this annotation claimed unconditional
|
|
11957
|
+
// idempotency, reasoning that the derived slug made this tool "genuinely structurally different"
|
|
11958
|
+
// from the optional-externalId tools — that reasoning was wrong: the derivation is unconditional,
|
|
11959
|
+
// but it is unconditionally NON-colliding by construction, which is the opposite property.)
|
|
11960
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
|
|
11790
11961
|
handler: async (args) => {
|
|
11791
11962
|
try {
|
|
11792
11963
|
const folder = await client.folders.createFolder({
|
|
@@ -11828,6 +11999,10 @@ var folderUpdate = ({ client, log }) => ({
|
|
|
11828
11999
|
title: "Update a folder",
|
|
11829
12000
|
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.",
|
|
11830
12001
|
inputSchema: inputSchema18,
|
|
12002
|
+
// A JSON Merge Patch — overwrites the fields it names, so it can destroy a prior field
|
|
12003
|
+
// value the caller did not mean to lose. Re-applying the same patch converges to the
|
|
12004
|
+
// same state, so it is idempotent.
|
|
12005
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true },
|
|
11831
12006
|
handler: async (args) => {
|
|
11832
12007
|
const id = args.id;
|
|
11833
12008
|
const name = args.name;
|
|
@@ -11863,6 +12038,9 @@ var folderDelete = ({ client, log }) => ({
|
|
|
11863
12038
|
title: "Delete a folder",
|
|
11864
12039
|
description: 'Permanently delete a folder by id. The folder must be EMPTY first \u2014 it must contain no documents, no records, and no sub-folders \u2014 and a non-empty folder is refused, which is the most common way this call fails. Use record_query with this folderId, and document_query, to see what is in it. Clearing it differs by content type: a document can be moved out (document_update with a different folderId) or deleted. A RECORD can also be re-filed into another folder \u2014 the API supports it \u2014 but THIS SERVER does not expose that yet: record_update has no folderId argument, so from here your only option is record_delete (needs records:d). Do NOT read that as "the record cannot be moved" and delete partner data on that basis: if the record should be kept, move it with the Vectros API/SDK directly rather than deleting it here. A sub-folder cannot be re-parented at all, so nested folders have to be emptied and deleted innermost-first. Note the emptiness check counts everything in the folder, INCLUDING items your credential cannot read \u2014 so a refusal you cannot account for from what you can list is expected behaviour, not a bug, and retrying will not clear it. 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 at all, however empty.',
|
|
11865
12040
|
inputSchema: inputSchema19,
|
|
12041
|
+
// Deletes. Idempotent in the standard REST sense: the end state ("this id no longer
|
|
12042
|
+
// resolves") is the same whether this is the first delete or a repeat of one.
|
|
12043
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true },
|
|
11866
12044
|
handler: async (args) => {
|
|
11867
12045
|
const id = args.id;
|
|
11868
12046
|
try {
|
|
@@ -11886,6 +12064,8 @@ var currentIdentity = ({ log, apiKey, environment }) => ({
|
|
|
11886
12064
|
title: "Current identity (tenant + principal scope)",
|
|
11887
12065
|
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.",
|
|
11888
12066
|
inputSchema: inputSchema20,
|
|
12067
|
+
// A pure read (/v1/ping) — never creates, modifies, or deletes anything server-side.
|
|
12068
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
|
|
11889
12069
|
handler: async () => {
|
|
11890
12070
|
try {
|
|
11891
12071
|
const identity = await resolveIdentity({ log, apiKey, environment });
|
|
@@ -12015,6 +12195,16 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
12015
12195
|
title: "Ingest a new document (text body or file upload)",
|
|
12016
12196
|
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`.",
|
|
12017
12197
|
inputSchema: inputSchema21,
|
|
12198
|
+
// Creates by default, idempotent ONLY when the caller supplies `externalId` (optional,
|
|
12199
|
+
// per the doc comment above) — re-ingest then returns the existing document rather than
|
|
12200
|
+
// duplicating it. `externalId` is not required, so annotated for the less-safe default
|
|
12201
|
+
// (omit it, and every call creates a new document), same standard applied to
|
|
12202
|
+
// record_create/record_batch_write's identical optional-externalId shape. `upsert:true`
|
|
12203
|
+
// is a further, real, named capability of this tool that OVERWRITES an existing
|
|
12204
|
+
// document's content and re-indexes it — that path is destructive to the prior body, so
|
|
12205
|
+
// this is flagged destructive rather than claiming create-only safety a caller can
|
|
12206
|
+
// invoke past.
|
|
12207
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },
|
|
12018
12208
|
handler: async (args) => {
|
|
12019
12209
|
const title = args.title;
|
|
12020
12210
|
const text = args.text;
|
|
@@ -12125,7 +12315,7 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
12125
12315
|
}
|
|
12126
12316
|
const putRes = await fetch(uploadUrl, {
|
|
12127
12317
|
method: "PUT",
|
|
12128
|
-
headers: { "Content-Type": fileType },
|
|
12318
|
+
headers: { "Content-Type": fileType, ...presignedUploadHeaders(upload) },
|
|
12129
12319
|
body: bytes
|
|
12130
12320
|
});
|
|
12131
12321
|
if (!putRes.ok) {
|
|
@@ -12164,6 +12354,13 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
12164
12354
|
}
|
|
12165
12355
|
});
|
|
12166
12356
|
var document_ingest_default = documentIngest;
|
|
12357
|
+
function presignedUploadHeaders(response) {
|
|
12358
|
+
if (typeof response !== "object" || response === null) return {};
|
|
12359
|
+
const { requiredHeaderName, requiredHeaderValue } = response;
|
|
12360
|
+
if (typeof requiredHeaderName !== "string" || requiredHeaderName === "") return {};
|
|
12361
|
+
if (typeof requiredHeaderValue !== "string") return {};
|
|
12362
|
+
return { [requiredHeaderName]: requiredHeaderValue };
|
|
12363
|
+
}
|
|
12167
12364
|
|
|
12168
12365
|
// src/tools/lookup_principal.ts
|
|
12169
12366
|
import { z as z21 } from "zod";
|
|
@@ -12197,6 +12394,8 @@ var lookupPrincipal = ({ client, log }) => ({
|
|
|
12197
12394
|
title: "Look up a user identity or a namespaced identity entity",
|
|
12198
12395
|
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.",
|
|
12199
12396
|
inputSchema: inputSchema22,
|
|
12397
|
+
// A pure read — never creates, modifies, or deletes anything server-side.
|
|
12398
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
|
|
12200
12399
|
handler: async (args) => {
|
|
12201
12400
|
const kind = args.kind;
|
|
12202
12401
|
const isUser = kind === "user";
|
|
@@ -12281,6 +12480,8 @@ var versionHistory = ({ client, log }) => ({
|
|
|
12281
12480
|
title: "Version history (record or document)",
|
|
12282
12481
|
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.",
|
|
12283
12482
|
inputSchema: inputSchema23,
|
|
12483
|
+
// A pure read — never creates, modifies, or deletes anything server-side.
|
|
12484
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
|
|
12284
12485
|
handler: async (args) => {
|
|
12285
12486
|
const resourceType = args.resourceType;
|
|
12286
12487
|
const id = args.id;
|
|
@@ -12558,7 +12759,12 @@ var VectrosMCPServer = class {
|
|
|
12558
12759
|
// MCP client (a well-behaved client rejects an unknown key before the call).
|
|
12559
12760
|
// The server enforces it too (z.object(...).strict() below) so a raw JSON-RPC
|
|
12560
12761
|
// call that skips client validation is still rejected — belt and suspenders.
|
|
12561
|
-
inputSchema: { ...zodShapeToJsonSchema(t.inputSchema), additionalProperties: false }
|
|
12762
|
+
inputSchema: { ...zodShapeToJsonSchema(t.inputSchema), additionalProperties: false },
|
|
12763
|
+
// Forwarded from the tool's own definition, not hand-copied here: adding an
|
|
12764
|
+
// annotation to a tool factory does nothing for a client unless it also reaches
|
|
12765
|
+
// this emitted list — the actual `tools/list` response a host reads, not the
|
|
12766
|
+
// source that builds it.
|
|
12767
|
+
...t.annotations ? { annotations: t.annotations } : {}
|
|
12562
12768
|
}))
|
|
12563
12769
|
})
|
|
12564
12770
|
);
|
|
@@ -12982,7 +13188,8 @@ async function main() {
|
|
|
12982
13188
|
if (notice) log[notice.level]({ alias: notice.alias }, notice.message);
|
|
12983
13189
|
if (!apiKey) {
|
|
12984
13190
|
log.fatal({ reason: resolved.reason }, noKeyMessage(resolved));
|
|
12985
|
-
process.
|
|
13191
|
+
process.exitCode = 1;
|
|
13192
|
+
return;
|
|
12986
13193
|
}
|
|
12987
13194
|
const apiBaseUrl = process.env.VECTROS_API_BASE_URL;
|
|
12988
13195
|
if (apiBaseUrl !== void 0) {
|
|
@@ -12991,7 +13198,8 @@ async function main() {
|
|
|
12991
13198
|
} catch (err) {
|
|
12992
13199
|
const msg = err instanceof InvalidBaseUrlError ? err.message : String(err);
|
|
12993
13200
|
log.fatal({ err: msg }, "invalid VECTROS_API_BASE_URL");
|
|
12994
|
-
process.
|
|
13201
|
+
process.exitCode = 1;
|
|
13202
|
+
return;
|
|
12995
13203
|
}
|
|
12996
13204
|
}
|
|
12997
13205
|
const port = process.env.VECTROS_MCP_HTTP_PORT ? Number.parseInt(process.env.VECTROS_MCP_HTTP_PORT, 10) : void 0;
|
|
@@ -13001,7 +13209,8 @@ async function main() {
|
|
|
13001
13209
|
const allowedOrigins = process.env.VECTROS_MCP_HTTP_ALLOWED_ORIGINS ? [process.env.VECTROS_MCP_HTTP_ALLOWED_ORIGINS] : void 0;
|
|
13002
13210
|
if (port !== void 0 && (!Number.isFinite(port) || port < 1 || port > 65535)) {
|
|
13003
13211
|
log.fatal({ port: process.env.VECTROS_MCP_HTTP_PORT }, "invalid VECTROS_MCP_HTTP_PORT (must be 1-65535)");
|
|
13004
|
-
process.
|
|
13212
|
+
process.exitCode = 1;
|
|
13213
|
+
return;
|
|
13005
13214
|
}
|
|
13006
13215
|
const effectiveHost = host ?? "127.0.0.1";
|
|
13007
13216
|
const allowInsecureHttp = ["1", "true", "yes"].includes(
|
|
@@ -13012,14 +13221,16 @@ async function main() {
|
|
|
13012
13221
|
{ host: effectiveHost },
|
|
13013
13222
|
"refusing to bind a non-loopback host without VECTROS_MCP_HTTP_BEARER_TOKEN \u2014 anyone who can reach this port could call Vectros with your credentials. Set a bearer token, or set VECTROS_MCP_HTTP_ALLOW_INSECURE=1 to override (NOT recommended)."
|
|
13014
13223
|
);
|
|
13015
|
-
process.
|
|
13224
|
+
process.exitCode = 1;
|
|
13225
|
+
return;
|
|
13016
13226
|
}
|
|
13017
13227
|
let tools;
|
|
13018
13228
|
try {
|
|
13019
13229
|
tools = parseToolsEnv(process.env.VECTROS_MCP_TOOLS);
|
|
13020
13230
|
} catch (err) {
|
|
13021
13231
|
log.fatal({ err: String(err) }, "invalid VECTROS_MCP_TOOLS");
|
|
13022
|
-
process.
|
|
13232
|
+
process.exitCode = 1;
|
|
13233
|
+
return;
|
|
13023
13234
|
}
|
|
13024
13235
|
const skipFlag = (process.env.VECTROS_MCP_SKIP_PING_VALIDATION ?? "").toLowerCase();
|
|
13025
13236
|
const validateOnStart = !(skipFlag === "1" || skipFlag === "true");
|
|
@@ -13039,7 +13250,8 @@ async function main() {
|
|
|
13039
13250
|
} else {
|
|
13040
13251
|
log.fatal({ err: String(err) }, "startup failed");
|
|
13041
13252
|
}
|
|
13042
|
-
process.
|
|
13253
|
+
process.exitCode = 1;
|
|
13254
|
+
return;
|
|
13043
13255
|
}
|
|
13044
13256
|
let handle;
|
|
13045
13257
|
try {
|
|
@@ -13054,7 +13266,8 @@ async function main() {
|
|
|
13054
13266
|
});
|
|
13055
13267
|
} catch (err) {
|
|
13056
13268
|
log.fatal({ err: String(err) }, "failed to start HTTP transport");
|
|
13057
|
-
process.
|
|
13269
|
+
process.exitCode = 2;
|
|
13270
|
+
return;
|
|
13058
13271
|
}
|
|
13059
13272
|
const shutdown = async (signal) => {
|
|
13060
13273
|
log.info({ signal }, "shutdown requested");
|