@vectros-ai/mcp-server 0.17.2 → 0.18.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 +55 -0
- package/README.md +52 -29
- package/dist/cli-http.js +210 -169
- package/dist/cli-http.js.map +1 -1
- package/dist/cli-http.mjs +210 -169
- package/dist/cli-http.mjs.map +1 -1
- package/dist/cli.js +210 -169
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +210 -169
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +210 -169
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +210 -169
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -46,6 +46,7 @@ __export(api_exports, {
|
|
|
46
46
|
ContentTooLargeError: () => ContentTooLargeError,
|
|
47
47
|
DocumentContextEvent: () => DocumentContextEvent,
|
|
48
48
|
DocumentLookupRequest: () => DocumentLookupRequest,
|
|
49
|
+
DocumentPatchRequest: () => DocumentPatchRequest,
|
|
49
50
|
DocumentRequest: () => DocumentRequest,
|
|
50
51
|
DocumentResponse: () => DocumentResponse,
|
|
51
52
|
DoneEvent: () => DoneEvent,
|
|
@@ -389,6 +390,13 @@ var DocumentLookupRequest;
|
|
|
389
390
|
Desc: "desc"
|
|
390
391
|
};
|
|
391
392
|
})(DocumentLookupRequest || (DocumentLookupRequest = {}));
|
|
393
|
+
var DocumentPatchRequest;
|
|
394
|
+
((DocumentPatchRequest2) => {
|
|
395
|
+
DocumentPatchRequest2.Status = {
|
|
396
|
+
Active: "ACTIVE",
|
|
397
|
+
Archived: "ARCHIVED"
|
|
398
|
+
};
|
|
399
|
+
})(DocumentPatchRequest || (DocumentPatchRequest = {}));
|
|
392
400
|
var FileUploadRequest;
|
|
393
401
|
((FileUploadRequest2) => {
|
|
394
402
|
FileUploadRequest2.IndexMode = {
|
|
@@ -401,6 +409,7 @@ var FileUploadRequest;
|
|
|
401
409
|
var documents_exports = {};
|
|
402
410
|
__export(documents_exports, {
|
|
403
411
|
DocumentLookupRequest: () => DocumentLookupRequest,
|
|
412
|
+
DocumentPatchRequest: () => DocumentPatchRequest,
|
|
404
413
|
FileUploadRequest: () => FileUploadRequest,
|
|
405
414
|
LookupDocumentsRequestOrder: () => LookupDocumentsRequestOrder
|
|
406
415
|
});
|
|
@@ -2447,7 +2456,7 @@ var AuthClient = class {
|
|
|
2447
2456
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/auth/jwks");
|
|
2448
2457
|
}
|
|
2449
2458
|
/**
|
|
2450
|
-
* Returns a page of per-subject PHI read-access rows: who read which subject's PHI, when, against which record, and whether any sensitive value was actually revealed in plaintext. Metadata only — never the PHI itself.
|
|
2459
|
+
* Returns a page of per-subject PHI read-access rows: who read which subject's PHI, when, against which record, and whether any sensitive value was actually revealed in plaintext. Metadata only — never the PHI itself. Rows exist only where read-access logging is enabled. Provide at least one query axis: a subject (`subjectType` + `subjectId`) within a `contextId` for the primary accounting query; `resourceId` within a `contextId` for 'who read this record'; `callerKeyId` for 'what did this credential read' (account-wide forensic); or `contextId` alone to enumerate a whole context. `from`/`to` bound the time window. Results are scoped to your account, derived from your token — never from input. Requires the `access-log:r` scope.
|
|
2451
2460
|
*
|
|
2452
2461
|
* @param {Vectros.GetAccessLogRequest} request
|
|
2453
2462
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -3065,6 +3074,7 @@ var AuthClient = class {
|
|
|
3065
3074
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3066
3075
|
*
|
|
3067
3076
|
* @throws {@link Vectros.BadRequestError}
|
|
3077
|
+
* @throws {@link Vectros.PaymentRequiredError}
|
|
3068
3078
|
* @throws {@link Vectros.ForbiddenError}
|
|
3069
3079
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
3070
3080
|
*
|
|
@@ -3114,6 +3124,8 @@ var AuthClient = class {
|
|
|
3114
3124
|
switch (_response.error.statusCode) {
|
|
3115
3125
|
case 400:
|
|
3116
3126
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
3127
|
+
case 402:
|
|
3128
|
+
throw new PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
3117
3129
|
case 403:
|
|
3118
3130
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3119
3131
|
case 429:
|
|
@@ -4149,7 +4161,7 @@ var AuthClient = class {
|
|
|
4149
4161
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/auth/issuers/{issuerId}");
|
|
4150
4162
|
}
|
|
4151
4163
|
/**
|
|
4152
|
-
* 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
|
|
4164
|
+
* 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 where permitted; 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.
|
|
4153
4165
|
*
|
|
4154
4166
|
* @param {Vectros.IssuerUpdateRequest} request
|
|
4155
4167
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4959,7 +4971,7 @@ var ComplianceClient = class {
|
|
|
4959
4971
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
4960
4972
|
}
|
|
4961
4973
|
/**
|
|
4962
|
-
* Submits
|
|
4974
|
+
* Submits an erasure request for a single end-subject (a user, or an identity entity in any namespace). Erasure deletes the records, documents, folders and record schemas the subject solely owns across the declared contexts (and, for a user, its access profiles there), plus its identity and lookup rows when all contexts are covered. Rows co-owned with another owner scope or principal are kept; read-access log entries are not erased. The request is asynchronous: it returns 202 with a `requestId`; poll `GET /v1/erasure-requests/{id}` until the job completes to obtain the completion certificate. Requires a root API key — a scoped credential is rejected with 403.
|
|
4963
4975
|
*
|
|
4964
4976
|
* @param {Vectros.ErasureRequest} request
|
|
4965
4977
|
* @param {ComplianceClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -5022,7 +5034,7 @@ var ComplianceClient = class {
|
|
|
5022
5034
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/erasure-requests");
|
|
5023
5035
|
}
|
|
5024
5036
|
/**
|
|
5025
|
-
* Polls an erasure request by id. While the job is still running this returns its status only; once it completes, the response also includes the
|
|
5037
|
+
* Polls an erasure request by id. While the job is still running this returns its status only; once it completes, the response also includes the completion certificate (which contexts were swept, per-context deletion counts, whether the identity was kept, and reports of dangling references and shared rows left intact). Requires a root API key.
|
|
5026
5038
|
*
|
|
5027
5039
|
* @param {Vectros.GetErasureRequestRequest} request
|
|
5028
5040
|
* @param {ComplianceClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -5265,7 +5277,7 @@ var DocumentsClient = class {
|
|
|
5265
5277
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/documents");
|
|
5266
5278
|
}
|
|
5267
5279
|
/**
|
|
5268
|
-
* Creates a document from a raw text string and queues it for asynchronous indexing so it becomes searchable. Optionally supply an `externalId` to make the create idempotent — if a document with the same `externalId` already exists in your context, that existing document is returned unchanged instead of a duplicate being created. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing document was returned) tells the two apart. To overwrite an existing document's content instead of returning it unchanged, set `?upsert=true` (this also requires the `documents:u` scope). Requires the `documents:c` scope to create. Being returned the existing document on a collision is a read of that document's data and additionally requires the `documents:r` scope — a credential holding `documents:c` alone receives a `400` ("already exists") on collision instead of the document.
|
|
5280
|
+
* Creates a document from a raw text string and queues it for asynchronous indexing so it becomes searchable. Optionally supply an `externalId` to make the create idempotent — if a document with the same `externalId` already exists in your context, that existing document is returned unchanged instead of a duplicate being created. The response's `created` field (and the HTTP status — 201 when created, 200 when an existing document was returned) tells the two apart. To overwrite an existing document's content instead of returning it unchanged, set `?upsert=true` (this also requires the `documents:u` scope). Requires the `documents:c` scope to create. Being returned the existing document on a collision is a read of that document's data and additionally requires the `documents:r` scope — a credential holding `documents:c` alone receives a `400` ("already exists") on collision instead of the document. Supplying `externalId` WITHOUT `schemaId` is refused (`400`) unless you also pass `confirmUntyped=true` — externalId uniqueness is scoped per schema, so omitting `schemaId` by mistake would otherwise silently create a separate untyped document instead of targeting the typed one you likely meant.
|
|
5269
5281
|
*
|
|
5270
5282
|
* @param {Vectros.IngestDocumentRequest} request
|
|
5271
5283
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -5285,10 +5297,11 @@ var DocumentsClient = class {
|
|
|
5285
5297
|
return HttpResponsePromise.fromPromise(this.__ingestDocument(request, requestOptions));
|
|
5286
5298
|
}
|
|
5287
5299
|
async __ingestDocument(request, requestOptions) {
|
|
5288
|
-
const { upsert, allowClear, body: _body } = request;
|
|
5300
|
+
const { upsert, allowClear, confirmUntyped, body: _body } = request;
|
|
5289
5301
|
const _queryParams = {
|
|
5290
5302
|
upsert,
|
|
5291
|
-
allowClear
|
|
5303
|
+
allowClear,
|
|
5304
|
+
confirmUntyped
|
|
5292
5305
|
};
|
|
5293
5306
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5294
5307
|
const _headers = mergeHeaders(
|
|
@@ -5523,7 +5536,7 @@ var DocumentsClient = class {
|
|
|
5523
5536
|
/**
|
|
5524
5537
|
* Partially updates a document using an RFC 7386 JSON Merge Patch. The `payload` object is deep-merged: keys you send overwrite existing values (recursing into nested objects), a key set to `null` is deleted, and keys you omit are preserved — unlike PUT, which replaces the whole payload. Top-level fields (`title`, `folderId`, `schemaId`, ownership) are set when present and left unchanged when omitted; sending a top-level field as `null` is rejected. Supplying `text` re-ingests the document body (same as PUT). `indexMode`, `externalId`, and `storeText` (text retention is fixed at ingest) are immutable and rejected if present. The merged result is validated against the bound schema. Pass `expectedVersion` for optimistic concurrency (409 on conflict). Requires the `documents:u` scope.
|
|
5525
5538
|
*
|
|
5526
|
-
* @param {Vectros.
|
|
5539
|
+
* @param {Vectros.DocumentPatchRequest} request
|
|
5527
5540
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5528
5541
|
*
|
|
5529
5542
|
* @throws {@link Vectros.BadRequestError}
|
|
@@ -5534,17 +5547,14 @@ var DocumentsClient = class {
|
|
|
5534
5547
|
*
|
|
5535
5548
|
* @example
|
|
5536
5549
|
* await client.documents.patchDocument({
|
|
5537
|
-
* id: "id"
|
|
5538
|
-
* body: {
|
|
5539
|
-
* title: "Patient Intake Form \u2014 Jane Doe"
|
|
5540
|
-
* }
|
|
5550
|
+
* id: "id"
|
|
5541
5551
|
* })
|
|
5542
5552
|
*/
|
|
5543
5553
|
patchDocument(request, requestOptions) {
|
|
5544
5554
|
return HttpResponsePromise.fromPromise(this.__patchDocument(request, requestOptions));
|
|
5545
5555
|
}
|
|
5546
5556
|
async __patchDocument(request, requestOptions) {
|
|
5547
|
-
const { id,
|
|
5557
|
+
const { id, ..._body } = request;
|
|
5548
5558
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5549
5559
|
const _headers = mergeHeaders(
|
|
5550
5560
|
_authRequest.headers,
|
|
@@ -5916,7 +5926,7 @@ var DocumentsClient = class {
|
|
|
5916
5926
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/documents/{id}/versions");
|
|
5917
5927
|
}
|
|
5918
5928
|
/**
|
|
5919
|
-
* 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.
|
|
5929
|
+
* 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. Supplying `externalId` WITHOUT `schemaId` is refused (`400`) unless you also pass `confirmUntyped=true` — externalId uniqueness is scoped per schema, so omitting `schemaId` by mistake would otherwise silently create a separate untyped document instead of targeting the typed one you likely meant.
|
|
5920
5930
|
*
|
|
5921
5931
|
* @param {Vectros.FileUploadRequest} request
|
|
5922
5932
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -5935,9 +5945,10 @@ var DocumentsClient = class {
|
|
|
5935
5945
|
return HttpResponsePromise.fromPromise(this.__uploadDocument(request, requestOptions));
|
|
5936
5946
|
}
|
|
5937
5947
|
async __uploadDocument(request, requestOptions) {
|
|
5938
|
-
const { upsert, ..._body } = request;
|
|
5948
|
+
const { upsert, confirmUntyped, ..._body } = request;
|
|
5939
5949
|
const _queryParams = {
|
|
5940
|
-
upsert
|
|
5950
|
+
upsert,
|
|
5951
|
+
confirmUntyped
|
|
5941
5952
|
};
|
|
5942
5953
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5943
5954
|
const _headers = mergeHeaders(
|
|
@@ -7842,6 +7853,8 @@ var InferenceClient = class {
|
|
|
7842
7853
|
throw new PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
7843
7854
|
case 403:
|
|
7844
7855
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7856
|
+
case 413:
|
|
7857
|
+
throw new ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
7845
7858
|
case 429:
|
|
7846
7859
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7847
7860
|
default:
|
|
@@ -7981,6 +7994,8 @@ var InferenceClient = class {
|
|
|
7981
7994
|
throw new PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
7982
7995
|
case 403:
|
|
7983
7996
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
7997
|
+
case 413:
|
|
7998
|
+
throw new ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
7984
7999
|
case 429:
|
|
7985
8000
|
throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
7986
8001
|
case 500:
|
|
@@ -10233,7 +10248,7 @@ var logging;
|
|
|
10233
10248
|
|
|
10234
10249
|
// src/server.ts
|
|
10235
10250
|
var import_types3 = require("@modelcontextprotocol/sdk/types.js");
|
|
10236
|
-
var
|
|
10251
|
+
var import_zod25 = require("zod");
|
|
10237
10252
|
|
|
10238
10253
|
// src/auth.ts
|
|
10239
10254
|
var KEY_RE = /^(sk|ssk|st)_(live|test)_/;
|
|
@@ -10265,7 +10280,7 @@ function warnOnSuboptimalKey(key, log) {
|
|
|
10265
10280
|
if (key.prefix === "sk") {
|
|
10266
10281
|
log.warn(
|
|
10267
10282
|
{ prefix: key.prefix, env: key.env },
|
|
10268
|
-
'wildcard-scope key (sk_*) on a desktop MCP server is overly broad. For production, prefer a scoped ssk_* key bound to a narrowed AccessProfile
|
|
10283
|
+
'wildcard-scope key (sk_*) on a desktop MCP server is overly broad. For production, prefer a scoped ssk_* key bound to a narrowed AccessProfile: `npx -y @vectros-ai/cli bootstrap` mints one, and the "Recommended credential" section of this package\'s README describes it.'
|
|
10269
10284
|
);
|
|
10270
10285
|
} else if (key.prefix === "st") {
|
|
10271
10286
|
log.warn(
|
|
@@ -10277,8 +10292,8 @@ function warnOnSuboptimalKey(key, log) {
|
|
|
10277
10292
|
|
|
10278
10293
|
// src/build-info.ts
|
|
10279
10294
|
var BUILD_INFO = {
|
|
10280
|
-
mcpServer: true ? "0.
|
|
10281
|
-
sdk: true ? "0.
|
|
10295
|
+
mcpServer: true ? "0.18.1" : "dev",
|
|
10296
|
+
sdk: true ? "0.47.0" : "dev"
|
|
10282
10297
|
};
|
|
10283
10298
|
function formatBuildInfo() {
|
|
10284
10299
|
return `vectros-mcp-server ${BUILD_INFO.mcpServer} (sdk ${BUILD_INFO.sdk})`;
|
|
@@ -10573,7 +10588,7 @@ var inputSchema = {
|
|
|
10573
10588
|
"Keyword-match precision for the BM25 leg (TEXT/HYBRID modes). OR = any term (broad recall), AND = all terms (higher precision), PHRASE = contiguous phrase. Default: PHRASE (slop 3) in HYBRID, OR in TEXT. (The advanced raw-query COMPLEX mode is intentionally not exposed here.)"
|
|
10574
10589
|
),
|
|
10575
10590
|
limit: import_zod.z.number().int().min(1).max(MCP_MAX_LIMIT).optional().describe(
|
|
10576
|
-
`Max hits per page. Defaults to a low ${MCP_DEFAULT_LIMIT} to protect the agent context window; raise up to ${MCP_MAX_LIMIT} (
|
|
10591
|
+
`Max hits per page. Defaults to a low ${MCP_DEFAULT_LIMIT} to protect the agent context window; raise up to ${MCP_MAX_LIMIT} (this tool's ceiling) in one call when you can accept the larger result, or page with \`offset\` instead.`
|
|
10577
10592
|
),
|
|
10578
10593
|
offset: import_zod.z.number().int().min(0).max(200).optional().describe("Skip the first N hits \u2014 for pagination (0\u2013200)."),
|
|
10579
10594
|
folderId: import_zod.z.string().optional().describe("Scope to content in this EXACT folder (Vectros folder id)."),
|
|
@@ -11322,52 +11337,65 @@ var recordDelete = ({ client, log }) => ({
|
|
|
11322
11337
|
var record_delete_default = recordDelete;
|
|
11323
11338
|
|
|
11324
11339
|
// src/tools/rag_ask.ts
|
|
11340
|
+
var import_zod10 = require("zod");
|
|
11341
|
+
|
|
11342
|
+
// src/tools/provider-alias.ts
|
|
11325
11343
|
var import_zod9 = require("zod");
|
|
11344
|
+
var providerAliasInput = import_zod9.z.string().min(1, "providerAlias must be non-empty when supplied").optional().describe(
|
|
11345
|
+
"Route THIS call through your own model provider instead of the platform-hosted default, by the alias of a provider config your account has activated. It works only after your account has set up that provider and signed the platform's risk-acceptance waiver; without both, the platform refuses the call with a 403, which is returned to you as written. If your account has accepted the Business Associate Agreement with Vectros in the developer portal, an account owner must also have attested that provider config in the developer portal (Model Providers); until then the platform refuses the call with a 403 that says it needs a BAA-holder attestation. A call served by your own provider leaves the Vectros perimeter. Omit it (the default) to use the platform-hosted path. When set, `model` names the model on your provider's own id space, and falls back to that provider config's default model when omitted."
|
|
11346
|
+
);
|
|
11347
|
+
|
|
11348
|
+
// src/tools/rag_ask.ts
|
|
11326
11349
|
var SEARCH_MCP_DEFAULT_LIMIT = 5;
|
|
11327
11350
|
var SEARCH_MCP_MAX_LIMIT = 50;
|
|
11328
11351
|
var inputSchema9 = {
|
|
11329
|
-
query:
|
|
11330
|
-
instructions:
|
|
11352
|
+
query: import_zod10.z.string().min(1, "query must be non-empty").describe("Question to ground against retrieved content."),
|
|
11353
|
+
instructions: import_zod10.z.string().optional().describe(
|
|
11331
11354
|
'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.'
|
|
11332
11355
|
),
|
|
11333
|
-
model:
|
|
11334
|
-
"Inference model alias (e.g. claude-haiku-
|
|
11356
|
+
model: import_zod10.z.string().optional().describe(
|
|
11357
|
+
"Inference model alias (e.g. claude-haiku-5-5, claude-sonnet-5-5, claude-opus-5-5). Omit it to use the platform default, which GET /v1/models reports as `defaultModel`; that endpoint also lists the catalog the calling key can reach. When `providerAlias` is set, this instead names the model on that provider's own id space."
|
|
11335
11358
|
),
|
|
11336
|
-
|
|
11337
|
-
|
|
11338
|
-
|
|
11339
|
-
|
|
11359
|
+
providerAlias: providerAliasInput,
|
|
11360
|
+
search: import_zod10.z.object({
|
|
11361
|
+
mode: import_zod10.z.enum(["HYBRID", "TEXT", "SEMANTIC"]).optional().describe("Retrieval mode. Default HYBRID."),
|
|
11362
|
+
limit: import_zod10.z.number().int().min(1).max(SEARCH_MCP_MAX_LIMIT).optional().describe(
|
|
11363
|
+
`Passages to retrieve before generating (the grounding-corpus size). Default ${SEARCH_MCP_DEFAULT_LIMIT}; raise up to ${SEARCH_MCP_MAX_LIMIT} (this tool's ceiling) for a broader corpus when the extra grounding is worth the larger prompt.`
|
|
11340
11364
|
),
|
|
11341
11365
|
// Retrieval scoping — parity with hybrid_search so an agent can ground the
|
|
11342
11366
|
// answer on a specific owner / folder / type / metadata subset, not just the
|
|
11343
11367
|
// whole-tenant corpus.
|
|
11344
|
-
userId:
|
|
11345
|
-
scope:
|
|
11368
|
+
userId: import_zod10.z.string().optional().describe("Restrict retrieval to content owned by this user (Vectros UUID)."),
|
|
11369
|
+
scope: import_zod10.z.string().optional().describe(
|
|
11346
11370
|
'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. Mutually exclusive with `scopeFilters` \u2014 use this for ONE dimension.'
|
|
11347
11371
|
),
|
|
11348
|
-
scopeFilters:
|
|
11372
|
+
scopeFilters: import_zod10.z.array(import_zod10.z.string()).min(1, "scopeFilters must name at least one dimension when supplied").optional().describe(
|
|
11349
11373
|
'Restrict retrieval to content matching ALL of these scope values \u2014 one per namespace \u2014 for a credential whose access spans more than one ownership dimension. e.g. ["org:<uuid>", "client:<uuid>"] grounds the answer on one specific client WITHIN one specific org, which `scope` alone cannot express. Naming the same namespace twice is rejected. Mutually exclusive with `scope`.'
|
|
11350
11374
|
),
|
|
11351
|
-
folderId:
|
|
11352
|
-
rootFolderId:
|
|
11353
|
-
typeName:
|
|
11354
|
-
contentTypes:
|
|
11355
|
-
filters:
|
|
11375
|
+
folderId: import_zod10.z.string().optional().describe("Restrict retrieval to this exact folder."),
|
|
11376
|
+
rootFolderId: import_zod10.z.string().optional().describe("Restrict retrieval to this folder and all its descendants."),
|
|
11377
|
+
typeName: import_zod10.z.string().optional().describe("Restrict record retrieval to this schema type."),
|
|
11378
|
+
contentTypes: import_zod10.z.array(import_zod10.z.enum(["documents", "records"])).optional().describe('Narrow retrieval to content types. ["documents"] or ["records"]; omit for both.'),
|
|
11379
|
+
filters: import_zod10.z.record(import_zod10.z.unknown()).optional().describe(
|
|
11356
11380
|
'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"}.'
|
|
11357
11381
|
),
|
|
11358
|
-
createdAfter:
|
|
11382
|
+
createdAfter: import_zod10.z.string().optional().describe(
|
|
11359
11383
|
"Restrict retrieval to content CREATED at/after this ISO 8601 UTC timestamp \u2014 the item's own creation time, which does not move when it is re-indexed. An item matched on its FIRST index may be checked against its index time instead, a bounded clock-skew allowance."
|
|
11360
11384
|
),
|
|
11361
|
-
createdBefore:
|
|
11362
|
-
requireComplete:
|
|
11385
|
+
createdBefore: import_zod10.z.string().optional().describe("Same creation-time basis as createdAfter, bounding at/before this ISO 8601 UTC value."),
|
|
11386
|
+
requireComplete: import_zod10.z.boolean().optional().describe("Fail closed (503) on a degraded search backend instead of grounding on partial results. Default false.")
|
|
11363
11387
|
}).optional().describe("Retrieval params + scoping. Default mode HYBRID, limit " + SEARCH_MCP_DEFAULT_LIMIT + "."),
|
|
11364
|
-
maxTokens:
|
|
11365
|
-
|
|
11388
|
+
maxTokens: import_zod10.z.number().int().min(1).optional().describe(
|
|
11389
|
+
"Max output tokens. claude-haiku-5-5, claude-sonnet-5, claude-sonnet-5-5 and claude-opus-5-5 can reason before they answer; when they do, the reasoning counts against this limit, so a small value can return little or no text. Leave headroom: 1024 or more for a short answer."
|
|
11390
|
+
),
|
|
11391
|
+
temperature: import_zod10.z.number().min(0).max(1).optional().describe(
|
|
11392
|
+
"Sampling temperature (0.0\u20131.0). Default 0.3 \u2014 lower favors deterministic, retrieval-grounded answers. The platform ignores it for claude-haiku-5-5, claude-sonnet-5, claude-sonnet-5-5 and claude-opus-5-5, which sample at their own default; it applies to models that accept a temperature, such as claude-haiku-4-5."
|
|
11393
|
+
)
|
|
11366
11394
|
};
|
|
11367
11395
|
var ragAsk = ({ client, log }) => ({
|
|
11368
11396
|
name: "rag_ask",
|
|
11369
11397
|
title: "RAG ask (corpus-wide)",
|
|
11370
|
-
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`
|
|
11398
|
+
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` (and `temperature`, for the models that accept one). The full answer is returned as a single response; progress notifications keep the call alive during the 30-45s generation window. Calls without `providerAlias` are served by platform-hosted AWS Bedrock. A call that sets `providerAlias` goes to your own model provider, outside Vectros's AWS BAA boundary.",
|
|
11371
11399
|
inputSchema: inputSchema9,
|
|
11372
11400
|
// NOT a pure read: this call reserves an atomic hold against the caller's prepaid inference
|
|
11373
11401
|
// balance before generation starts, then debits it on completion — a real financial side
|
|
@@ -11409,6 +11437,7 @@ var ragAsk = ({ client, log }) => ({
|
|
|
11409
11437
|
query: args.query,
|
|
11410
11438
|
instructions: args.instructions,
|
|
11411
11439
|
model: args.model,
|
|
11440
|
+
providerAlias: args.providerAlias,
|
|
11412
11441
|
search,
|
|
11413
11442
|
maxTokens: args.maxTokens,
|
|
11414
11443
|
temperature: args.temperature
|
|
@@ -11463,19 +11492,22 @@ var ragAsk = ({ client, log }) => ({
|
|
|
11463
11492
|
var rag_ask_default = ragAsk;
|
|
11464
11493
|
|
|
11465
11494
|
// src/tools/document_ask.ts
|
|
11466
|
-
var
|
|
11495
|
+
var import_zod11 = require("zod");
|
|
11467
11496
|
var inputSchema10 = {
|
|
11468
|
-
documentId:
|
|
11469
|
-
prompt:
|
|
11470
|
-
model:
|
|
11471
|
-
"Inference model alias.
|
|
11497
|
+
documentId: import_zod11.z.string().min(1, "documentId is required").describe("ID of the document to ask against."),
|
|
11498
|
+
prompt: import_zod11.z.string().min(1, "prompt is required").describe("Question to ask about the document."),
|
|
11499
|
+
model: import_zod11.z.string().optional().describe(
|
|
11500
|
+
"Inference model alias. Omit it to use the platform default, which GET /v1/models reports as `defaultModel`; that endpoint also lists the catalog the calling key can reach. When `providerAlias` is set, this instead names the model on that provider's own id space."
|
|
11472
11501
|
),
|
|
11473
|
-
|
|
11502
|
+
providerAlias: providerAliasInput,
|
|
11503
|
+
maxTokens: import_zod11.z.number().int().min(1).optional().describe(
|
|
11504
|
+
"Max output tokens. claude-haiku-5-5, claude-sonnet-5, claude-sonnet-5-5 and claude-opus-5-5 can reason before they answer; when they do, the reasoning counts against this limit, so a small value can return little or no text. Leave headroom: 1024 or more for a short answer."
|
|
11505
|
+
)
|
|
11474
11506
|
};
|
|
11475
11507
|
var documentAsk = ({ client, log }) => ({
|
|
11476
11508
|
name: "document_ask",
|
|
11477
11509
|
title: "Document ask (single-document)",
|
|
11478
|
-
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`.
|
|
11510
|
+
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`. Calls without `providerAlias` are served by platform-hosted AWS Bedrock. A call that sets `providerAlias` goes to your own model provider, outside Vectros's AWS BAA boundary.",
|
|
11479
11511
|
inputSchema: inputSchema10,
|
|
11480
11512
|
// NOT a pure read: this call reserves an atomic hold against the caller's prepaid inference
|
|
11481
11513
|
// balance before generation starts, then debits it on completion — a real financial side
|
|
@@ -11492,6 +11524,7 @@ var documentAsk = ({ client, log }) => ({
|
|
|
11492
11524
|
id: args.documentId,
|
|
11493
11525
|
prompt: args.prompt,
|
|
11494
11526
|
model: args.model,
|
|
11527
|
+
providerAlias: args.providerAlias,
|
|
11495
11528
|
maxTokens: args.maxTokens
|
|
11496
11529
|
});
|
|
11497
11530
|
const progressToken = extra._meta?.progressToken;
|
|
@@ -11544,18 +11577,18 @@ var documentAsk = ({ client, log }) => ({
|
|
|
11544
11577
|
var document_ask_default = documentAsk;
|
|
11545
11578
|
|
|
11546
11579
|
// src/tools/list_schemas.ts
|
|
11547
|
-
var
|
|
11580
|
+
var import_zod12 = require("zod");
|
|
11548
11581
|
var inputSchema11 = {
|
|
11549
|
-
userId:
|
|
11582
|
+
userId: import_zod12.z.string().optional().describe(
|
|
11550
11583
|
"Filter to schemas visible to a specific user. Optional; default returns all schemas the credential can see."
|
|
11551
11584
|
),
|
|
11552
|
-
scope:
|
|
11585
|
+
scope: import_zod12.z.string().optional().describe(
|
|
11553
11586
|
'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.'
|
|
11554
11587
|
),
|
|
11555
|
-
surface:
|
|
11588
|
+
surface: import_zod12.z.enum(["record", "document", "user", "entity"]).optional().describe(
|
|
11556
11589
|
"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."
|
|
11557
11590
|
),
|
|
11558
|
-
recordType:
|
|
11591
|
+
recordType: import_zod12.z.string().optional().describe(
|
|
11559
11592
|
'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.'
|
|
11560
11593
|
)
|
|
11561
11594
|
};
|
|
@@ -11591,19 +11624,19 @@ var listSchemas = ({ client, log }) => ({
|
|
|
11591
11624
|
var list_schemas_default = listSchemas;
|
|
11592
11625
|
|
|
11593
11626
|
// src/tools/document_get.ts
|
|
11594
|
-
var
|
|
11627
|
+
var import_zod13 = require("zod");
|
|
11595
11628
|
var MAX_TEXT_CHARS = 32e3;
|
|
11596
11629
|
var inputSchema12 = {
|
|
11597
|
-
documentId:
|
|
11598
|
-
externalId:
|
|
11630
|
+
documentId: import_zod13.z.string().optional().describe("The document ID returned by document_ingest or hybrid_search. Provide this OR externalId+type."),
|
|
11631
|
+
externalId: import_zod13.z.string().optional().describe(
|
|
11599
11632
|
"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."
|
|
11600
11633
|
),
|
|
11601
|
-
type:
|
|
11602
|
-
includeText:
|
|
11634
|
+
type: import_zod13.z.string().optional().describe("Document type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
|
|
11635
|
+
includeText: import_zod13.z.boolean().optional().describe(
|
|
11603
11636
|
"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."
|
|
11604
11637
|
),
|
|
11605
|
-
includeDownloadUrl:
|
|
11606
|
-
"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."
|
|
11638
|
+
includeDownloadUrl: import_zod13.z.boolean().optional().describe(
|
|
11639
|
+
"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. `downloadExpires` is an upper bound, not a guarantee: if the file behind this document is replaced (a document_ingest upsert) after this URL is minted, the URL can stop working before that time. Request a fresh one after any re-ingest rather than reusing one you already hold."
|
|
11607
11640
|
)
|
|
11608
11641
|
};
|
|
11609
11642
|
function truncateText(text) {
|
|
@@ -11686,28 +11719,28 @@ var documentGet = ({ client, log }) => ({
|
|
|
11686
11719
|
var document_get_default = documentGet;
|
|
11687
11720
|
|
|
11688
11721
|
// src/tools/document_query.ts
|
|
11689
|
-
var
|
|
11722
|
+
var import_zod14 = require("zod");
|
|
11690
11723
|
var MCP_DEFAULT_LIMIT3 = 3;
|
|
11691
11724
|
var MCP_MAX_LIMIT3 = 100;
|
|
11692
11725
|
var inputSchema13 = {
|
|
11693
11726
|
// Lookup-mode args — provide `field` plus EXACTLY ONE of: value | from+to | prefix.
|
|
11694
|
-
field:
|
|
11695
|
-
value:
|
|
11696
|
-
from:
|
|
11697
|
-
to:
|
|
11698
|
-
prefix:
|
|
11699
|
-
order:
|
|
11727
|
+
field: import_zod14.z.string().optional().describe("Lookup mode: name of the lookup-indexed field to query by."),
|
|
11728
|
+
value: import_zod14.z.string().optional().describe("Lookup mode (equality): exact-match value for `field`. Works on sensitive fields too."),
|
|
11729
|
+
from: import_zod14.z.string().optional().describe("Lookup mode (range): inclusive lower bound; requires `to`. Range-enabled, non-sensitive fields only."),
|
|
11730
|
+
to: import_zod14.z.string().optional().describe("Lookup mode (range): inclusive upper bound; requires `from`."),
|
|
11731
|
+
prefix: import_zod14.z.string().optional().describe("Lookup mode (prefix): match values starting with this. Range-enabled string fields only."),
|
|
11732
|
+
order: import_zod14.z.enum(["asc", "desc"]).optional().describe(
|
|
11700
11733
|
"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."
|
|
11701
11734
|
),
|
|
11702
|
-
type:
|
|
11735
|
+
type: import_zod14.z.string().optional().describe("Lookup mode: the document type (the bound schema's type). Required with `field`."),
|
|
11703
11736
|
// List-mode args:
|
|
11704
|
-
folderId:
|
|
11705
|
-
userId:
|
|
11706
|
-
scope:
|
|
11737
|
+
folderId: import_zod14.z.string().optional().describe("List mode: only documents in this folder (Vectros folder id)."),
|
|
11738
|
+
userId: import_zod14.z.string().optional().describe("List mode: scope to documents owned by this user."),
|
|
11739
|
+
scope: import_zod14.z.string().optional().describe(
|
|
11707
11740
|
'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.'
|
|
11708
11741
|
),
|
|
11709
|
-
startFrom:
|
|
11710
|
-
limit:
|
|
11742
|
+
startFrom: import_zod14.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."),
|
|
11743
|
+
limit: import_zod14.z.number().int().min(1).max(MCP_MAX_LIMIT3).optional().describe(
|
|
11711
11744
|
`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.`
|
|
11712
11745
|
)
|
|
11713
11746
|
};
|
|
@@ -11797,29 +11830,29 @@ var documentQuery = ({ client, log }) => ({
|
|
|
11797
11830
|
var document_query_default = documentQuery;
|
|
11798
11831
|
|
|
11799
11832
|
// src/tools/document_update.ts
|
|
11800
|
-
var
|
|
11833
|
+
var import_zod15 = require("zod");
|
|
11801
11834
|
var inputSchema14 = {
|
|
11802
|
-
documentId:
|
|
11803
|
-
externalId:
|
|
11835
|
+
documentId: import_zod15.z.string().optional().describe("The Vectros document id to update. Provide this OR externalId+type."),
|
|
11836
|
+
externalId: import_zod15.z.string().optional().describe(
|
|
11804
11837
|
"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."
|
|
11805
11838
|
),
|
|
11806
|
-
type:
|
|
11807
|
-
title:
|
|
11808
|
-
fields:
|
|
11839
|
+
type: import_zod15.z.string().optional().describe("Document type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
|
|
11840
|
+
title: import_zod15.z.string().optional().describe("New title. Omit to keep the current title."),
|
|
11841
|
+
fields: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.unknown()).optional().describe(
|
|
11809
11842
|
"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."
|
|
11810
11843
|
),
|
|
11811
|
-
text:
|
|
11844
|
+
text: import_zod15.z.string().optional().describe(
|
|
11812
11845
|
"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."
|
|
11813
11846
|
),
|
|
11814
|
-
folderId:
|
|
11815
|
-
status:
|
|
11847
|
+
folderId: import_zod15.z.string().optional().describe("Move the document into this folder (cannot be cleared once set)."),
|
|
11848
|
+
status: import_zod15.z.enum(["ACTIVE", "ARCHIVED"]).optional().describe(
|
|
11816
11849
|
"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."
|
|
11817
11850
|
),
|
|
11818
|
-
userId:
|
|
11819
|
-
scopes:
|
|
11851
|
+
userId: import_zod15.z.string().optional().describe("Reassign the owning user (Vectros UUID)."),
|
|
11852
|
+
scopes: import_zod15.z.array(import_zod15.z.string()).optional().describe(
|
|
11820
11853
|
'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).'
|
|
11821
11854
|
),
|
|
11822
|
-
expectedVersion:
|
|
11855
|
+
expectedVersion: import_zod15.z.number().int().optional().describe(
|
|
11823
11856
|
"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."
|
|
11824
11857
|
)
|
|
11825
11858
|
};
|
|
@@ -11847,18 +11880,18 @@ var documentUpdate = ({ client, log }) => ({
|
|
|
11847
11880
|
try {
|
|
11848
11881
|
const resolved = await resolveDocumentIdByExternalId(client, { id: documentId, externalId, type });
|
|
11849
11882
|
if ("error" in resolved) return toolError("document_update", new Error(resolved.error));
|
|
11850
|
-
const
|
|
11851
|
-
if (title !== void 0)
|
|
11852
|
-
if (fields !== void 0)
|
|
11853
|
-
if (text !== void 0)
|
|
11854
|
-
if (folderId !== void 0)
|
|
11855
|
-
if (status !== void 0)
|
|
11856
|
-
if (userId !== void 0)
|
|
11857
|
-
if (scopes !== void 0)
|
|
11858
|
-
if (expectedVersion !== void 0)
|
|
11883
|
+
const patch = {};
|
|
11884
|
+
if (title !== void 0) patch.title = title;
|
|
11885
|
+
if (fields !== void 0) patch.payload = fields;
|
|
11886
|
+
if (text !== void 0) patch.text = text;
|
|
11887
|
+
if (folderId !== void 0) patch.folderId = folderId;
|
|
11888
|
+
if (status !== void 0) patch.status = status;
|
|
11889
|
+
if (userId !== void 0) patch.userId = userId;
|
|
11890
|
+
if (scopes !== void 0) patch.scopes = scopes;
|
|
11891
|
+
if (expectedVersion !== void 0) patch.expectedVersion = expectedVersion;
|
|
11859
11892
|
const updated = await client.documents.patchDocument({
|
|
11860
11893
|
id: resolved.id,
|
|
11861
|
-
|
|
11894
|
+
...patch
|
|
11862
11895
|
});
|
|
11863
11896
|
log.debug({ tool: "document_update", documentId: resolved.id, externalId }, "document_update ok");
|
|
11864
11897
|
return { content: [{ type: "text", text: JSON.stringify(updated, null, 2) }] };
|
|
@@ -11871,9 +11904,9 @@ var documentUpdate = ({ client, log }) => ({
|
|
|
11871
11904
|
var document_update_default = documentUpdate;
|
|
11872
11905
|
|
|
11873
11906
|
// src/tools/document_delete.ts
|
|
11874
|
-
var
|
|
11907
|
+
var import_zod16 = require("zod");
|
|
11875
11908
|
var inputSchema15 = {
|
|
11876
|
-
documentId:
|
|
11909
|
+
documentId: import_zod16.z.string().min(1, "documentId is required").describe("The Vectros document id to delete.")
|
|
11877
11910
|
};
|
|
11878
11911
|
var documentDelete = ({ client, log }) => ({
|
|
11879
11912
|
name: "document_delete",
|
|
@@ -11900,18 +11933,18 @@ var documentDelete = ({ client, log }) => ({
|
|
|
11900
11933
|
var document_delete_default = documentDelete;
|
|
11901
11934
|
|
|
11902
11935
|
// src/tools/folder_query.ts
|
|
11903
|
-
var
|
|
11936
|
+
var import_zod17 = require("zod");
|
|
11904
11937
|
var MCP_DEFAULT_LIMIT4 = 10;
|
|
11905
11938
|
var MCP_MAX_LIMIT4 = 100;
|
|
11906
11939
|
var inputSchema16 = {
|
|
11907
|
-
id:
|
|
11908
|
-
parentId:
|
|
11909
|
-
userId:
|
|
11910
|
-
scope:
|
|
11940
|
+
id: import_zod17.z.string().optional().describe("Get mode: fetch this single folder by id."),
|
|
11941
|
+
parentId: import_zod17.z.string().optional().describe("List mode: direct children of this folder (tree navigation). Omit for a flat tenant list."),
|
|
11942
|
+
userId: import_zod17.z.string().optional().describe("List mode: scope to folders owned by this user."),
|
|
11943
|
+
scope: import_zod17.z.string().optional().describe(
|
|
11911
11944
|
'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.'
|
|
11912
11945
|
),
|
|
11913
|
-
startFrom:
|
|
11914
|
-
limit:
|
|
11946
|
+
startFrom: import_zod17.z.string().optional().describe("List mode: pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next."),
|
|
11947
|
+
limit: import_zod17.z.number().int().min(1).max(MCP_MAX_LIMIT4).optional().describe(
|
|
11915
11948
|
`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\`.`
|
|
11916
11949
|
)
|
|
11917
11950
|
};
|
|
@@ -11951,16 +11984,16 @@ var folderQuery = ({ client, log }) => ({
|
|
|
11951
11984
|
var folder_query_default = folderQuery;
|
|
11952
11985
|
|
|
11953
11986
|
// src/tools/folder_create.ts
|
|
11954
|
-
var
|
|
11987
|
+
var import_zod18 = require("zod");
|
|
11955
11988
|
var inputSchema17 = {
|
|
11956
|
-
name:
|
|
11957
|
-
description:
|
|
11958
|
-
parentId:
|
|
11959
|
-
slug:
|
|
11989
|
+
name: import_zod18.z.string().min(1, "name is required").describe("Folder display name."),
|
|
11990
|
+
description: import_zod18.z.string().optional().describe("Optional description of the folder's purpose."),
|
|
11991
|
+
parentId: import_zod18.z.string().optional().describe("Parent folder id \u2014 places the folder under this parent. Omit for the context default root. Create-only."),
|
|
11992
|
+
slug: import_zod18.z.string().optional().describe(
|
|
11960
11993
|
"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."
|
|
11961
11994
|
),
|
|
11962
|
-
userId:
|
|
11963
|
-
scopes:
|
|
11995
|
+
userId: import_zod18.z.string().optional().describe("Owning user (Vectros UUID)."),
|
|
11996
|
+
scopes: import_zod18.z.array(import_zod18.z.string()).optional().describe(
|
|
11964
11997
|
'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.'
|
|
11965
11998
|
)
|
|
11966
11999
|
};
|
|
@@ -12002,16 +12035,16 @@ var folderCreate = ({ client, log }) => ({
|
|
|
12002
12035
|
var folder_create_default = folderCreate;
|
|
12003
12036
|
|
|
12004
12037
|
// src/tools/folder_update.ts
|
|
12005
|
-
var
|
|
12038
|
+
var import_zod19 = require("zod");
|
|
12006
12039
|
var inputSchema18 = {
|
|
12007
|
-
id:
|
|
12008
|
-
name:
|
|
12009
|
-
description:
|
|
12010
|
-
userId:
|
|
12011
|
-
scopes:
|
|
12040
|
+
id: import_zod19.z.string().min(1, "id is required").describe("The Vectros folder id to update."),
|
|
12041
|
+
name: import_zod19.z.string().optional().describe("New folder name. Omit to keep the current name."),
|
|
12042
|
+
description: import_zod19.z.string().optional().describe("New description. Omit to leave unchanged."),
|
|
12043
|
+
userId: import_zod19.z.string().optional().describe("Reassign the owning user (Vectros UUID)."),
|
|
12044
|
+
scopes: import_zod19.z.array(import_zod19.z.string()).optional().describe(
|
|
12012
12045
|
'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).'
|
|
12013
12046
|
),
|
|
12014
|
-
expectedVersion:
|
|
12047
|
+
expectedVersion: import_zod19.z.number().int().optional().describe(
|
|
12015
12048
|
"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."
|
|
12016
12049
|
)
|
|
12017
12050
|
};
|
|
@@ -12050,14 +12083,14 @@ var folderUpdate = ({ client, log }) => ({
|
|
|
12050
12083
|
var folder_update_default = folderUpdate;
|
|
12051
12084
|
|
|
12052
12085
|
// src/tools/folder_delete.ts
|
|
12053
|
-
var
|
|
12086
|
+
var import_zod20 = require("zod");
|
|
12054
12087
|
var inputSchema19 = {
|
|
12055
|
-
id:
|
|
12088
|
+
id: import_zod20.z.string().min(1, "id is required").describe("The Vectros folder id to delete.")
|
|
12056
12089
|
};
|
|
12057
12090
|
var folderDelete = ({ client, log }) => ({
|
|
12058
12091
|
name: "folder_delete",
|
|
12059
12092
|
title: "Delete a folder",
|
|
12060
|
-
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
|
|
12093
|
+
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 the record on that basis: if the record should be kept, tell the user to 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.',
|
|
12061
12094
|
inputSchema: inputSchema19,
|
|
12062
12095
|
// Deletes. Idempotent in the standard REST sense: the end state ("this id no longer
|
|
12063
12096
|
// resolves") is the same whether this is the first delete or a repeat of one.
|
|
@@ -12102,7 +12135,7 @@ var currentIdentity = ({ log, apiKey, environment }) => ({
|
|
|
12102
12135
|
var current_identity_default = currentIdentity;
|
|
12103
12136
|
|
|
12104
12137
|
// src/tools/document_ingest.ts
|
|
12105
|
-
var
|
|
12138
|
+
var import_zod21 = require("zod");
|
|
12106
12139
|
var import_promises = require("fs/promises");
|
|
12107
12140
|
var import_node_path = require("path");
|
|
12108
12141
|
var IngestPathError = class extends Error {
|
|
@@ -12178,43 +12211,46 @@ function inferMimeType(filePath) {
|
|
|
12178
12211
|
return EXT_TO_MIME[ext] ?? "application/octet-stream";
|
|
12179
12212
|
}
|
|
12180
12213
|
var inputSchema21 = {
|
|
12181
|
-
title:
|
|
12182
|
-
indexMode:
|
|
12214
|
+
title: import_zod21.z.string().min(1, "title is required").describe("Human-readable document title \u2014 appears in search results and the UI."),
|
|
12215
|
+
indexMode: import_zod21.z.enum(["HYBRID", "SEMANTIC", "TEXT", "NONE"]).optional().describe(
|
|
12183
12216
|
"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."
|
|
12184
12217
|
),
|
|
12185
|
-
externalId:
|
|
12186
|
-
'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.'
|
|
12218
|
+
externalId: import_zod21.z.string().optional().describe(
|
|
12219
|
+
'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. Pass `schemaId` with it: an externalId with no `schemaId` is refused (400) unless `confirmUntyped` is true.'
|
|
12187
12220
|
),
|
|
12188
|
-
upsert:
|
|
12189
|
-
"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,
|
|
12221
|
+
upsert: import_zod21.z.boolean().optional().describe(
|
|
12222
|
+
"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. Omitting schemaId is refused (400) unless `confirmUntyped` is true, and with it the call targets the UNTYPED namespace, so it mints or updates an untyped document and never touches the typed one. The response `created` flag confirms which happened (created:true = a new document was minted)."
|
|
12190
12223
|
),
|
|
12191
|
-
schemaId:
|
|
12192
|
-
"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."
|
|
12224
|
+
schemaId: import_zod21.z.string().optional().describe(
|
|
12225
|
+
"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 (an untyped document that also carries an `externalId` needs `confirmUntyped`)."
|
|
12193
12226
|
),
|
|
12194
|
-
|
|
12227
|
+
confirmUntyped: import_zod21.z.boolean().optional().describe(
|
|
12228
|
+
"Set true to confirm that an UNTYPED document is what you intend when you pass `externalId` without `schemaId`. Without it the platform refuses that combination (400): externalId is unique per schema, so a forgotten `schemaId` would otherwise quietly create a separate untyped copy instead of reaching the typed document you meant. Do not set it just to get past that error \u2014 check that the document really is untyped first. Ignored when `schemaId` is given or `externalId` is omitted."
|
|
12229
|
+
),
|
|
12230
|
+
payload: import_zod21.z.record(import_zod21.z.string(), import_zod21.z.unknown()).optional().describe(
|
|
12195
12231
|
"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."
|
|
12196
12232
|
),
|
|
12197
12233
|
// Inline text mode (mutually exclusive with filePath):
|
|
12198
|
-
text:
|
|
12199
|
-
storeText:
|
|
12234
|
+
text: import_zod21.z.string().min(1).optional().describe("Text body to ingest inline. Mutually exclusive with filePath. Either text or filePath is required."),
|
|
12235
|
+
storeText: import_zod21.z.boolean().optional().describe(
|
|
12200
12236
|
"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."
|
|
12201
12237
|
),
|
|
12202
12238
|
// File upload mode (mutually exclusive with text; stdio-transport-only):
|
|
12203
|
-
filePath:
|
|
12239
|
+
filePath: import_zod21.z.string().min(1).optional().describe(
|
|
12204
12240
|
"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."
|
|
12205
12241
|
),
|
|
12206
|
-
fileType:
|
|
12242
|
+
fileType: import_zod21.z.string().optional().describe('MIME type of the file (e.g. "application/pdf"). Inferred from filePath extension if omitted.'),
|
|
12207
12243
|
// Common (both modes):
|
|
12208
|
-
folderId:
|
|
12209
|
-
userId:
|
|
12210
|
-
scopes:
|
|
12244
|
+
folderId: import_zod21.z.string().optional().describe("Optional folder to ingest into. Default: tenant root."),
|
|
12245
|
+
userId: import_zod21.z.string().optional().describe("Owning user ID. Optional."),
|
|
12246
|
+
scopes: import_zod21.z.array(import_zod21.z.string()).optional().describe(
|
|
12211
12247
|
"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."
|
|
12212
12248
|
)
|
|
12213
12249
|
};
|
|
12214
12250
|
var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
12215
12251
|
name: "document_ingest",
|
|
12216
12252
|
title: "Ingest a new document (text body or file upload)",
|
|
12217
|
-
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
|
|
12253
|
+
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 `document_get` until indexStatus is INDEXED. EXCEPTION \u2014 re-ingesting file mode against an externalId that already has a document (response `created:false`): the file body is replaced by ANY such re-ingest, whether or not `upsert` was set (`upsert` there only additionally applies `payload`/`title` to the matched document). The document keeps serving the OLD file's bytes until the new one is adopted, and indexStatus already reads INDEXED left over from that old file, so polling it returns immediately without waiting for the new content. Poll `document_get` and watch `fileItemId` instead \u2014 once it differs from the value it held before this call, the new file has been adopted. Re-request any download URL after that: one minted before adoption can stop working even within its stated `downloadExpires`.\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; in FILE MODE a re-ingest against an existing externalId needs documents:u). TEXT MODE: without `upsert`, the existing document's content is genuinely unchanged. FILE MODE: as noted above, a re-ingest against an existing externalId always replaces the file body regardless of `upsert` \u2014 only the `payload`/`title` metadata overwrite is gated by 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). An `externalId` with no `schemaId` is refused (400) unless you also pass `confirmUntyped:true` to confirm that an untyped document is intended. 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`.",
|
|
12218
12254
|
inputSchema: inputSchema21,
|
|
12219
12255
|
// Creates by default, idempotent ONLY when the caller supplies `externalId` (optional,
|
|
12220
12256
|
// per the doc comment above) — re-ingest then returns the existing document rather than
|
|
@@ -12232,6 +12268,7 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
12232
12268
|
const filePath = args.filePath;
|
|
12233
12269
|
const schemaId = args.schemaId;
|
|
12234
12270
|
const upsert = args.upsert;
|
|
12271
|
+
const confirmUntyped = args.confirmUntyped;
|
|
12235
12272
|
const indexMode = args.indexMode ?? (schemaId ? void 0 : "HYBRID");
|
|
12236
12273
|
if (!text && !filePath) {
|
|
12237
12274
|
return toolError(
|
|
@@ -12280,6 +12317,7 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
12280
12317
|
if (text) {
|
|
12281
12318
|
const result = await client.documents.ingestDocument({
|
|
12282
12319
|
upsert,
|
|
12320
|
+
confirmUntyped,
|
|
12283
12321
|
body: {
|
|
12284
12322
|
title,
|
|
12285
12323
|
text,
|
|
@@ -12320,6 +12358,7 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
12320
12358
|
const storeTextFile = args.storeText ?? true;
|
|
12321
12359
|
const upload = await client.documents.uploadDocument({
|
|
12322
12360
|
upsert,
|
|
12361
|
+
confirmUntyped,
|
|
12323
12362
|
fileName,
|
|
12324
12363
|
fileType,
|
|
12325
12364
|
indexMode,
|
|
@@ -12352,6 +12391,8 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
12352
12391
|
{ tool: "document_ingest", mode: "file", id: docId, fileName, fileType, bytes: bytes.length },
|
|
12353
12392
|
"document_ingest file ok"
|
|
12354
12393
|
);
|
|
12394
|
+
const uploadCreated = upload?.created;
|
|
12395
|
+
const note = uploadCreated === false ? "File replaced: this re-ingest matched an existing externalId, which always replaces that document's file body (upsert or not \u2014 upsert only additionally applies payload/title to it). The next document_get call may already show indexStatus: INDEXED \u2014 that is left over from the PREVIOUS file, not confirmation the new one is ready, and the document keeps serving the old file's bytes until adoption completes. Poll document_get(id) and watch fileItemId instead: once it differs from the value it held before this call, the new file has been adopted. Any download URL already held for this document was minted for the old file and can stop working before its stated downloadExpires once adoption happens \u2014 request a fresh one after fileItemId changes." : "File uploaded; indexing is asynchronous. Poll document_get(id) until indexStatus is INDEXED.";
|
|
12355
12396
|
return {
|
|
12356
12397
|
content: [
|
|
12357
12398
|
{
|
|
@@ -12360,7 +12401,7 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
12360
12401
|
{
|
|
12361
12402
|
...upload,
|
|
12362
12403
|
indexStatus: "PENDING_INDEX",
|
|
12363
|
-
_note:
|
|
12404
|
+
_note: note
|
|
12364
12405
|
},
|
|
12365
12406
|
null,
|
|
12366
12407
|
2
|
|
@@ -12384,29 +12425,29 @@ function presignedUploadHeaders(response) {
|
|
|
12384
12425
|
}
|
|
12385
12426
|
|
|
12386
12427
|
// src/tools/lookup_principal.ts
|
|
12387
|
-
var
|
|
12428
|
+
var import_zod22 = require("zod");
|
|
12388
12429
|
var MCP_DEFAULT_LIMIT5 = 10;
|
|
12389
12430
|
var MCP_MAX_LIMIT5 = 100;
|
|
12390
12431
|
var inputSchema22 = {
|
|
12391
|
-
kind:
|
|
12432
|
+
kind: import_zod22.z.string().describe(
|
|
12392
12433
|
'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.'
|
|
12393
12434
|
),
|
|
12394
|
-
externalId:
|
|
12435
|
+
externalId: import_zod22.z.string().optional().describe(
|
|
12395
12436
|
"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."
|
|
12396
12437
|
),
|
|
12397
|
-
contextId:
|
|
12438
|
+
contextId: import_zod22.z.string().optional().describe(
|
|
12398
12439
|
"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."
|
|
12399
12440
|
),
|
|
12400
12441
|
// Lookup-mode args — provide `field` plus EXACTLY ONE of: value | from+to | prefix.
|
|
12401
|
-
type:
|
|
12402
|
-
field:
|
|
12403
|
-
value:
|
|
12404
|
-
from:
|
|
12405
|
-
to:
|
|
12406
|
-
prefix:
|
|
12407
|
-
order:
|
|
12408
|
-
startFrom:
|
|
12409
|
-
limit:
|
|
12442
|
+
type: import_zod22.z.string().optional().describe('Lookup mode: the identity schema\'s record type (e.g. "person_v1"). Required with `field`.'),
|
|
12443
|
+
field: import_zod22.z.string().optional().describe('Lookup mode: name of the schema-declared lookup field to query by (e.g. "email").'),
|
|
12444
|
+
value: import_zod22.z.string().optional().describe("Lookup mode (equality): exact-match value for `field`. Works on sensitive fields."),
|
|
12445
|
+
from: import_zod22.z.string().optional().describe("Lookup mode (range): inclusive lower bound; requires `to`. Non-sensitive fields only."),
|
|
12446
|
+
to: import_zod22.z.string().optional().describe("Lookup mode (range): inclusive upper bound; requires `from`."),
|
|
12447
|
+
prefix: import_zod22.z.string().optional().describe("Lookup mode (prefix): match values starting with this. Range-enabled string fields only."),
|
|
12448
|
+
order: import_zod22.z.enum(["asc", "desc"]).optional().describe("Lookup mode: sort direction by the looked-up field. `asc` (default) or `desc`."),
|
|
12449
|
+
startFrom: import_zod22.z.string().optional().describe("Lookup mode: pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next."),
|
|
12450
|
+
limit: import_zod22.z.number().int().min(1).max(MCP_MAX_LIMIT5).optional().describe(
|
|
12410
12451
|
`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\`.`
|
|
12411
12452
|
)
|
|
12412
12453
|
};
|
|
@@ -12490,11 +12531,11 @@ var lookupPrincipal = ({ client, log }) => ({
|
|
|
12490
12531
|
var lookup_principal_default = lookupPrincipal;
|
|
12491
12532
|
|
|
12492
12533
|
// src/tools/version_history.ts
|
|
12493
|
-
var
|
|
12534
|
+
var import_zod23 = require("zod");
|
|
12494
12535
|
var inputSchema23 = {
|
|
12495
|
-
resourceType:
|
|
12496
|
-
id:
|
|
12497
|
-
startFrom:
|
|
12536
|
+
resourceType: import_zod23.z.enum(["record", "document"]).describe("Which kind of entity the id refers to: a record or a document."),
|
|
12537
|
+
id: import_zod23.z.string().min(1, "id is required").describe("The Vectros id of the record or document whose history you want."),
|
|
12538
|
+
startFrom: import_zod23.z.string().optional().describe("Pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch older entries.")
|
|
12498
12539
|
};
|
|
12499
12540
|
var versionHistory = ({ client, log }) => ({
|
|
12500
12541
|
name: "version_history",
|
|
@@ -12618,7 +12659,7 @@ var ALL_RESOURCE_FACTORIES = {
|
|
|
12618
12659
|
};
|
|
12619
12660
|
|
|
12620
12661
|
// src/zod-to-json-schema.ts
|
|
12621
|
-
var
|
|
12662
|
+
var import_zod24 = require("zod");
|
|
12622
12663
|
function zodShapeToJsonSchema(shape) {
|
|
12623
12664
|
const properties = {};
|
|
12624
12665
|
const required = [];
|
|
@@ -12633,40 +12674,40 @@ function zodShapeToJsonSchema(shape) {
|
|
|
12633
12674
|
function zodTypeToJsonSchema(schema) {
|
|
12634
12675
|
const description = schema.description;
|
|
12635
12676
|
let current = schema;
|
|
12636
|
-
while (current instanceof
|
|
12677
|
+
while (current instanceof import_zod24.z.ZodOptional || current instanceof import_zod24.z.ZodDefault || current instanceof import_zod24.z.ZodNullable) {
|
|
12637
12678
|
current = current._def.innerType;
|
|
12638
12679
|
}
|
|
12639
12680
|
const base = description ? { description } : {};
|
|
12640
|
-
if (current instanceof
|
|
12681
|
+
if (current instanceof import_zod24.z.ZodString) {
|
|
12641
12682
|
return { ...base, type: "string" };
|
|
12642
12683
|
}
|
|
12643
|
-
if (current instanceof
|
|
12684
|
+
if (current instanceof import_zod24.z.ZodNumber) {
|
|
12644
12685
|
return { ...base, type: "number" };
|
|
12645
12686
|
}
|
|
12646
|
-
if (current instanceof
|
|
12687
|
+
if (current instanceof import_zod24.z.ZodBoolean) {
|
|
12647
12688
|
return { ...base, type: "boolean" };
|
|
12648
12689
|
}
|
|
12649
|
-
if (current instanceof
|
|
12690
|
+
if (current instanceof import_zod24.z.ZodEnum) {
|
|
12650
12691
|
return {
|
|
12651
12692
|
...base,
|
|
12652
12693
|
type: "string",
|
|
12653
12694
|
enum: current.options
|
|
12654
12695
|
};
|
|
12655
12696
|
}
|
|
12656
|
-
if (current instanceof
|
|
12697
|
+
if (current instanceof import_zod24.z.ZodArray) {
|
|
12657
12698
|
return {
|
|
12658
12699
|
...base,
|
|
12659
12700
|
type: "array",
|
|
12660
12701
|
items: zodTypeToJsonSchema(current.element)
|
|
12661
12702
|
};
|
|
12662
12703
|
}
|
|
12663
|
-
if (current instanceof
|
|
12704
|
+
if (current instanceof import_zod24.z.ZodObject) {
|
|
12664
12705
|
return {
|
|
12665
12706
|
...base,
|
|
12666
12707
|
...zodShapeToJsonSchema(current.shape)
|
|
12667
12708
|
};
|
|
12668
12709
|
}
|
|
12669
|
-
if (current instanceof
|
|
12710
|
+
if (current instanceof import_zod24.z.ZodRecord) {
|
|
12670
12711
|
const valueType = current._def.valueType;
|
|
12671
12712
|
return {
|
|
12672
12713
|
...base,
|
|
@@ -12795,7 +12836,7 @@ var VectrosMCPServer = class {
|
|
|
12795
12836
|
if (!tool) {
|
|
12796
12837
|
result = toolError(req.params.name ?? "unknown", new Error("No such tool."));
|
|
12797
12838
|
} else {
|
|
12798
|
-
const parsed =
|
|
12839
|
+
const parsed = import_zod25.z.object(tool.inputSchema).strict().safeParse(req.params.arguments ?? {});
|
|
12799
12840
|
if (!parsed.success) {
|
|
12800
12841
|
result = toolError(tool.name, new Error(formatArgError(tool, parsed.error)));
|
|
12801
12842
|
} else {
|