@vectros-ai/mcp-server 0.17.2 → 0.18.0
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 +28 -0
- package/README.md +37 -20
- package/dist/cli-http.js +197 -166
- package/dist/cli-http.js.map +1 -1
- package/dist/cli-http.mjs +197 -166
- package/dist/cli-http.mjs.map +1 -1
- package/dist/cli.js +197 -166
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +197 -166
- package/dist/cli.mjs.map +1 -1
- package/dist/index.js +197 -166
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +197 -166
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -42,7 +42,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
42
42
|
// src/server.ts
|
|
43
43
|
var import_server = require("@modelcontextprotocol/sdk/server/index.js");
|
|
44
44
|
|
|
45
|
-
//
|
|
45
|
+
// node_modules/@vectros-ai/sdk/dist/index.mjs
|
|
46
46
|
var __defProp2 = Object.defineProperty;
|
|
47
47
|
var __export2 = (target, all) => {
|
|
48
48
|
for (var name in all)
|
|
@@ -62,6 +62,7 @@ __export2(api_exports, {
|
|
|
62
62
|
ContentTooLargeError: () => ContentTooLargeError,
|
|
63
63
|
DocumentContextEvent: () => DocumentContextEvent,
|
|
64
64
|
DocumentLookupRequest: () => DocumentLookupRequest,
|
|
65
|
+
DocumentPatchRequest: () => DocumentPatchRequest,
|
|
65
66
|
DocumentRequest: () => DocumentRequest,
|
|
66
67
|
DocumentResponse: () => DocumentResponse,
|
|
67
68
|
DoneEvent: () => DoneEvent,
|
|
@@ -405,6 +406,13 @@ var DocumentLookupRequest;
|
|
|
405
406
|
Desc: "desc"
|
|
406
407
|
};
|
|
407
408
|
})(DocumentLookupRequest || (DocumentLookupRequest = {}));
|
|
409
|
+
var DocumentPatchRequest;
|
|
410
|
+
((DocumentPatchRequest2) => {
|
|
411
|
+
DocumentPatchRequest2.Status = {
|
|
412
|
+
Active: "ACTIVE",
|
|
413
|
+
Archived: "ARCHIVED"
|
|
414
|
+
};
|
|
415
|
+
})(DocumentPatchRequest || (DocumentPatchRequest = {}));
|
|
408
416
|
var FileUploadRequest;
|
|
409
417
|
((FileUploadRequest2) => {
|
|
410
418
|
FileUploadRequest2.IndexMode = {
|
|
@@ -417,6 +425,7 @@ var FileUploadRequest;
|
|
|
417
425
|
var documents_exports = {};
|
|
418
426
|
__export2(documents_exports, {
|
|
419
427
|
DocumentLookupRequest: () => DocumentLookupRequest,
|
|
428
|
+
DocumentPatchRequest: () => DocumentPatchRequest,
|
|
420
429
|
FileUploadRequest: () => FileUploadRequest,
|
|
421
430
|
LookupDocumentsRequestOrder: () => LookupDocumentsRequestOrder
|
|
422
431
|
});
|
|
@@ -3081,6 +3090,7 @@ var AuthClient = class {
|
|
|
3081
3090
|
* @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3082
3091
|
*
|
|
3083
3092
|
* @throws {@link Vectros.BadRequestError}
|
|
3093
|
+
* @throws {@link Vectros.PaymentRequiredError}
|
|
3084
3094
|
* @throws {@link Vectros.ForbiddenError}
|
|
3085
3095
|
* @throws {@link Vectros.TooManyRequestsError}
|
|
3086
3096
|
*
|
|
@@ -3130,6 +3140,8 @@ var AuthClient = class {
|
|
|
3130
3140
|
switch (_response.error.statusCode) {
|
|
3131
3141
|
case 400:
|
|
3132
3142
|
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
3143
|
+
case 402:
|
|
3144
|
+
throw new PaymentRequiredError(_response.error.body, _response.rawResponse);
|
|
3133
3145
|
case 403:
|
|
3134
3146
|
throw new ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3135
3147
|
case 429:
|
|
@@ -4975,7 +4987,7 @@ var ComplianceClient = class {
|
|
|
4975
4987
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
4976
4988
|
}
|
|
4977
4989
|
/**
|
|
4978
|
-
* Submits a right-to-erasure request for a single end-subject (a user, or an identity entity in any namespace). Erasure removes exactly the data the subject solely owns across the declared contexts, plus
|
|
4990
|
+
* Submits a right-to-erasure request for a single end-subject (a user, or an identity entity in any namespace). Erasure removes exactly the data the subject solely owns across the declared contexts, plus its identity and lookup rows when all contexts are covered. It never touches another account's data and never cascades into another subject's data. 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.
|
|
4979
4991
|
*
|
|
4980
4992
|
* @param {Vectros.ErasureRequest} request
|
|
4981
4993
|
* @param {ComplianceClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -5038,7 +5050,7 @@ var ComplianceClient = class {
|
|
|
5038
5050
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/erasure-requests");
|
|
5039
5051
|
}
|
|
5040
5052
|
/**
|
|
5041
|
-
* 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 verifiable completion certificate (which contexts were swept, per-context deletion counts, and reports of dangling references and shared rows
|
|
5053
|
+
* 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 verifiable 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.
|
|
5042
5054
|
*
|
|
5043
5055
|
* @param {Vectros.GetErasureRequestRequest} request
|
|
5044
5056
|
* @param {ComplianceClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -5281,7 +5293,7 @@ var DocumentsClient = class {
|
|
|
5281
5293
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/documents");
|
|
5282
5294
|
}
|
|
5283
5295
|
/**
|
|
5284
|
-
* 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.
|
|
5296
|
+
* 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.
|
|
5285
5297
|
*
|
|
5286
5298
|
* @param {Vectros.IngestDocumentRequest} request
|
|
5287
5299
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -5301,10 +5313,11 @@ var DocumentsClient = class {
|
|
|
5301
5313
|
return HttpResponsePromise.fromPromise(this.__ingestDocument(request, requestOptions));
|
|
5302
5314
|
}
|
|
5303
5315
|
async __ingestDocument(request, requestOptions) {
|
|
5304
|
-
const { upsert, allowClear, body: _body } = request;
|
|
5316
|
+
const { upsert, allowClear, confirmUntyped, body: _body } = request;
|
|
5305
5317
|
const _queryParams = {
|
|
5306
5318
|
upsert,
|
|
5307
|
-
allowClear
|
|
5319
|
+
allowClear,
|
|
5320
|
+
confirmUntyped
|
|
5308
5321
|
};
|
|
5309
5322
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5310
5323
|
const _headers = mergeHeaders(
|
|
@@ -5539,7 +5552,7 @@ var DocumentsClient = class {
|
|
|
5539
5552
|
/**
|
|
5540
5553
|
* 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.
|
|
5541
5554
|
*
|
|
5542
|
-
* @param {Vectros.
|
|
5555
|
+
* @param {Vectros.DocumentPatchRequest} request
|
|
5543
5556
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5544
5557
|
*
|
|
5545
5558
|
* @throws {@link Vectros.BadRequestError}
|
|
@@ -5550,17 +5563,14 @@ var DocumentsClient = class {
|
|
|
5550
5563
|
*
|
|
5551
5564
|
* @example
|
|
5552
5565
|
* await client.documents.patchDocument({
|
|
5553
|
-
* id: "id"
|
|
5554
|
-
* body: {
|
|
5555
|
-
* title: "Patient Intake Form \u2014 Jane Doe"
|
|
5556
|
-
* }
|
|
5566
|
+
* id: "id"
|
|
5557
5567
|
* })
|
|
5558
5568
|
*/
|
|
5559
5569
|
patchDocument(request, requestOptions) {
|
|
5560
5570
|
return HttpResponsePromise.fromPromise(this.__patchDocument(request, requestOptions));
|
|
5561
5571
|
}
|
|
5562
5572
|
async __patchDocument(request, requestOptions) {
|
|
5563
|
-
const { id,
|
|
5573
|
+
const { id, ..._body } = request;
|
|
5564
5574
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5565
5575
|
const _headers = mergeHeaders(
|
|
5566
5576
|
_authRequest.headers,
|
|
@@ -5932,7 +5942,7 @@ var DocumentsClient = class {
|
|
|
5932
5942
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/documents/{id}/versions");
|
|
5933
5943
|
}
|
|
5934
5944
|
/**
|
|
5935
|
-
* 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.
|
|
5945
|
+
* 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.
|
|
5936
5946
|
*
|
|
5937
5947
|
* @param {Vectros.FileUploadRequest} request
|
|
5938
5948
|
* @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -5951,9 +5961,10 @@ var DocumentsClient = class {
|
|
|
5951
5961
|
return HttpResponsePromise.fromPromise(this.__uploadDocument(request, requestOptions));
|
|
5952
5962
|
}
|
|
5953
5963
|
async __uploadDocument(request, requestOptions) {
|
|
5954
|
-
const { upsert, ..._body } = request;
|
|
5964
|
+
const { upsert, confirmUntyped, ..._body } = request;
|
|
5955
5965
|
const _queryParams = {
|
|
5956
|
-
upsert
|
|
5966
|
+
upsert,
|
|
5967
|
+
confirmUntyped
|
|
5957
5968
|
};
|
|
5958
5969
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5959
5970
|
const _headers = mergeHeaders(
|
|
@@ -10249,7 +10260,7 @@ var logging;
|
|
|
10249
10260
|
|
|
10250
10261
|
// src/server.ts
|
|
10251
10262
|
var import_types3 = require("@modelcontextprotocol/sdk/types.js");
|
|
10252
|
-
var
|
|
10263
|
+
var import_zod25 = require("zod");
|
|
10253
10264
|
|
|
10254
10265
|
// src/auth.ts
|
|
10255
10266
|
var KEY_RE = /^(sk|ssk|st)_(live|test)_/;
|
|
@@ -10293,8 +10304,8 @@ function warnOnSuboptimalKey(key, log) {
|
|
|
10293
10304
|
|
|
10294
10305
|
// src/build-info.ts
|
|
10295
10306
|
var BUILD_INFO = {
|
|
10296
|
-
mcpServer: true ? "0.
|
|
10297
|
-
sdk: true ? "0.
|
|
10307
|
+
mcpServer: true ? "0.18.0" : "dev",
|
|
10308
|
+
sdk: true ? "0.46.0" : "dev"
|
|
10298
10309
|
};
|
|
10299
10310
|
|
|
10300
10311
|
// src/log.ts
|
|
@@ -10586,7 +10597,7 @@ var inputSchema = {
|
|
|
10586
10597
|
"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.)"
|
|
10587
10598
|
),
|
|
10588
10599
|
limit: import_zod.z.number().int().min(1).max(MCP_MAX_LIMIT).optional().describe(
|
|
10589
|
-
`Max hits per page. Defaults to a low ${MCP_DEFAULT_LIMIT} to protect the agent context window; raise up to ${MCP_MAX_LIMIT} (
|
|
10600
|
+
`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.`
|
|
10590
10601
|
),
|
|
10591
10602
|
offset: import_zod.z.number().int().min(0).max(200).optional().describe("Skip the first N hits \u2014 for pagination (0\u2013200)."),
|
|
10592
10603
|
folderId: import_zod.z.string().optional().describe("Scope to content in this EXACT folder (Vectros folder id)."),
|
|
@@ -11335,52 +11346,61 @@ var recordDelete = ({ client, log }) => ({
|
|
|
11335
11346
|
var record_delete_default = recordDelete;
|
|
11336
11347
|
|
|
11337
11348
|
// src/tools/rag_ask.ts
|
|
11349
|
+
var import_zod10 = require("zod");
|
|
11350
|
+
|
|
11351
|
+
// src/tools/provider-alias.ts
|
|
11338
11352
|
var import_zod9 = require("zod");
|
|
11353
|
+
var providerAliasInput = import_zod9.z.string().min(1, "providerAlias must be non-empty when supplied").optional().describe(
|
|
11354
|
+
"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. A call served by your own provider leaves the platform-hosted Bedrock path, and Vectros's AWS BAA boundary. 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."
|
|
11355
|
+
);
|
|
11356
|
+
|
|
11357
|
+
// src/tools/rag_ask.ts
|
|
11339
11358
|
var SEARCH_MCP_DEFAULT_LIMIT = 5;
|
|
11340
11359
|
var SEARCH_MCP_MAX_LIMIT = 50;
|
|
11341
11360
|
var inputSchema9 = {
|
|
11342
|
-
query:
|
|
11343
|
-
instructions:
|
|
11361
|
+
query: import_zod10.z.string().min(1, "query must be non-empty").describe("Question to ground against retrieved content."),
|
|
11362
|
+
instructions: import_zod10.z.string().optional().describe(
|
|
11344
11363
|
'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.'
|
|
11345
11364
|
),
|
|
11346
|
-
model:
|
|
11347
|
-
"Inference model alias (e.g. claude-haiku-4-5, claude-sonnet-5, claude-opus-
|
|
11365
|
+
model: import_zod10.z.string().optional().describe(
|
|
11366
|
+
"Inference model alias (e.g. claude-haiku-4-5, claude-sonnet-5, claude-opus-5-5). Default = tier-appropriate Haiku. See GET /v1/models for the catalog the calling key can reach. When `providerAlias` is set, this instead names the model on that provider's own id space."
|
|
11348
11367
|
),
|
|
11349
|
-
|
|
11350
|
-
|
|
11351
|
-
|
|
11352
|
-
|
|
11368
|
+
providerAlias: providerAliasInput,
|
|
11369
|
+
search: import_zod10.z.object({
|
|
11370
|
+
mode: import_zod10.z.enum(["HYBRID", "TEXT", "SEMANTIC"]).optional().describe("Retrieval mode. Default HYBRID."),
|
|
11371
|
+
limit: import_zod10.z.number().int().min(1).max(SEARCH_MCP_MAX_LIMIT).optional().describe(
|
|
11372
|
+
`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.`
|
|
11353
11373
|
),
|
|
11354
11374
|
// Retrieval scoping — parity with hybrid_search so an agent can ground the
|
|
11355
11375
|
// answer on a specific owner / folder / type / metadata subset, not just the
|
|
11356
11376
|
// whole-tenant corpus.
|
|
11357
|
-
userId:
|
|
11358
|
-
scope:
|
|
11377
|
+
userId: import_zod10.z.string().optional().describe("Restrict retrieval to content owned by this user (Vectros UUID)."),
|
|
11378
|
+
scope: import_zod10.z.string().optional().describe(
|
|
11359
11379
|
'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.'
|
|
11360
11380
|
),
|
|
11361
|
-
scopeFilters:
|
|
11381
|
+
scopeFilters: import_zod10.z.array(import_zod10.z.string()).min(1, "scopeFilters must name at least one dimension when supplied").optional().describe(
|
|
11362
11382
|
'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`.'
|
|
11363
11383
|
),
|
|
11364
|
-
folderId:
|
|
11365
|
-
rootFolderId:
|
|
11366
|
-
typeName:
|
|
11367
|
-
contentTypes:
|
|
11368
|
-
filters:
|
|
11384
|
+
folderId: import_zod10.z.string().optional().describe("Restrict retrieval to this exact folder."),
|
|
11385
|
+
rootFolderId: import_zod10.z.string().optional().describe("Restrict retrieval to this folder and all its descendants."),
|
|
11386
|
+
typeName: import_zod10.z.string().optional().describe("Restrict record retrieval to this schema type."),
|
|
11387
|
+
contentTypes: import_zod10.z.array(import_zod10.z.enum(["documents", "records"])).optional().describe('Narrow retrieval to content types. ["documents"] or ["records"]; omit for both.'),
|
|
11388
|
+
filters: import_zod10.z.record(import_zod10.z.unknown()).optional().describe(
|
|
11369
11389
|
'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"}.'
|
|
11370
11390
|
),
|
|
11371
|
-
createdAfter:
|
|
11391
|
+
createdAfter: import_zod10.z.string().optional().describe(
|
|
11372
11392
|
"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."
|
|
11373
11393
|
),
|
|
11374
|
-
createdBefore:
|
|
11375
|
-
requireComplete:
|
|
11394
|
+
createdBefore: import_zod10.z.string().optional().describe("Same creation-time basis as createdAfter, bounding at/before this ISO 8601 UTC value."),
|
|
11395
|
+
requireComplete: import_zod10.z.boolean().optional().describe("Fail closed (503) on a degraded search backend instead of grounding on partial results. Default false.")
|
|
11376
11396
|
}).optional().describe("Retrieval params + scoping. Default mode HYBRID, limit " + SEARCH_MCP_DEFAULT_LIMIT + "."),
|
|
11377
|
-
maxTokens:
|
|
11378
|
-
temperature:
|
|
11397
|
+
maxTokens: import_zod10.z.number().int().min(1).optional().describe("Max output tokens."),
|
|
11398
|
+
temperature: import_zod10.z.number().min(0).max(1).optional().describe("Sampling temperature (0.0\u20131.0). Default 0.3 \u2014 lower favors deterministic, retrieval-grounded answers.")
|
|
11379
11399
|
};
|
|
11380
11400
|
var ragAsk = ({ client, log }) => ({
|
|
11381
11401
|
name: "rag_ask",
|
|
11382
11402
|
title: "RAG ask (corpus-wide)",
|
|
11383
|
-
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.
|
|
11403
|
+
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. 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.",
|
|
11384
11404
|
inputSchema: inputSchema9,
|
|
11385
11405
|
// NOT a pure read: this call reserves an atomic hold against the caller's prepaid inference
|
|
11386
11406
|
// balance before generation starts, then debits it on completion — a real financial side
|
|
@@ -11422,6 +11442,7 @@ var ragAsk = ({ client, log }) => ({
|
|
|
11422
11442
|
query: args.query,
|
|
11423
11443
|
instructions: args.instructions,
|
|
11424
11444
|
model: args.model,
|
|
11445
|
+
providerAlias: args.providerAlias,
|
|
11425
11446
|
search,
|
|
11426
11447
|
maxTokens: args.maxTokens,
|
|
11427
11448
|
temperature: args.temperature
|
|
@@ -11476,19 +11497,20 @@ var ragAsk = ({ client, log }) => ({
|
|
|
11476
11497
|
var rag_ask_default = ragAsk;
|
|
11477
11498
|
|
|
11478
11499
|
// src/tools/document_ask.ts
|
|
11479
|
-
var
|
|
11500
|
+
var import_zod11 = require("zod");
|
|
11480
11501
|
var inputSchema10 = {
|
|
11481
|
-
documentId:
|
|
11482
|
-
prompt:
|
|
11483
|
-
model:
|
|
11484
|
-
"Inference model alias. Default = tier-appropriate Haiku. See GET /v1/models for the catalog the calling key can reach."
|
|
11502
|
+
documentId: import_zod11.z.string().min(1, "documentId is required").describe("ID of the document to ask against."),
|
|
11503
|
+
prompt: import_zod11.z.string().min(1, "prompt is required").describe("Question to ask about the document."),
|
|
11504
|
+
model: import_zod11.z.string().optional().describe(
|
|
11505
|
+
"Inference model alias. Default = tier-appropriate Haiku. See GET /v1/models for the catalog the calling key can reach. When `providerAlias` is set, this instead names the model on that provider's own id space."
|
|
11485
11506
|
),
|
|
11486
|
-
|
|
11507
|
+
providerAlias: providerAliasInput,
|
|
11508
|
+
maxTokens: import_zod11.z.number().int().min(1).optional().describe("Max output tokens.")
|
|
11487
11509
|
};
|
|
11488
11510
|
var documentAsk = ({ client, log }) => ({
|
|
11489
11511
|
name: "document_ask",
|
|
11490
11512
|
title: "Document ask (single-document)",
|
|
11491
|
-
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`.
|
|
11513
|
+
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.",
|
|
11492
11514
|
inputSchema: inputSchema10,
|
|
11493
11515
|
// NOT a pure read: this call reserves an atomic hold against the caller's prepaid inference
|
|
11494
11516
|
// balance before generation starts, then debits it on completion — a real financial side
|
|
@@ -11505,6 +11527,7 @@ var documentAsk = ({ client, log }) => ({
|
|
|
11505
11527
|
id: args.documentId,
|
|
11506
11528
|
prompt: args.prompt,
|
|
11507
11529
|
model: args.model,
|
|
11530
|
+
providerAlias: args.providerAlias,
|
|
11508
11531
|
maxTokens: args.maxTokens
|
|
11509
11532
|
});
|
|
11510
11533
|
const progressToken = extra._meta?.progressToken;
|
|
@@ -11557,18 +11580,18 @@ var documentAsk = ({ client, log }) => ({
|
|
|
11557
11580
|
var document_ask_default = documentAsk;
|
|
11558
11581
|
|
|
11559
11582
|
// src/tools/list_schemas.ts
|
|
11560
|
-
var
|
|
11583
|
+
var import_zod12 = require("zod");
|
|
11561
11584
|
var inputSchema11 = {
|
|
11562
|
-
userId:
|
|
11585
|
+
userId: import_zod12.z.string().optional().describe(
|
|
11563
11586
|
"Filter to schemas visible to a specific user. Optional; default returns all schemas the credential can see."
|
|
11564
11587
|
),
|
|
11565
|
-
scope:
|
|
11588
|
+
scope: import_zod12.z.string().optional().describe(
|
|
11566
11589
|
'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.'
|
|
11567
11590
|
),
|
|
11568
|
-
surface:
|
|
11591
|
+
surface: import_zod12.z.enum(["record", "document", "user", "entity"]).optional().describe(
|
|
11569
11592
|
"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."
|
|
11570
11593
|
),
|
|
11571
|
-
recordType:
|
|
11594
|
+
recordType: import_zod12.z.string().optional().describe(
|
|
11572
11595
|
'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.'
|
|
11573
11596
|
)
|
|
11574
11597
|
};
|
|
@@ -11604,19 +11627,19 @@ var listSchemas = ({ client, log }) => ({
|
|
|
11604
11627
|
var list_schemas_default = listSchemas;
|
|
11605
11628
|
|
|
11606
11629
|
// src/tools/document_get.ts
|
|
11607
|
-
var
|
|
11630
|
+
var import_zod13 = require("zod");
|
|
11608
11631
|
var MAX_TEXT_CHARS = 32e3;
|
|
11609
11632
|
var inputSchema12 = {
|
|
11610
|
-
documentId:
|
|
11611
|
-
externalId:
|
|
11633
|
+
documentId: import_zod13.z.string().optional().describe("The document ID returned by document_ingest or hybrid_search. Provide this OR externalId+type."),
|
|
11634
|
+
externalId: import_zod13.z.string().optional().describe(
|
|
11612
11635
|
"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."
|
|
11613
11636
|
),
|
|
11614
|
-
type:
|
|
11615
|
-
includeText:
|
|
11637
|
+
type: import_zod13.z.string().optional().describe("Document type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
|
|
11638
|
+
includeText: import_zod13.z.boolean().optional().describe(
|
|
11616
11639
|
"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."
|
|
11617
11640
|
),
|
|
11618
|
-
includeDownloadUrl:
|
|
11619
|
-
"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."
|
|
11641
|
+
includeDownloadUrl: import_zod13.z.boolean().optional().describe(
|
|
11642
|
+
"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."
|
|
11620
11643
|
)
|
|
11621
11644
|
};
|
|
11622
11645
|
function truncateText(text) {
|
|
@@ -11699,28 +11722,28 @@ var documentGet = ({ client, log }) => ({
|
|
|
11699
11722
|
var document_get_default = documentGet;
|
|
11700
11723
|
|
|
11701
11724
|
// src/tools/document_query.ts
|
|
11702
|
-
var
|
|
11725
|
+
var import_zod14 = require("zod");
|
|
11703
11726
|
var MCP_DEFAULT_LIMIT3 = 3;
|
|
11704
11727
|
var MCP_MAX_LIMIT3 = 100;
|
|
11705
11728
|
var inputSchema13 = {
|
|
11706
11729
|
// Lookup-mode args — provide `field` plus EXACTLY ONE of: value | from+to | prefix.
|
|
11707
|
-
field:
|
|
11708
|
-
value:
|
|
11709
|
-
from:
|
|
11710
|
-
to:
|
|
11711
|
-
prefix:
|
|
11712
|
-
order:
|
|
11730
|
+
field: import_zod14.z.string().optional().describe("Lookup mode: name of the lookup-indexed field to query by."),
|
|
11731
|
+
value: import_zod14.z.string().optional().describe("Lookup mode (equality): exact-match value for `field`. Works on sensitive fields too."),
|
|
11732
|
+
from: import_zod14.z.string().optional().describe("Lookup mode (range): inclusive lower bound; requires `to`. Range-enabled, non-sensitive fields only."),
|
|
11733
|
+
to: import_zod14.z.string().optional().describe("Lookup mode (range): inclusive upper bound; requires `from`."),
|
|
11734
|
+
prefix: import_zod14.z.string().optional().describe("Lookup mode (prefix): match values starting with this. Range-enabled string fields only."),
|
|
11735
|
+
order: import_zod14.z.enum(["asc", "desc"]).optional().describe(
|
|
11713
11736
|
"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."
|
|
11714
11737
|
),
|
|
11715
|
-
type:
|
|
11738
|
+
type: import_zod14.z.string().optional().describe("Lookup mode: the document type (the bound schema's type). Required with `field`."),
|
|
11716
11739
|
// List-mode args:
|
|
11717
|
-
folderId:
|
|
11718
|
-
userId:
|
|
11719
|
-
scope:
|
|
11740
|
+
folderId: import_zod14.z.string().optional().describe("List mode: only documents in this folder (Vectros folder id)."),
|
|
11741
|
+
userId: import_zod14.z.string().optional().describe("List mode: scope to documents owned by this user."),
|
|
11742
|
+
scope: import_zod14.z.string().optional().describe(
|
|
11720
11743
|
'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.'
|
|
11721
11744
|
),
|
|
11722
|
-
startFrom:
|
|
11723
|
-
limit:
|
|
11745
|
+
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."),
|
|
11746
|
+
limit: import_zod14.z.number().int().min(1).max(MCP_MAX_LIMIT3).optional().describe(
|
|
11724
11747
|
`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.`
|
|
11725
11748
|
)
|
|
11726
11749
|
};
|
|
@@ -11810,29 +11833,29 @@ var documentQuery = ({ client, log }) => ({
|
|
|
11810
11833
|
var document_query_default = documentQuery;
|
|
11811
11834
|
|
|
11812
11835
|
// src/tools/document_update.ts
|
|
11813
|
-
var
|
|
11836
|
+
var import_zod15 = require("zod");
|
|
11814
11837
|
var inputSchema14 = {
|
|
11815
|
-
documentId:
|
|
11816
|
-
externalId:
|
|
11838
|
+
documentId: import_zod15.z.string().optional().describe("The Vectros document id to update. Provide this OR externalId+type."),
|
|
11839
|
+
externalId: import_zod15.z.string().optional().describe(
|
|
11817
11840
|
"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."
|
|
11818
11841
|
),
|
|
11819
|
-
type:
|
|
11820
|
-
title:
|
|
11821
|
-
fields:
|
|
11842
|
+
type: import_zod15.z.string().optional().describe("Document type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
|
|
11843
|
+
title: import_zod15.z.string().optional().describe("New title. Omit to keep the current title."),
|
|
11844
|
+
fields: import_zod15.z.record(import_zod15.z.string(), import_zod15.z.unknown()).optional().describe(
|
|
11822
11845
|
"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."
|
|
11823
11846
|
),
|
|
11824
|
-
text:
|
|
11847
|
+
text: import_zod15.z.string().optional().describe(
|
|
11825
11848
|
"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."
|
|
11826
11849
|
),
|
|
11827
|
-
folderId:
|
|
11828
|
-
status:
|
|
11850
|
+
folderId: import_zod15.z.string().optional().describe("Move the document into this folder (cannot be cleared once set)."),
|
|
11851
|
+
status: import_zod15.z.enum(["ACTIVE", "ARCHIVED"]).optional().describe(
|
|
11829
11852
|
"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."
|
|
11830
11853
|
),
|
|
11831
|
-
userId:
|
|
11832
|
-
scopes:
|
|
11854
|
+
userId: import_zod15.z.string().optional().describe("Reassign the owning user (Vectros UUID)."),
|
|
11855
|
+
scopes: import_zod15.z.array(import_zod15.z.string()).optional().describe(
|
|
11833
11856
|
'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).'
|
|
11834
11857
|
),
|
|
11835
|
-
expectedVersion:
|
|
11858
|
+
expectedVersion: import_zod15.z.number().int().optional().describe(
|
|
11836
11859
|
"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."
|
|
11837
11860
|
)
|
|
11838
11861
|
};
|
|
@@ -11860,18 +11883,18 @@ var documentUpdate = ({ client, log }) => ({
|
|
|
11860
11883
|
try {
|
|
11861
11884
|
const resolved = await resolveDocumentIdByExternalId(client, { id: documentId, externalId, type });
|
|
11862
11885
|
if ("error" in resolved) return toolError("document_update", new Error(resolved.error));
|
|
11863
|
-
const
|
|
11864
|
-
if (title !== void 0)
|
|
11865
|
-
if (fields !== void 0)
|
|
11866
|
-
if (text !== void 0)
|
|
11867
|
-
if (folderId !== void 0)
|
|
11868
|
-
if (status !== void 0)
|
|
11869
|
-
if (userId !== void 0)
|
|
11870
|
-
if (scopes !== void 0)
|
|
11871
|
-
if (expectedVersion !== void 0)
|
|
11886
|
+
const patch = {};
|
|
11887
|
+
if (title !== void 0) patch.title = title;
|
|
11888
|
+
if (fields !== void 0) patch.payload = fields;
|
|
11889
|
+
if (text !== void 0) patch.text = text;
|
|
11890
|
+
if (folderId !== void 0) patch.folderId = folderId;
|
|
11891
|
+
if (status !== void 0) patch.status = status;
|
|
11892
|
+
if (userId !== void 0) patch.userId = userId;
|
|
11893
|
+
if (scopes !== void 0) patch.scopes = scopes;
|
|
11894
|
+
if (expectedVersion !== void 0) patch.expectedVersion = expectedVersion;
|
|
11872
11895
|
const updated = await client.documents.patchDocument({
|
|
11873
11896
|
id: resolved.id,
|
|
11874
|
-
|
|
11897
|
+
...patch
|
|
11875
11898
|
});
|
|
11876
11899
|
log.debug({ tool: "document_update", documentId: resolved.id, externalId }, "document_update ok");
|
|
11877
11900
|
return { content: [{ type: "text", text: JSON.stringify(updated, null, 2) }] };
|
|
@@ -11884,9 +11907,9 @@ var documentUpdate = ({ client, log }) => ({
|
|
|
11884
11907
|
var document_update_default = documentUpdate;
|
|
11885
11908
|
|
|
11886
11909
|
// src/tools/document_delete.ts
|
|
11887
|
-
var
|
|
11910
|
+
var import_zod16 = require("zod");
|
|
11888
11911
|
var inputSchema15 = {
|
|
11889
|
-
documentId:
|
|
11912
|
+
documentId: import_zod16.z.string().min(1, "documentId is required").describe("The Vectros document id to delete.")
|
|
11890
11913
|
};
|
|
11891
11914
|
var documentDelete = ({ client, log }) => ({
|
|
11892
11915
|
name: "document_delete",
|
|
@@ -11913,18 +11936,18 @@ var documentDelete = ({ client, log }) => ({
|
|
|
11913
11936
|
var document_delete_default = documentDelete;
|
|
11914
11937
|
|
|
11915
11938
|
// src/tools/folder_query.ts
|
|
11916
|
-
var
|
|
11939
|
+
var import_zod17 = require("zod");
|
|
11917
11940
|
var MCP_DEFAULT_LIMIT4 = 10;
|
|
11918
11941
|
var MCP_MAX_LIMIT4 = 100;
|
|
11919
11942
|
var inputSchema16 = {
|
|
11920
|
-
id:
|
|
11921
|
-
parentId:
|
|
11922
|
-
userId:
|
|
11923
|
-
scope:
|
|
11943
|
+
id: import_zod17.z.string().optional().describe("Get mode: fetch this single folder by id."),
|
|
11944
|
+
parentId: import_zod17.z.string().optional().describe("List mode: direct children of this folder (tree navigation). Omit for a flat tenant list."),
|
|
11945
|
+
userId: import_zod17.z.string().optional().describe("List mode: scope to folders owned by this user."),
|
|
11946
|
+
scope: import_zod17.z.string().optional().describe(
|
|
11924
11947
|
'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.'
|
|
11925
11948
|
),
|
|
11926
|
-
startFrom:
|
|
11927
|
-
limit:
|
|
11949
|
+
startFrom: import_zod17.z.string().optional().describe("List mode: pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next."),
|
|
11950
|
+
limit: import_zod17.z.number().int().min(1).max(MCP_MAX_LIMIT4).optional().describe(
|
|
11928
11951
|
`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\`.`
|
|
11929
11952
|
)
|
|
11930
11953
|
};
|
|
@@ -11964,16 +11987,16 @@ var folderQuery = ({ client, log }) => ({
|
|
|
11964
11987
|
var folder_query_default = folderQuery;
|
|
11965
11988
|
|
|
11966
11989
|
// src/tools/folder_create.ts
|
|
11967
|
-
var
|
|
11990
|
+
var import_zod18 = require("zod");
|
|
11968
11991
|
var inputSchema17 = {
|
|
11969
|
-
name:
|
|
11970
|
-
description:
|
|
11971
|
-
parentId:
|
|
11972
|
-
slug:
|
|
11992
|
+
name: import_zod18.z.string().min(1, "name is required").describe("Folder display name."),
|
|
11993
|
+
description: import_zod18.z.string().optional().describe("Optional description of the folder's purpose."),
|
|
11994
|
+
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."),
|
|
11995
|
+
slug: import_zod18.z.string().optional().describe(
|
|
11973
11996
|
"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."
|
|
11974
11997
|
),
|
|
11975
|
-
userId:
|
|
11976
|
-
scopes:
|
|
11998
|
+
userId: import_zod18.z.string().optional().describe("Owning user (Vectros UUID)."),
|
|
11999
|
+
scopes: import_zod18.z.array(import_zod18.z.string()).optional().describe(
|
|
11977
12000
|
'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.'
|
|
11978
12001
|
)
|
|
11979
12002
|
};
|
|
@@ -12015,16 +12038,16 @@ var folderCreate = ({ client, log }) => ({
|
|
|
12015
12038
|
var folder_create_default = folderCreate;
|
|
12016
12039
|
|
|
12017
12040
|
// src/tools/folder_update.ts
|
|
12018
|
-
var
|
|
12041
|
+
var import_zod19 = require("zod");
|
|
12019
12042
|
var inputSchema18 = {
|
|
12020
|
-
id:
|
|
12021
|
-
name:
|
|
12022
|
-
description:
|
|
12023
|
-
userId:
|
|
12024
|
-
scopes:
|
|
12043
|
+
id: import_zod19.z.string().min(1, "id is required").describe("The Vectros folder id to update."),
|
|
12044
|
+
name: import_zod19.z.string().optional().describe("New folder name. Omit to keep the current name."),
|
|
12045
|
+
description: import_zod19.z.string().optional().describe("New description. Omit to leave unchanged."),
|
|
12046
|
+
userId: import_zod19.z.string().optional().describe("Reassign the owning user (Vectros UUID)."),
|
|
12047
|
+
scopes: import_zod19.z.array(import_zod19.z.string()).optional().describe(
|
|
12025
12048
|
'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).'
|
|
12026
12049
|
),
|
|
12027
|
-
expectedVersion:
|
|
12050
|
+
expectedVersion: import_zod19.z.number().int().optional().describe(
|
|
12028
12051
|
"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."
|
|
12029
12052
|
)
|
|
12030
12053
|
};
|
|
@@ -12063,9 +12086,9 @@ var folderUpdate = ({ client, log }) => ({
|
|
|
12063
12086
|
var folder_update_default = folderUpdate;
|
|
12064
12087
|
|
|
12065
12088
|
// src/tools/folder_delete.ts
|
|
12066
|
-
var
|
|
12089
|
+
var import_zod20 = require("zod");
|
|
12067
12090
|
var inputSchema19 = {
|
|
12068
|
-
id:
|
|
12091
|
+
id: import_zod20.z.string().min(1, "id is required").describe("The Vectros folder id to delete.")
|
|
12069
12092
|
};
|
|
12070
12093
|
var folderDelete = ({ client, log }) => ({
|
|
12071
12094
|
name: "folder_delete",
|
|
@@ -12115,7 +12138,7 @@ var currentIdentity = ({ log, apiKey, environment }) => ({
|
|
|
12115
12138
|
var current_identity_default = currentIdentity;
|
|
12116
12139
|
|
|
12117
12140
|
// src/tools/document_ingest.ts
|
|
12118
|
-
var
|
|
12141
|
+
var import_zod21 = require("zod");
|
|
12119
12142
|
var import_promises = require("fs/promises");
|
|
12120
12143
|
var import_node_path = require("path");
|
|
12121
12144
|
var IngestPathError = class extends Error {
|
|
@@ -12191,43 +12214,46 @@ function inferMimeType(filePath) {
|
|
|
12191
12214
|
return EXT_TO_MIME[ext] ?? "application/octet-stream";
|
|
12192
12215
|
}
|
|
12193
12216
|
var inputSchema21 = {
|
|
12194
|
-
title:
|
|
12195
|
-
indexMode:
|
|
12217
|
+
title: import_zod21.z.string().min(1, "title is required").describe("Human-readable document title \u2014 appears in search results and the UI."),
|
|
12218
|
+
indexMode: import_zod21.z.enum(["HYBRID", "SEMANTIC", "TEXT", "NONE"]).optional().describe(
|
|
12196
12219
|
"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."
|
|
12197
12220
|
),
|
|
12198
|
-
externalId:
|
|
12199
|
-
'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.'
|
|
12221
|
+
externalId: import_zod21.z.string().optional().describe(
|
|
12222
|
+
'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.'
|
|
12223
|
+
),
|
|
12224
|
+
upsert: import_zod21.z.boolean().optional().describe(
|
|
12225
|
+
"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)."
|
|
12200
12226
|
),
|
|
12201
|
-
|
|
12202
|
-
"
|
|
12227
|
+
schemaId: import_zod21.z.string().optional().describe(
|
|
12228
|
+
"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`)."
|
|
12203
12229
|
),
|
|
12204
|
-
|
|
12205
|
-
"
|
|
12230
|
+
confirmUntyped: import_zod21.z.boolean().optional().describe(
|
|
12231
|
+
"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."
|
|
12206
12232
|
),
|
|
12207
|
-
payload:
|
|
12233
|
+
payload: import_zod21.z.record(import_zod21.z.string(), import_zod21.z.unknown()).optional().describe(
|
|
12208
12234
|
"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."
|
|
12209
12235
|
),
|
|
12210
12236
|
// Inline text mode (mutually exclusive with filePath):
|
|
12211
|
-
text:
|
|
12212
|
-
storeText:
|
|
12237
|
+
text: import_zod21.z.string().min(1).optional().describe("Text body to ingest inline. Mutually exclusive with filePath. Either text or filePath is required."),
|
|
12238
|
+
storeText: import_zod21.z.boolean().optional().describe(
|
|
12213
12239
|
"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."
|
|
12214
12240
|
),
|
|
12215
12241
|
// File upload mode (mutually exclusive with text; stdio-transport-only):
|
|
12216
|
-
filePath:
|
|
12242
|
+
filePath: import_zod21.z.string().min(1).optional().describe(
|
|
12217
12243
|
"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."
|
|
12218
12244
|
),
|
|
12219
|
-
fileType:
|
|
12245
|
+
fileType: import_zod21.z.string().optional().describe('MIME type of the file (e.g. "application/pdf"). Inferred from filePath extension if omitted.'),
|
|
12220
12246
|
// Common (both modes):
|
|
12221
|
-
folderId:
|
|
12222
|
-
userId:
|
|
12223
|
-
scopes:
|
|
12247
|
+
folderId: import_zod21.z.string().optional().describe("Optional folder to ingest into. Default: tenant root."),
|
|
12248
|
+
userId: import_zod21.z.string().optional().describe("Owning user ID. Optional."),
|
|
12249
|
+
scopes: import_zod21.z.array(import_zod21.z.string()).optional().describe(
|
|
12224
12250
|
"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."
|
|
12225
12251
|
)
|
|
12226
12252
|
};
|
|
12227
12253
|
var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
12228
12254
|
name: "document_ingest",
|
|
12229
12255
|
title: "Ingest a new document (text body or file upload)",
|
|
12230
|
-
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
|
|
12256
|
+
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`.",
|
|
12231
12257
|
inputSchema: inputSchema21,
|
|
12232
12258
|
// Creates by default, idempotent ONLY when the caller supplies `externalId` (optional,
|
|
12233
12259
|
// per the doc comment above) — re-ingest then returns the existing document rather than
|
|
@@ -12245,6 +12271,7 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
12245
12271
|
const filePath = args.filePath;
|
|
12246
12272
|
const schemaId = args.schemaId;
|
|
12247
12273
|
const upsert = args.upsert;
|
|
12274
|
+
const confirmUntyped = args.confirmUntyped;
|
|
12248
12275
|
const indexMode = args.indexMode ?? (schemaId ? void 0 : "HYBRID");
|
|
12249
12276
|
if (!text && !filePath) {
|
|
12250
12277
|
return toolError(
|
|
@@ -12293,6 +12320,7 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
12293
12320
|
if (text) {
|
|
12294
12321
|
const result = await client.documents.ingestDocument({
|
|
12295
12322
|
upsert,
|
|
12323
|
+
confirmUntyped,
|
|
12296
12324
|
body: {
|
|
12297
12325
|
title,
|
|
12298
12326
|
text,
|
|
@@ -12333,6 +12361,7 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
12333
12361
|
const storeTextFile = args.storeText ?? true;
|
|
12334
12362
|
const upload = await client.documents.uploadDocument({
|
|
12335
12363
|
upsert,
|
|
12364
|
+
confirmUntyped,
|
|
12336
12365
|
fileName,
|
|
12337
12366
|
fileType,
|
|
12338
12367
|
indexMode,
|
|
@@ -12365,6 +12394,8 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
12365
12394
|
{ tool: "document_ingest", mode: "file", id: docId, fileName, fileType, bytes: bytes.length },
|
|
12366
12395
|
"document_ingest file ok"
|
|
12367
12396
|
);
|
|
12397
|
+
const uploadCreated = upload?.created;
|
|
12398
|
+
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.";
|
|
12368
12399
|
return {
|
|
12369
12400
|
content: [
|
|
12370
12401
|
{
|
|
@@ -12373,7 +12404,7 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
|
|
|
12373
12404
|
{
|
|
12374
12405
|
...upload,
|
|
12375
12406
|
indexStatus: "PENDING_INDEX",
|
|
12376
|
-
_note:
|
|
12407
|
+
_note: note
|
|
12377
12408
|
},
|
|
12378
12409
|
null,
|
|
12379
12410
|
2
|
|
@@ -12397,29 +12428,29 @@ function presignedUploadHeaders(response) {
|
|
|
12397
12428
|
}
|
|
12398
12429
|
|
|
12399
12430
|
// src/tools/lookup_principal.ts
|
|
12400
|
-
var
|
|
12431
|
+
var import_zod22 = require("zod");
|
|
12401
12432
|
var MCP_DEFAULT_LIMIT5 = 10;
|
|
12402
12433
|
var MCP_MAX_LIMIT5 = 100;
|
|
12403
12434
|
var inputSchema22 = {
|
|
12404
|
-
kind:
|
|
12435
|
+
kind: import_zod22.z.string().describe(
|
|
12405
12436
|
'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.'
|
|
12406
12437
|
),
|
|
12407
|
-
externalId:
|
|
12438
|
+
externalId: import_zod22.z.string().optional().describe(
|
|
12408
12439
|
"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."
|
|
12409
12440
|
),
|
|
12410
|
-
contextId:
|
|
12441
|
+
contextId: import_zod22.z.string().optional().describe(
|
|
12411
12442
|
"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."
|
|
12412
12443
|
),
|
|
12413
12444
|
// Lookup-mode args — provide `field` plus EXACTLY ONE of: value | from+to | prefix.
|
|
12414
|
-
type:
|
|
12415
|
-
field:
|
|
12416
|
-
value:
|
|
12417
|
-
from:
|
|
12418
|
-
to:
|
|
12419
|
-
prefix:
|
|
12420
|
-
order:
|
|
12421
|
-
startFrom:
|
|
12422
|
-
limit:
|
|
12445
|
+
type: import_zod22.z.string().optional().describe('Lookup mode: the identity schema\'s record type (e.g. "person_v1"). Required with `field`.'),
|
|
12446
|
+
field: import_zod22.z.string().optional().describe('Lookup mode: name of the schema-declared lookup field to query by (e.g. "email").'),
|
|
12447
|
+
value: import_zod22.z.string().optional().describe("Lookup mode (equality): exact-match value for `field`. Works on sensitive fields."),
|
|
12448
|
+
from: import_zod22.z.string().optional().describe("Lookup mode (range): inclusive lower bound; requires `to`. Non-sensitive fields only."),
|
|
12449
|
+
to: import_zod22.z.string().optional().describe("Lookup mode (range): inclusive upper bound; requires `from`."),
|
|
12450
|
+
prefix: import_zod22.z.string().optional().describe("Lookup mode (prefix): match values starting with this. Range-enabled string fields only."),
|
|
12451
|
+
order: import_zod22.z.enum(["asc", "desc"]).optional().describe("Lookup mode: sort direction by the looked-up field. `asc` (default) or `desc`."),
|
|
12452
|
+
startFrom: import_zod22.z.string().optional().describe("Lookup mode: pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next."),
|
|
12453
|
+
limit: import_zod22.z.number().int().min(1).max(MCP_MAX_LIMIT5).optional().describe(
|
|
12423
12454
|
`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\`.`
|
|
12424
12455
|
)
|
|
12425
12456
|
};
|
|
@@ -12503,11 +12534,11 @@ var lookupPrincipal = ({ client, log }) => ({
|
|
|
12503
12534
|
var lookup_principal_default = lookupPrincipal;
|
|
12504
12535
|
|
|
12505
12536
|
// src/tools/version_history.ts
|
|
12506
|
-
var
|
|
12537
|
+
var import_zod23 = require("zod");
|
|
12507
12538
|
var inputSchema23 = {
|
|
12508
|
-
resourceType:
|
|
12509
|
-
id:
|
|
12510
|
-
startFrom:
|
|
12539
|
+
resourceType: import_zod23.z.enum(["record", "document"]).describe("Which kind of entity the id refers to: a record or a document."),
|
|
12540
|
+
id: import_zod23.z.string().min(1, "id is required").describe("The Vectros id of the record or document whose history you want."),
|
|
12541
|
+
startFrom: import_zod23.z.string().optional().describe("Pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch older entries.")
|
|
12511
12542
|
};
|
|
12512
12543
|
var versionHistory = ({ client, log }) => ({
|
|
12513
12544
|
name: "version_history",
|
|
@@ -12631,7 +12662,7 @@ var ALL_RESOURCE_FACTORIES = {
|
|
|
12631
12662
|
};
|
|
12632
12663
|
|
|
12633
12664
|
// src/zod-to-json-schema.ts
|
|
12634
|
-
var
|
|
12665
|
+
var import_zod24 = require("zod");
|
|
12635
12666
|
function zodShapeToJsonSchema(shape) {
|
|
12636
12667
|
const properties = {};
|
|
12637
12668
|
const required = [];
|
|
@@ -12646,40 +12677,40 @@ function zodShapeToJsonSchema(shape) {
|
|
|
12646
12677
|
function zodTypeToJsonSchema(schema) {
|
|
12647
12678
|
const description = schema.description;
|
|
12648
12679
|
let current = schema;
|
|
12649
|
-
while (current instanceof
|
|
12680
|
+
while (current instanceof import_zod24.z.ZodOptional || current instanceof import_zod24.z.ZodDefault || current instanceof import_zod24.z.ZodNullable) {
|
|
12650
12681
|
current = current._def.innerType;
|
|
12651
12682
|
}
|
|
12652
12683
|
const base = description ? { description } : {};
|
|
12653
|
-
if (current instanceof
|
|
12684
|
+
if (current instanceof import_zod24.z.ZodString) {
|
|
12654
12685
|
return { ...base, type: "string" };
|
|
12655
12686
|
}
|
|
12656
|
-
if (current instanceof
|
|
12687
|
+
if (current instanceof import_zod24.z.ZodNumber) {
|
|
12657
12688
|
return { ...base, type: "number" };
|
|
12658
12689
|
}
|
|
12659
|
-
if (current instanceof
|
|
12690
|
+
if (current instanceof import_zod24.z.ZodBoolean) {
|
|
12660
12691
|
return { ...base, type: "boolean" };
|
|
12661
12692
|
}
|
|
12662
|
-
if (current instanceof
|
|
12693
|
+
if (current instanceof import_zod24.z.ZodEnum) {
|
|
12663
12694
|
return {
|
|
12664
12695
|
...base,
|
|
12665
12696
|
type: "string",
|
|
12666
12697
|
enum: current.options
|
|
12667
12698
|
};
|
|
12668
12699
|
}
|
|
12669
|
-
if (current instanceof
|
|
12700
|
+
if (current instanceof import_zod24.z.ZodArray) {
|
|
12670
12701
|
return {
|
|
12671
12702
|
...base,
|
|
12672
12703
|
type: "array",
|
|
12673
12704
|
items: zodTypeToJsonSchema(current.element)
|
|
12674
12705
|
};
|
|
12675
12706
|
}
|
|
12676
|
-
if (current instanceof
|
|
12707
|
+
if (current instanceof import_zod24.z.ZodObject) {
|
|
12677
12708
|
return {
|
|
12678
12709
|
...base,
|
|
12679
12710
|
...zodShapeToJsonSchema(current.shape)
|
|
12680
12711
|
};
|
|
12681
12712
|
}
|
|
12682
|
-
if (current instanceof
|
|
12713
|
+
if (current instanceof import_zod24.z.ZodRecord) {
|
|
12683
12714
|
const valueType = current._def.valueType;
|
|
12684
12715
|
return {
|
|
12685
12716
|
...base,
|
|
@@ -12808,7 +12839,7 @@ var VectrosMCPServer = class {
|
|
|
12808
12839
|
if (!tool) {
|
|
12809
12840
|
result = toolError(req.params.name ?? "unknown", new Error("No such tool."));
|
|
12810
12841
|
} else {
|
|
12811
|
-
const parsed =
|
|
12842
|
+
const parsed = import_zod25.z.object(tool.inputSchema).strict().safeParse(req.params.arguments ?? {});
|
|
12812
12843
|
if (!parsed.success) {
|
|
12813
12844
|
result = toolError(tool.name, new Error(formatArgError(tool, parsed.error)));
|
|
12814
12845
|
} else {
|