@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/dist/cli.mjs CHANGED
@@ -23,6 +23,7 @@ __export(api_exports, {
23
23
  ContentTooLargeError: () => ContentTooLargeError,
24
24
  DocumentContextEvent: () => DocumentContextEvent,
25
25
  DocumentLookupRequest: () => DocumentLookupRequest,
26
+ DocumentPatchRequest: () => DocumentPatchRequest,
26
27
  DocumentRequest: () => DocumentRequest,
27
28
  DocumentResponse: () => DocumentResponse,
28
29
  DoneEvent: () => DoneEvent,
@@ -366,6 +367,13 @@ var DocumentLookupRequest;
366
367
  Desc: "desc"
367
368
  };
368
369
  })(DocumentLookupRequest || (DocumentLookupRequest = {}));
370
+ var DocumentPatchRequest;
371
+ ((DocumentPatchRequest2) => {
372
+ DocumentPatchRequest2.Status = {
373
+ Active: "ACTIVE",
374
+ Archived: "ARCHIVED"
375
+ };
376
+ })(DocumentPatchRequest || (DocumentPatchRequest = {}));
369
377
  var FileUploadRequest;
370
378
  ((FileUploadRequest2) => {
371
379
  FileUploadRequest2.IndexMode = {
@@ -378,6 +386,7 @@ var FileUploadRequest;
378
386
  var documents_exports = {};
379
387
  __export(documents_exports, {
380
388
  DocumentLookupRequest: () => DocumentLookupRequest,
389
+ DocumentPatchRequest: () => DocumentPatchRequest,
381
390
  FileUploadRequest: () => FileUploadRequest,
382
391
  LookupDocumentsRequestOrder: () => LookupDocumentsRequestOrder
383
392
  });
@@ -2424,7 +2433,7 @@ var AuthClient = class {
2424
2433
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/auth/jwks");
2425
2434
  }
2426
2435
  /**
2427
- * 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. This is the disclosure-accounting surface from which a covered entity derives its HIPAA §164.528 accounting of disclosures. 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.
2436
+ * 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.
2428
2437
  *
2429
2438
  * @param {Vectros.GetAccessLogRequest} request
2430
2439
  * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -3042,6 +3051,7 @@ var AuthClient = class {
3042
3051
  * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
3043
3052
  *
3044
3053
  * @throws {@link Vectros.BadRequestError}
3054
+ * @throws {@link Vectros.PaymentRequiredError}
3045
3055
  * @throws {@link Vectros.ForbiddenError}
3046
3056
  * @throws {@link Vectros.TooManyRequestsError}
3047
3057
  *
@@ -3091,6 +3101,8 @@ var AuthClient = class {
3091
3101
  switch (_response.error.statusCode) {
3092
3102
  case 400:
3093
3103
  throw new BadRequestError(_response.error.body, _response.rawResponse);
3104
+ case 402:
3105
+ throw new PaymentRequiredError(_response.error.body, _response.rawResponse);
3094
3106
  case 403:
3095
3107
  throw new ForbiddenError(_response.error.body, _response.rawResponse);
3096
3108
  case 429:
@@ -4126,7 +4138,7 @@ var AuthClient = class {
4126
4138
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/auth/issuers/{issuerId}");
4127
4139
  }
4128
4140
  /**
4129
- * Updates the mutable fields of a registered issuer: `subClaim`, `emailClaim`, `userinfoUri`, `capturedClaims`, `restrictedToDomain` (a new non-blank value must already be a VERIFIED domain for your account; an empty string clears it back to domain-less; see `IssuerUpdateRequest.restrictedToDomain` for the full semantics), `status` (`active`/`suspended` — a registration awaiting verification (`pending_verification`) accepts no status change until it is verified; a suspended issuer's tokens are rejected identically to an unregistered issuer at exchange time), and `selfSignupPolicies`. Fields omitted from the body are left unchanged (partial update). `issuer`, `jwksUri`, `audience`, and `contextId` are trust-anchor / routing-pin fields and are immutable via this route — supplying a value that differs from the current registration is rejected with 400; supplying the current value back is a no-op. Rotating a trust anchor requires deleting and re-registering the issuer, which is itself refused while any user is bound through it. **`subClaim` is identity-determining, not merely cosmetic**: it names which verified JWT claim is read as the federated user's identifier, so changing it on an issuer that already has bound users would silently re-identify (or, under self-signup, orphan) every one of them — changing it is therefore refused once any user has bound through this issuer, the same guard `DELETE` already applies, and is only free before the first real login. Requires a root API key or the bootstrap's provisioning capability, gated identically to every other operation on this surface. A credential confined to one app context may only update an issuer registered in that context; naming one registered in another context returns 404, identically to a nonexistent issuerId. A root API key may update any issuer.
4141
+ * 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.
4130
4142
  *
4131
4143
  * @param {Vectros.IssuerUpdateRequest} request
4132
4144
  * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -4936,7 +4948,7 @@ var ComplianceClient = class {
4936
4948
  this._options = normalizeClientOptionsWithAuth(options);
4937
4949
  }
4938
4950
  /**
4939
- * 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 the subject's identity and lookup rows. 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.
4951
+ * 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.
4940
4952
  *
4941
4953
  * @param {Vectros.ErasureRequest} request
4942
4954
  * @param {ComplianceClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -4999,7 +5011,7 @@ var ComplianceClient = class {
4999
5011
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/erasure-requests");
5000
5012
  }
5001
5013
  /**
5002
- * 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 that were left intact). Requires a root API key.
5014
+ * 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.
5003
5015
  *
5004
5016
  * @param {Vectros.GetErasureRequestRequest} request
5005
5017
  * @param {ComplianceClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -5242,7 +5254,7 @@ var DocumentsClient = class {
5242
5254
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/documents");
5243
5255
  }
5244
5256
  /**
5245
- * 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.
5257
+ * 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.
5246
5258
  *
5247
5259
  * @param {Vectros.IngestDocumentRequest} request
5248
5260
  * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -5262,10 +5274,11 @@ var DocumentsClient = class {
5262
5274
  return HttpResponsePromise.fromPromise(this.__ingestDocument(request, requestOptions));
5263
5275
  }
5264
5276
  async __ingestDocument(request, requestOptions) {
5265
- const { upsert, allowClear, body: _body } = request;
5277
+ const { upsert, allowClear, confirmUntyped, body: _body } = request;
5266
5278
  const _queryParams = {
5267
5279
  upsert,
5268
- allowClear
5280
+ allowClear,
5281
+ confirmUntyped
5269
5282
  };
5270
5283
  const _authRequest = await this._options.authProvider.getAuthRequest();
5271
5284
  const _headers = mergeHeaders(
@@ -5500,7 +5513,7 @@ var DocumentsClient = class {
5500
5513
  /**
5501
5514
  * 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.
5502
5515
  *
5503
- * @param {Vectros.PatchDocumentRequest} request
5516
+ * @param {Vectros.DocumentPatchRequest} request
5504
5517
  * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
5505
5518
  *
5506
5519
  * @throws {@link Vectros.BadRequestError}
@@ -5511,17 +5524,14 @@ var DocumentsClient = class {
5511
5524
  *
5512
5525
  * @example
5513
5526
  * await client.documents.patchDocument({
5514
- * id: "id",
5515
- * body: {
5516
- * title: "Patient Intake Form \u2014 Jane Doe"
5517
- * }
5527
+ * id: "id"
5518
5528
  * })
5519
5529
  */
5520
5530
  patchDocument(request, requestOptions) {
5521
5531
  return HttpResponsePromise.fromPromise(this.__patchDocument(request, requestOptions));
5522
5532
  }
5523
5533
  async __patchDocument(request, requestOptions) {
5524
- const { id, body: _body } = request;
5534
+ const { id, ..._body } = request;
5525
5535
  const _authRequest = await this._options.authProvider.getAuthRequest();
5526
5536
  const _headers = mergeHeaders(
5527
5537
  _authRequest.headers,
@@ -5893,7 +5903,7 @@ var DocumentsClient = class {
5893
5903
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/documents/{id}/versions");
5894
5904
  }
5895
5905
  /**
5896
- * Starts a file-based document by returning a short-lived presigned S3 PUT URL. Upload the file bytes directly to `uploadUrl`; the document is then automatically queued for text extraction and asynchronous indexing. Supplying an `externalId` makes this idempotent — re-initiating an upload with the same `externalId` re-issues a fresh presigned URL for the SAME existing document, targeting a newly-staged object rather than the document's current one — your PUT lands there first, and the document only adopts it once the upload is validated (so a re-upload inherently replaces the file body) rather than creating a duplicate. The response's `created` field (and the HTTP status — 201 when a new document was minted, 200 when an existing one was matched) tells the two apart. With `?upsert=true`, the submitted `payload`/`title` are also applied to the matched document (file-body divergence cannot be diffed at upload-init — the bytes have not arrived yet — so the re-upload itself replaces the body). Creating a NEW document requires the `documents:c` scope. Re-uploading over an EXISTING document overwrites (and re-indexes) its body, so it is an update: it requires the `documents:u` scope (as does `?upsert=true` for the metadata). **Your PUT to `uploadUrl` MUST include the header named in the response's `requiredHeaderName`, set to `requiredHeaderValue` exactly.** It is a signed part of the presigned request — the PUT never reaches this service either way, so neither failure uses this API's JSON error shape. Omitting it, or sending a different value, invalidates the request's signature and S3 rejects it with a 403 `SignatureDoesNotMatch`. Sending it correctly makes the URL single-use: `requiredHeaderName` is always `If-None-Match` and `requiredHeaderValue` is always `*` — a create, a recovery upload for a document whose earlier file is missing, and a re-upload ALL target a freshly-minted, never-written key, so the same S3 conditional-write precondition applies uniformly (S3's own documented conditional-write behavior): a replay after the object already exists (from your own completed PUT, or anyone else's) fails with `412 Precondition Failed`; a replay after the object was deleted and never re-created finds an absent key again and can succeed — single-use is a property of the object's existence, not a one-time token. **Either precondition can also fail with `409 Conflict` if your PUT genuinely races a concurrent delete on the same object.** Whichever of `412` or `409` you receive, the remedy is the same: call this endpoint again for a fresh URL rather than retrying the same PUT — a fresh call always targets a new key, so it is never subject to whatever raced the previous one.
5906
+ * 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.
5897
5907
  *
5898
5908
  * @param {Vectros.FileUploadRequest} request
5899
5909
  * @param {DocumentsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -5912,9 +5922,10 @@ var DocumentsClient = class {
5912
5922
  return HttpResponsePromise.fromPromise(this.__uploadDocument(request, requestOptions));
5913
5923
  }
5914
5924
  async __uploadDocument(request, requestOptions) {
5915
- const { upsert, ..._body } = request;
5925
+ const { upsert, confirmUntyped, ..._body } = request;
5916
5926
  const _queryParams = {
5917
- upsert
5927
+ upsert,
5928
+ confirmUntyped
5918
5929
  };
5919
5930
  const _authRequest = await this._options.authProvider.getAuthRequest();
5920
5931
  const _headers = mergeHeaders(
@@ -7819,6 +7830,8 @@ var InferenceClient = class {
7819
7830
  throw new PaymentRequiredError(_response.error.body, _response.rawResponse);
7820
7831
  case 403:
7821
7832
  throw new ForbiddenError(_response.error.body, _response.rawResponse);
7833
+ case 413:
7834
+ throw new ContentTooLargeError(_response.error.body, _response.rawResponse);
7822
7835
  case 429:
7823
7836
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
7824
7837
  default:
@@ -7958,6 +7971,8 @@ var InferenceClient = class {
7958
7971
  throw new PaymentRequiredError(_response.error.body, _response.rawResponse);
7959
7972
  case 403:
7960
7973
  throw new ForbiddenError(_response.error.body, _response.rawResponse);
7974
+ case 413:
7975
+ throw new ContentTooLargeError(_response.error.body, _response.rawResponse);
7961
7976
  case 429:
7962
7977
  throw new TooManyRequestsError(_response.error.body, _response.rawResponse);
7963
7978
  case 500:
@@ -10215,7 +10230,7 @@ import {
10215
10230
  ListToolsRequestSchema,
10216
10231
  ReadResourceRequestSchema
10217
10232
  } from "@modelcontextprotocol/sdk/types.js";
10218
- import { z as z24 } from "zod";
10233
+ import { z as z25 } from "zod";
10219
10234
 
10220
10235
  // src/auth.ts
10221
10236
  var KEY_RE = /^(sk|ssk|st)_(live|test)_/;
@@ -10247,7 +10262,7 @@ function warnOnSuboptimalKey(key, log) {
10247
10262
  if (key.prefix === "sk") {
10248
10263
  log.warn(
10249
10264
  { prefix: key.prefix, env: key.env },
10250
- 'wildcard-scope key (sk_*) on a desktop MCP server is overly broad. For production, prefer a scoped ssk_* key bound to a narrowed AccessProfile. See the Vectros scoped-token documentation ("Recommended AccessProfile for MCP").'
10265
+ '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.'
10251
10266
  );
10252
10267
  } else if (key.prefix === "st") {
10253
10268
  log.warn(
@@ -10259,8 +10274,8 @@ function warnOnSuboptimalKey(key, log) {
10259
10274
 
10260
10275
  // src/build-info.ts
10261
10276
  var BUILD_INFO = {
10262
- mcpServer: true ? "0.17.2" : "dev",
10263
- sdk: true ? "0.45.0" : "dev"
10277
+ mcpServer: true ? "0.18.1" : "dev",
10278
+ sdk: true ? "0.47.0" : "dev"
10264
10279
  };
10265
10280
  function formatBuildInfo() {
10266
10281
  return `vectros-mcp-server ${BUILD_INFO.mcpServer} (sdk ${BUILD_INFO.sdk})`;
@@ -10555,7 +10570,7 @@ var inputSchema = {
10555
10570
  "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.)"
10556
10571
  ),
10557
10572
  limit: z.number().int().min(1).max(MCP_MAX_LIMIT).optional().describe(
10558
- `Max hits per page. Defaults to a low ${MCP_DEFAULT_LIMIT} to protect the agent context window; raise up to ${MCP_MAX_LIMIT} (the most a single search returns) in one call when you can accept the larger result, or page with \`offset\` instead.`
10573
+ `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.`
10559
10574
  ),
10560
10575
  offset: z.number().int().min(0).max(200).optional().describe("Skip the first N hits \u2014 for pagination (0\u2013200)."),
10561
10576
  folderId: z.string().optional().describe("Scope to content in this EXACT folder (Vectros folder id)."),
@@ -11304,52 +11319,65 @@ var recordDelete = ({ client, log }) => ({
11304
11319
  var record_delete_default = recordDelete;
11305
11320
 
11306
11321
  // src/tools/rag_ask.ts
11322
+ import { z as z10 } from "zod";
11323
+
11324
+ // src/tools/provider-alias.ts
11307
11325
  import { z as z9 } from "zod";
11326
+ var providerAliasInput = z9.string().min(1, "providerAlias must be non-empty when supplied").optional().describe(
11327
+ "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."
11328
+ );
11329
+
11330
+ // src/tools/rag_ask.ts
11308
11331
  var SEARCH_MCP_DEFAULT_LIMIT = 5;
11309
11332
  var SEARCH_MCP_MAX_LIMIT = 50;
11310
11333
  var inputSchema9 = {
11311
- query: z9.string().min(1, "query must be non-empty").describe("Question to ground against retrieved content."),
11312
- instructions: z9.string().optional().describe(
11334
+ query: z10.string().min(1, "query must be non-empty").describe("Question to ground against retrieved content."),
11335
+ instructions: z10.string().optional().describe(
11313
11336
  '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.'
11314
11337
  ),
11315
- model: z9.string().optional().describe(
11316
- "Inference model alias (e.g. claude-haiku-4-5, claude-sonnet-5, claude-opus-4-8). Default = tier-appropriate Haiku. See GET /v1/models for the catalog the calling key can reach."
11338
+ model: z10.string().optional().describe(
11339
+ "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."
11317
11340
  ),
11318
- search: z9.object({
11319
- mode: z9.enum(["HYBRID", "TEXT", "SEMANTIC"]).optional().describe("Retrieval mode. Default HYBRID."),
11320
- limit: z9.number().int().min(1).max(SEARCH_MCP_MAX_LIMIT).optional().describe(
11321
- `Passages to retrieve before generating (the grounding-corpus size). Default ${SEARCH_MCP_DEFAULT_LIMIT}; raise up to ${SEARCH_MCP_MAX_LIMIT} (the RAG search API max) for a broader corpus when the extra grounding is worth the larger prompt.`
11341
+ providerAlias: providerAliasInput,
11342
+ search: z10.object({
11343
+ mode: z10.enum(["HYBRID", "TEXT", "SEMANTIC"]).optional().describe("Retrieval mode. Default HYBRID."),
11344
+ limit: z10.number().int().min(1).max(SEARCH_MCP_MAX_LIMIT).optional().describe(
11345
+ `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.`
11322
11346
  ),
11323
11347
  // Retrieval scoping — parity with hybrid_search so an agent can ground the
11324
11348
  // answer on a specific owner / folder / type / metadata subset, not just the
11325
11349
  // whole-tenant corpus.
11326
- userId: z9.string().optional().describe("Restrict retrieval to content owned by this user (Vectros UUID)."),
11327
- scope: z9.string().optional().describe(
11350
+ userId: z10.string().optional().describe("Restrict retrieval to content owned by this user (Vectros UUID)."),
11351
+ scope: z10.string().optional().describe(
11328
11352
  '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.'
11329
11353
  ),
11330
- scopeFilters: z9.array(z9.string()).min(1, "scopeFilters must name at least one dimension when supplied").optional().describe(
11354
+ scopeFilters: z10.array(z10.string()).min(1, "scopeFilters must name at least one dimension when supplied").optional().describe(
11331
11355
  '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`.'
11332
11356
  ),
11333
- folderId: z9.string().optional().describe("Restrict retrieval to this exact folder."),
11334
- rootFolderId: z9.string().optional().describe("Restrict retrieval to this folder and all its descendants."),
11335
- typeName: z9.string().optional().describe("Restrict record retrieval to this schema type."),
11336
- contentTypes: z9.array(z9.enum(["documents", "records"])).optional().describe('Narrow retrieval to content types. ["documents"] or ["records"]; omit for both.'),
11337
- filters: z9.record(z9.unknown()).optional().describe(
11357
+ folderId: z10.string().optional().describe("Restrict retrieval to this exact folder."),
11358
+ rootFolderId: z10.string().optional().describe("Restrict retrieval to this folder and all its descendants."),
11359
+ typeName: z10.string().optional().describe("Restrict record retrieval to this schema type."),
11360
+ contentTypes: z10.array(z10.enum(["documents", "records"])).optional().describe('Narrow retrieval to content types. ["documents"] or ["records"]; omit for both.'),
11361
+ filters: z10.record(z10.unknown()).optional().describe(
11338
11362
  '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"}.'
11339
11363
  ),
11340
- createdAfter: z9.string().optional().describe(
11364
+ createdAfter: z10.string().optional().describe(
11341
11365
  "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."
11342
11366
  ),
11343
- createdBefore: z9.string().optional().describe("Same creation-time basis as createdAfter, bounding at/before this ISO 8601 UTC value."),
11344
- requireComplete: z9.boolean().optional().describe("Fail closed (503) on a degraded search backend instead of grounding on partial results. Default false.")
11367
+ createdBefore: z10.string().optional().describe("Same creation-time basis as createdAfter, bounding at/before this ISO 8601 UTC value."),
11368
+ requireComplete: z10.boolean().optional().describe("Fail closed (503) on a degraded search backend instead of grounding on partial results. Default false.")
11345
11369
  }).optional().describe("Retrieval params + scoping. Default mode HYBRID, limit " + SEARCH_MCP_DEFAULT_LIMIT + "."),
11346
- maxTokens: z9.number().int().min(1).optional().describe("Max output tokens."),
11347
- temperature: z9.number().min(0).max(1).optional().describe("Sampling temperature (0.0\u20131.0). Default 0.3 \u2014 lower favors deterministic, retrieval-grounded answers.")
11370
+ maxTokens: z10.number().int().min(1).optional().describe(
11371
+ "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."
11372
+ ),
11373
+ temperature: z10.number().min(0).max(1).optional().describe(
11374
+ "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."
11375
+ )
11348
11376
  };
11349
11377
  var ragAsk = ({ client, log }) => ({
11350
11378
  name: "rag_ask",
11351
11379
  title: "RAG ask (corpus-wide)",
11352
- description: "Ask a question grounded against your tenant's indexed content. Vectros performs a hybrid search, injects the top-K passages into the prompt, and streams a model answer back. Scope retrieval with `search` (ownership \u2014 `scope` for one ownership dimension or `scopeFilters` for several at once, e.g. one client within one org \u2014 folder, type, metadata filters, date window) to ground on a subset \u2014 e.g. one patient or one folder \u2014 and steer generation with `instructions` / `temperature`. The full answer is returned as a single response; progress notifications keep the call alive during the 30-45s generation window. Inference runs in-perimeter against AWS Bedrock \u2014 PHI never leaves the BAA boundary.",
11380
+ 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.",
11353
11381
  inputSchema: inputSchema9,
11354
11382
  // NOT a pure read: this call reserves an atomic hold against the caller's prepaid inference
11355
11383
  // balance before generation starts, then debits it on completion — a real financial side
@@ -11391,6 +11419,7 @@ var ragAsk = ({ client, log }) => ({
11391
11419
  query: args.query,
11392
11420
  instructions: args.instructions,
11393
11421
  model: args.model,
11422
+ providerAlias: args.providerAlias,
11394
11423
  search,
11395
11424
  maxTokens: args.maxTokens,
11396
11425
  temperature: args.temperature
@@ -11445,19 +11474,22 @@ var ragAsk = ({ client, log }) => ({
11445
11474
  var rag_ask_default = ragAsk;
11446
11475
 
11447
11476
  // src/tools/document_ask.ts
11448
- import { z as z10 } from "zod";
11477
+ import { z as z11 } from "zod";
11449
11478
  var inputSchema10 = {
11450
- documentId: z10.string().min(1, "documentId is required").describe("ID of the document to ask against."),
11451
- prompt: z10.string().min(1, "prompt is required").describe("Question to ask about the document."),
11452
- model: z10.string().optional().describe(
11453
- "Inference model alias. Default = tier-appropriate Haiku. See GET /v1/models for the catalog the calling key can reach."
11479
+ documentId: z11.string().min(1, "documentId is required").describe("ID of the document to ask against."),
11480
+ prompt: z11.string().min(1, "prompt is required").describe("Question to ask about the document."),
11481
+ model: z11.string().optional().describe(
11482
+ "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."
11454
11483
  ),
11455
- maxTokens: z10.number().int().min(1).optional().describe("Max output tokens.")
11484
+ providerAlias: providerAliasInput,
11485
+ maxTokens: z11.number().int().min(1).optional().describe(
11486
+ "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."
11487
+ )
11456
11488
  };
11457
11489
  var documentAsk = ({ client, log }) => ({
11458
11490
  name: "document_ask",
11459
11491
  title: "Document ask (single-document)",
11460
- description: "Ask a question against a single indexed document. Returns a grounded answer with the document context that informed it. For documents exceeding the input-token cap, the API returns a structured 413 with `estimatedTokens` and `limitTokens`. Inference runs in-perimeter against AWS Bedrock \u2014 PHI never leaves the BAA boundary.",
11492
+ 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.",
11461
11493
  inputSchema: inputSchema10,
11462
11494
  // NOT a pure read: this call reserves an atomic hold against the caller's prepaid inference
11463
11495
  // balance before generation starts, then debits it on completion — a real financial side
@@ -11474,6 +11506,7 @@ var documentAsk = ({ client, log }) => ({
11474
11506
  id: args.documentId,
11475
11507
  prompt: args.prompt,
11476
11508
  model: args.model,
11509
+ providerAlias: args.providerAlias,
11477
11510
  maxTokens: args.maxTokens
11478
11511
  });
11479
11512
  const progressToken = extra._meta?.progressToken;
@@ -11526,18 +11559,18 @@ var documentAsk = ({ client, log }) => ({
11526
11559
  var document_ask_default = documentAsk;
11527
11560
 
11528
11561
  // src/tools/list_schemas.ts
11529
- import { z as z11 } from "zod";
11562
+ import { z as z12 } from "zod";
11530
11563
  var inputSchema11 = {
11531
- userId: z11.string().optional().describe(
11564
+ userId: z12.string().optional().describe(
11532
11565
  "Filter to schemas visible to a specific user. Optional; default returns all schemas the credential can see."
11533
11566
  ),
11534
- scope: z11.string().optional().describe(
11567
+ scope: z12.string().optional().describe(
11535
11568
  '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.'
11536
11569
  ),
11537
- surface: z11.enum(["record", "document", "user", "entity"]).optional().describe(
11570
+ surface: z12.enum(["record", "document", "user", "entity"]).optional().describe(
11538
11571
  "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."
11539
11572
  ),
11540
- recordType: z11.string().optional().describe(
11573
+ recordType: z12.string().optional().describe(
11541
11574
  '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.'
11542
11575
  )
11543
11576
  };
@@ -11573,19 +11606,19 @@ var listSchemas = ({ client, log }) => ({
11573
11606
  var list_schemas_default = listSchemas;
11574
11607
 
11575
11608
  // src/tools/document_get.ts
11576
- import { z as z12 } from "zod";
11609
+ import { z as z13 } from "zod";
11577
11610
  var MAX_TEXT_CHARS = 32e3;
11578
11611
  var inputSchema12 = {
11579
- documentId: z12.string().optional().describe("The document ID returned by document_ingest or hybrid_search. Provide this OR externalId+type."),
11580
- externalId: z12.string().optional().describe(
11612
+ documentId: z13.string().optional().describe("The document ID returned by document_ingest or hybrid_search. Provide this OR externalId+type."),
11613
+ externalId: z13.string().optional().describe(
11581
11614
  "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."
11582
11615
  ),
11583
- type: z12.string().optional().describe("Document type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
11584
- includeText: z12.boolean().optional().describe(
11616
+ type: z13.string().optional().describe("Document type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
11617
+ includeText: z13.boolean().optional().describe(
11585
11618
  "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."
11586
11619
  ),
11587
- includeDownloadUrl: z12.boolean().optional().describe(
11588
- "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."
11620
+ includeDownloadUrl: z13.boolean().optional().describe(
11621
+ "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."
11589
11622
  )
11590
11623
  };
11591
11624
  function truncateText(text) {
@@ -11668,28 +11701,28 @@ var documentGet = ({ client, log }) => ({
11668
11701
  var document_get_default = documentGet;
11669
11702
 
11670
11703
  // src/tools/document_query.ts
11671
- import { z as z13 } from "zod";
11704
+ import { z as z14 } from "zod";
11672
11705
  var MCP_DEFAULT_LIMIT3 = 3;
11673
11706
  var MCP_MAX_LIMIT3 = 100;
11674
11707
  var inputSchema13 = {
11675
11708
  // Lookup-mode args — provide `field` plus EXACTLY ONE of: value | from+to | prefix.
11676
- field: z13.string().optional().describe("Lookup mode: name of the lookup-indexed field to query by."),
11677
- value: z13.string().optional().describe("Lookup mode (equality): exact-match value for `field`. Works on sensitive fields too."),
11678
- from: z13.string().optional().describe("Lookup mode (range): inclusive lower bound; requires `to`. Range-enabled, non-sensitive fields only."),
11679
- to: z13.string().optional().describe("Lookup mode (range): inclusive upper bound; requires `from`."),
11680
- prefix: z13.string().optional().describe("Lookup mode (prefix): match values starting with this. Range-enabled string fields only."),
11681
- order: z13.enum(["asc", "desc"]).optional().describe(
11709
+ field: z14.string().optional().describe("Lookup mode: name of the lookup-indexed field to query by."),
11710
+ value: z14.string().optional().describe("Lookup mode (equality): exact-match value for `field`. Works on sensitive fields too."),
11711
+ from: z14.string().optional().describe("Lookup mode (range): inclusive lower bound; requires `to`. Range-enabled, non-sensitive fields only."),
11712
+ to: z14.string().optional().describe("Lookup mode (range): inclusive upper bound; requires `from`."),
11713
+ prefix: z14.string().optional().describe("Lookup mode (prefix): match values starting with this. Range-enabled string fields only."),
11714
+ order: z14.enum(["asc", "desc"]).optional().describe(
11682
11715
  "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."
11683
11716
  ),
11684
- type: z13.string().optional().describe("Lookup mode: the document type (the bound schema's type). Required with `field`."),
11717
+ type: z14.string().optional().describe("Lookup mode: the document type (the bound schema's type). Required with `field`."),
11685
11718
  // List-mode args:
11686
- folderId: z13.string().optional().describe("List mode: only documents in this folder (Vectros folder id)."),
11687
- userId: z13.string().optional().describe("List mode: scope to documents owned by this user."),
11688
- scope: z13.string().optional().describe(
11719
+ folderId: z14.string().optional().describe("List mode: only documents in this folder (Vectros folder id)."),
11720
+ userId: z14.string().optional().describe("List mode: scope to documents owned by this user."),
11721
+ scope: z14.string().optional().describe(
11689
11722
  '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.'
11690
11723
  ),
11691
- startFrom: z13.string().optional().describe("Pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next. Works in both list and lookup mode."),
11692
- limit: z13.number().int().min(1).max(MCP_MAX_LIMIT3).optional().describe(
11724
+ startFrom: z14.string().optional().describe("Pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next. Works in both list and lookup mode."),
11725
+ limit: z14.number().int().min(1).max(MCP_MAX_LIMIT3).optional().describe(
11693
11726
  `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.`
11694
11727
  )
11695
11728
  };
@@ -11779,29 +11812,29 @@ var documentQuery = ({ client, log }) => ({
11779
11812
  var document_query_default = documentQuery;
11780
11813
 
11781
11814
  // src/tools/document_update.ts
11782
- import { z as z14 } from "zod";
11815
+ import { z as z15 } from "zod";
11783
11816
  var inputSchema14 = {
11784
- documentId: z14.string().optional().describe("The Vectros document id to update. Provide this OR externalId+type."),
11785
- externalId: z14.string().optional().describe(
11817
+ documentId: z15.string().optional().describe("The Vectros document id to update. Provide this OR externalId+type."),
11818
+ externalId: z15.string().optional().describe(
11786
11819
  "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."
11787
11820
  ),
11788
- type: z14.string().optional().describe("Document type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
11789
- title: z14.string().optional().describe("New title. Omit to keep the current title."),
11790
- fields: z14.record(z14.string(), z14.unknown()).optional().describe(
11821
+ type: z15.string().optional().describe("Document type \u2014 REQUIRED when selecting by `externalId` (externalId is unique within a type)."),
11822
+ title: z15.string().optional().describe("New title. Omit to keep the current title."),
11823
+ fields: z15.record(z15.string(), z15.unknown()).optional().describe(
11791
11824
  "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."
11792
11825
  ),
11793
- text: z14.string().optional().describe(
11826
+ text: z15.string().optional().describe(
11794
11827
  "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."
11795
11828
  ),
11796
- folderId: z14.string().optional().describe("Move the document into this folder (cannot be cleared once set)."),
11797
- status: z14.enum(["ACTIVE", "ARCHIVED"]).optional().describe(
11829
+ folderId: z15.string().optional().describe("Move the document into this folder (cannot be cleared once set)."),
11830
+ status: z15.enum(["ACTIVE", "ARCHIVED"]).optional().describe(
11798
11831
  "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."
11799
11832
  ),
11800
- userId: z14.string().optional().describe("Reassign the owning user (Vectros UUID)."),
11801
- scopes: z14.array(z14.string()).optional().describe(
11833
+ userId: z15.string().optional().describe("Reassign the owning user (Vectros UUID)."),
11834
+ scopes: z15.array(z15.string()).optional().describe(
11802
11835
  '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).'
11803
11836
  ),
11804
- expectedVersion: z14.number().int().optional().describe(
11837
+ expectedVersion: z15.number().int().optional().describe(
11805
11838
  "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."
11806
11839
  )
11807
11840
  };
@@ -11829,18 +11862,18 @@ var documentUpdate = ({ client, log }) => ({
11829
11862
  try {
11830
11863
  const resolved = await resolveDocumentIdByExternalId(client, { id: documentId, externalId, type });
11831
11864
  if ("error" in resolved) return toolError("document_update", new Error(resolved.error));
11832
- const body = {};
11833
- if (title !== void 0) body.title = title;
11834
- if (fields !== void 0) body.payload = fields;
11835
- if (text !== void 0) body.text = text;
11836
- if (folderId !== void 0) body.folderId = folderId;
11837
- if (status !== void 0) body.status = status;
11838
- if (userId !== void 0) body.userId = userId;
11839
- if (scopes !== void 0) body.scopes = scopes;
11840
- if (expectedVersion !== void 0) body.expectedVersion = expectedVersion;
11865
+ const patch = {};
11866
+ if (title !== void 0) patch.title = title;
11867
+ if (fields !== void 0) patch.payload = fields;
11868
+ if (text !== void 0) patch.text = text;
11869
+ if (folderId !== void 0) patch.folderId = folderId;
11870
+ if (status !== void 0) patch.status = status;
11871
+ if (userId !== void 0) patch.userId = userId;
11872
+ if (scopes !== void 0) patch.scopes = scopes;
11873
+ if (expectedVersion !== void 0) patch.expectedVersion = expectedVersion;
11841
11874
  const updated = await client.documents.patchDocument({
11842
11875
  id: resolved.id,
11843
- body
11876
+ ...patch
11844
11877
  });
11845
11878
  log.debug({ tool: "document_update", documentId: resolved.id, externalId }, "document_update ok");
11846
11879
  return { content: [{ type: "text", text: JSON.stringify(updated, null, 2) }] };
@@ -11853,9 +11886,9 @@ var documentUpdate = ({ client, log }) => ({
11853
11886
  var document_update_default = documentUpdate;
11854
11887
 
11855
11888
  // src/tools/document_delete.ts
11856
- import { z as z15 } from "zod";
11889
+ import { z as z16 } from "zod";
11857
11890
  var inputSchema15 = {
11858
- documentId: z15.string().min(1, "documentId is required").describe("The Vectros document id to delete.")
11891
+ documentId: z16.string().min(1, "documentId is required").describe("The Vectros document id to delete.")
11859
11892
  };
11860
11893
  var documentDelete = ({ client, log }) => ({
11861
11894
  name: "document_delete",
@@ -11882,18 +11915,18 @@ var documentDelete = ({ client, log }) => ({
11882
11915
  var document_delete_default = documentDelete;
11883
11916
 
11884
11917
  // src/tools/folder_query.ts
11885
- import { z as z16 } from "zod";
11918
+ import { z as z17 } from "zod";
11886
11919
  var MCP_DEFAULT_LIMIT4 = 10;
11887
11920
  var MCP_MAX_LIMIT4 = 100;
11888
11921
  var inputSchema16 = {
11889
- id: z16.string().optional().describe("Get mode: fetch this single folder by id."),
11890
- parentId: z16.string().optional().describe("List mode: direct children of this folder (tree navigation). Omit for a flat tenant list."),
11891
- userId: z16.string().optional().describe("List mode: scope to folders owned by this user."),
11892
- scope: z16.string().optional().describe(
11922
+ id: z17.string().optional().describe("Get mode: fetch this single folder by id."),
11923
+ parentId: z17.string().optional().describe("List mode: direct children of this folder (tree navigation). Omit for a flat tenant list."),
11924
+ userId: z17.string().optional().describe("List mode: scope to folders owned by this user."),
11925
+ scope: z17.string().optional().describe(
11893
11926
  '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.'
11894
11927
  ),
11895
- startFrom: z16.string().optional().describe("List mode: pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next."),
11896
- limit: z16.number().int().min(1).max(MCP_MAX_LIMIT4).optional().describe(
11928
+ startFrom: z17.string().optional().describe("List mode: pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next."),
11929
+ limit: z17.number().int().min(1).max(MCP_MAX_LIMIT4).optional().describe(
11897
11930
  `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\`.`
11898
11931
  )
11899
11932
  };
@@ -11933,16 +11966,16 @@ var folderQuery = ({ client, log }) => ({
11933
11966
  var folder_query_default = folderQuery;
11934
11967
 
11935
11968
  // src/tools/folder_create.ts
11936
- import { z as z17 } from "zod";
11969
+ import { z as z18 } from "zod";
11937
11970
  var inputSchema17 = {
11938
- name: z17.string().min(1, "name is required").describe("Folder display name."),
11939
- description: z17.string().optional().describe("Optional description of the folder's purpose."),
11940
- parentId: z17.string().optional().describe("Parent folder id \u2014 places the folder under this parent. Omit for the context default root. Create-only."),
11941
- slug: z17.string().optional().describe(
11971
+ name: z18.string().min(1, "name is required").describe("Folder display name."),
11972
+ description: z18.string().optional().describe("Optional description of the folder's purpose."),
11973
+ parentId: z18.string().optional().describe("Parent folder id \u2014 places the folder under this parent. Omit for the context default root. Create-only."),
11974
+ slug: z18.string().optional().describe(
11942
11975
  "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."
11943
11976
  ),
11944
- userId: z17.string().optional().describe("Owning user (Vectros UUID)."),
11945
- scopes: z17.array(z17.string()).optional().describe(
11977
+ userId: z18.string().optional().describe("Owning user (Vectros UUID)."),
11978
+ scopes: z18.array(z18.string()).optional().describe(
11946
11979
  '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.'
11947
11980
  )
11948
11981
  };
@@ -11984,16 +12017,16 @@ var folderCreate = ({ client, log }) => ({
11984
12017
  var folder_create_default = folderCreate;
11985
12018
 
11986
12019
  // src/tools/folder_update.ts
11987
- import { z as z18 } from "zod";
12020
+ import { z as z19 } from "zod";
11988
12021
  var inputSchema18 = {
11989
- id: z18.string().min(1, "id is required").describe("The Vectros folder id to update."),
11990
- name: z18.string().optional().describe("New folder name. Omit to keep the current name."),
11991
- description: z18.string().optional().describe("New description. Omit to leave unchanged."),
11992
- userId: z18.string().optional().describe("Reassign the owning user (Vectros UUID)."),
11993
- scopes: z18.array(z18.string()).optional().describe(
12022
+ id: z19.string().min(1, "id is required").describe("The Vectros folder id to update."),
12023
+ name: z19.string().optional().describe("New folder name. Omit to keep the current name."),
12024
+ description: z19.string().optional().describe("New description. Omit to leave unchanged."),
12025
+ userId: z19.string().optional().describe("Reassign the owning user (Vectros UUID)."),
12026
+ scopes: z19.array(z19.string()).optional().describe(
11994
12027
  '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).'
11995
12028
  ),
11996
- expectedVersion: z18.number().int().optional().describe(
12029
+ expectedVersion: z19.number().int().optional().describe(
11997
12030
  "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."
11998
12031
  )
11999
12032
  };
@@ -12032,14 +12065,14 @@ var folderUpdate = ({ client, log }) => ({
12032
12065
  var folder_update_default = folderUpdate;
12033
12066
 
12034
12067
  // src/tools/folder_delete.ts
12035
- import { z as z19 } from "zod";
12068
+ import { z as z20 } from "zod";
12036
12069
  var inputSchema19 = {
12037
- id: z19.string().min(1, "id is required").describe("The Vectros folder id to delete.")
12070
+ id: z20.string().min(1, "id is required").describe("The Vectros folder id to delete.")
12038
12071
  };
12039
12072
  var folderDelete = ({ client, log }) => ({
12040
12073
  name: "folder_delete",
12041
12074
  title: "Delete a folder",
12042
- description: 'Permanently delete a folder by id. The folder must be EMPTY first \u2014 it must contain no documents, no records, and no sub-folders \u2014 and a non-empty folder is refused, which is the most common way this call fails. Use record_query with this folderId, and document_query, to see what is in it. Clearing it differs by content type: a document can be moved out (document_update with a different folderId) or deleted. A RECORD can also be re-filed into another folder \u2014 the API supports it \u2014 but THIS SERVER does not expose that yet: record_update has no folderId argument, so from here your only option is record_delete (needs records:d). Do NOT read that as "the record cannot be moved" and delete partner data on that basis: if the record should be kept, move it with the Vectros API/SDK directly rather than deleting it here. A sub-folder cannot be re-parented at all, so nested folders have to be emptied and deleted innermost-first. Note the emptiness check counts everything in the folder, INCLUDING items your credential cannot read \u2014 so a refusal you cannot account for from what you can list is expected behaviour, not a bug, and retrying will not clear it. Requires the key to allow folders:d \u2014 a key without it gets a permission error. Protected folders (e.g. a context root) cannot be deleted at all, however empty.',
12075
+ 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.',
12043
12076
  inputSchema: inputSchema19,
12044
12077
  // Deletes. Idempotent in the standard REST sense: the end state ("this id no longer
12045
12078
  // resolves") is the same whether this is the first delete or a repeat of one.
@@ -12084,7 +12117,7 @@ var currentIdentity = ({ log, apiKey, environment }) => ({
12084
12117
  var current_identity_default = currentIdentity;
12085
12118
 
12086
12119
  // src/tools/document_ingest.ts
12087
- import { z as z20 } from "zod";
12120
+ import { z as z21 } from "zod";
12088
12121
  import { readFile, realpath } from "fs/promises";
12089
12122
  import { basename, extname, resolve, relative, isAbsolute } from "path";
12090
12123
  var IngestPathError = class extends Error {
@@ -12160,43 +12193,46 @@ function inferMimeType(filePath) {
12160
12193
  return EXT_TO_MIME[ext] ?? "application/octet-stream";
12161
12194
  }
12162
12195
  var inputSchema21 = {
12163
- title: z20.string().min(1, "title is required").describe("Human-readable document title \u2014 appears in search results and the UI."),
12164
- indexMode: z20.enum(["HYBRID", "SEMANTIC", "TEXT", "NONE"]).optional().describe(
12196
+ title: z21.string().min(1, "title is required").describe("Human-readable document title \u2014 appears in search results and the UI."),
12197
+ indexMode: z21.enum(["HYBRID", "SEMANTIC", "TEXT", "NONE"]).optional().describe(
12165
12198
  "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."
12166
12199
  ),
12167
- externalId: z20.string().optional().describe(
12168
- '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.'
12200
+ externalId: z21.string().optional().describe(
12201
+ '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.'
12169
12202
  ),
12170
- upsert: z20.boolean().optional().describe(
12171
- "When true, re-ingesting an existing externalId OVERWRITES that document and re-indexes the new body (text mode) / re-uploads and re-indexes the new file (file mode), instead of returning the existing one unchanged. This is the curation/re-sync primitive: edit a source, re-ingest with upsert:true, and the search index reflects the new content. Requires the documents:u scope. IMPORTANT: pass the SAME schemaId (and type) you used originally \u2014 externalId is unique WITHIN a type, so omitting schemaId resolves in the untyped namespace and mints a duplicate instead of updating. The response `created` flag confirms which happened (created:true = a new document was minted)."
12203
+ upsert: z21.boolean().optional().describe(
12204
+ "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)."
12172
12205
  ),
12173
- schemaId: z20.string().optional().describe(
12174
- "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."
12206
+ schemaId: z21.string().optional().describe(
12207
+ "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`)."
12175
12208
  ),
12176
- payload: z20.record(z20.string(), z20.unknown()).optional().describe(
12209
+ confirmUntyped: z21.boolean().optional().describe(
12210
+ "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."
12211
+ ),
12212
+ payload: z21.record(z21.string(), z21.unknown()).optional().describe(
12177
12213
  "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."
12178
12214
  ),
12179
12215
  // Inline text mode (mutually exclusive with filePath):
12180
- text: z20.string().min(1).optional().describe("Text body to ingest inline. Mutually exclusive with filePath. Either text or filePath is required."),
12181
- storeText: z20.boolean().optional().describe(
12216
+ text: z21.string().min(1).optional().describe("Text body to ingest inline. Mutually exclusive with filePath. Either text or filePath is required."),
12217
+ storeText: z21.boolean().optional().describe(
12182
12218
  "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."
12183
12219
  ),
12184
12220
  // File upload mode (mutually exclusive with text; stdio-transport-only):
12185
- filePath: z20.string().min(1).optional().describe(
12221
+ filePath: z21.string().min(1).optional().describe(
12186
12222
  "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."
12187
12223
  ),
12188
- fileType: z20.string().optional().describe('MIME type of the file (e.g. "application/pdf"). Inferred from filePath extension if omitted.'),
12224
+ fileType: z21.string().optional().describe('MIME type of the file (e.g. "application/pdf"). Inferred from filePath extension if omitted.'),
12189
12225
  // Common (both modes):
12190
- folderId: z20.string().optional().describe("Optional folder to ingest into. Default: tenant root."),
12191
- userId: z20.string().optional().describe("Owning user ID. Optional."),
12192
- scopes: z20.array(z20.string()).optional().describe(
12226
+ folderId: z21.string().optional().describe("Optional folder to ingest into. Default: tenant root."),
12227
+ userId: z21.string().optional().describe("Owning user ID. Optional."),
12228
+ scopes: z21.array(z21.string()).optional().describe(
12193
12229
  "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."
12194
12230
  )
12195
12231
  };
12196
12232
  var documentIngest = ({ client, log, transport, ingestRoot }) => ({
12197
12233
  name: "document_ingest",
12198
12234
  title: "Ingest a new document (text body or file upload)",
12199
- description: "Create a new document in your Vectros tenant. Two modes:\n \u2022 Text mode: pass `text` (string body). Single-call. Use for crawled content, notes, generated text.\n \u2022 File mode: pass `filePath` (local path on the MCP server's host machine). STDIO-TRANSPORT ONLY \u2014 rejected on HTTP transport. MCP server reads the bytes, requests a presigned upload URL, and PUTs them. Returns when the upload is accepted (indexStatus: PENDING_INDEX); poll with `document_get` until indexStatus is INDEXED.\nEither `text` or `filePath` must be present; both is an error. Idempotent by `externalId` (re-ingest returns the existing document, not a duplicate \u2014 requires documents:r in addition to documents:c, since being handed the existing document is a read of it). To UPDATE an existing document instead \u2014 re-index an edited body \u2014 pass `upsert:true` with the same `externalId` (and the same `schemaId`); this is the re-sync primitive for keeping a knowledge base current. Pass `schemaId` + `payload` for a typed, lookup-queryable document (records parity). indexMode defaults to HYBRID for untyped documents (omit to inherit a bound schema's default). storeText is a FILE-MODE knob (default true): false discards the uploaded file's extracted text after indexing (search + file download keep working; text retrieval and document_ask do not). Text-mode bodies are always retained, so storeText is not accepted with `text`.",
12235
+ 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`.",
12200
12236
  inputSchema: inputSchema21,
12201
12237
  // Creates by default, idempotent ONLY when the caller supplies `externalId` (optional,
12202
12238
  // per the doc comment above) — re-ingest then returns the existing document rather than
@@ -12214,6 +12250,7 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
12214
12250
  const filePath = args.filePath;
12215
12251
  const schemaId = args.schemaId;
12216
12252
  const upsert = args.upsert;
12253
+ const confirmUntyped = args.confirmUntyped;
12217
12254
  const indexMode = args.indexMode ?? (schemaId ? void 0 : "HYBRID");
12218
12255
  if (!text && !filePath) {
12219
12256
  return toolError(
@@ -12262,6 +12299,7 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
12262
12299
  if (text) {
12263
12300
  const result = await client.documents.ingestDocument({
12264
12301
  upsert,
12302
+ confirmUntyped,
12265
12303
  body: {
12266
12304
  title,
12267
12305
  text,
@@ -12302,6 +12340,7 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
12302
12340
  const storeTextFile = args.storeText ?? true;
12303
12341
  const upload = await client.documents.uploadDocument({
12304
12342
  upsert,
12343
+ confirmUntyped,
12305
12344
  fileName,
12306
12345
  fileType,
12307
12346
  indexMode,
@@ -12334,6 +12373,8 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
12334
12373
  { tool: "document_ingest", mode: "file", id: docId, fileName, fileType, bytes: bytes.length },
12335
12374
  "document_ingest file ok"
12336
12375
  );
12376
+ const uploadCreated = upload?.created;
12377
+ 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.";
12337
12378
  return {
12338
12379
  content: [
12339
12380
  {
@@ -12342,7 +12383,7 @@ var documentIngest = ({ client, log, transport, ingestRoot }) => ({
12342
12383
  {
12343
12384
  ...upload,
12344
12385
  indexStatus: "PENDING_INDEX",
12345
- _note: "File uploaded; indexing is asynchronous. Poll document_get(id) until indexStatus is INDEXED."
12386
+ _note: note
12346
12387
  },
12347
12388
  null,
12348
12389
  2
@@ -12366,29 +12407,29 @@ function presignedUploadHeaders(response) {
12366
12407
  }
12367
12408
 
12368
12409
  // src/tools/lookup_principal.ts
12369
- import { z as z21 } from "zod";
12410
+ import { z as z22 } from "zod";
12370
12411
  var MCP_DEFAULT_LIMIT5 = 10;
12371
12412
  var MCP_MAX_LIMIT5 = 100;
12372
12413
  var inputSchema22 = {
12373
- kind: z21.string().describe(
12414
+ kind: z22.string().describe(
12374
12415
  '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.'
12375
12416
  ),
12376
- externalId: z21.string().optional().describe(
12417
+ externalId: z22.string().optional().describe(
12377
12418
  "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."
12378
12419
  ),
12379
- contextId: z21.string().optional().describe(
12420
+ contextId: z22.string().optional().describe(
12380
12421
  "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."
12381
12422
  ),
12382
12423
  // Lookup-mode args — provide `field` plus EXACTLY ONE of: value | from+to | prefix.
12383
- type: z21.string().optional().describe('Lookup mode: the identity schema\'s record type (e.g. "person_v1"). Required with `field`.'),
12384
- field: z21.string().optional().describe('Lookup mode: name of the schema-declared lookup field to query by (e.g. "email").'),
12385
- value: z21.string().optional().describe("Lookup mode (equality): exact-match value for `field`. Works on sensitive fields."),
12386
- from: z21.string().optional().describe("Lookup mode (range): inclusive lower bound; requires `to`. Non-sensitive fields only."),
12387
- to: z21.string().optional().describe("Lookup mode (range): inclusive upper bound; requires `from`."),
12388
- prefix: z21.string().optional().describe("Lookup mode (prefix): match values starting with this. Range-enabled string fields only."),
12389
- order: z21.enum(["asc", "desc"]).optional().describe("Lookup mode: sort direction by the looked-up field. `asc` (default) or `desc`."),
12390
- startFrom: z21.string().optional().describe("Lookup mode: pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next."),
12391
- limit: z21.number().int().min(1).max(MCP_MAX_LIMIT5).optional().describe(
12424
+ type: z22.string().optional().describe('Lookup mode: the identity schema\'s record type (e.g. "person_v1"). Required with `field`.'),
12425
+ field: z22.string().optional().describe('Lookup mode: name of the schema-declared lookup field to query by (e.g. "email").'),
12426
+ value: z22.string().optional().describe("Lookup mode (equality): exact-match value for `field`. Works on sensitive fields."),
12427
+ from: z22.string().optional().describe("Lookup mode (range): inclusive lower bound; requires `to`. Non-sensitive fields only."),
12428
+ to: z22.string().optional().describe("Lookup mode (range): inclusive upper bound; requires `from`."),
12429
+ prefix: z22.string().optional().describe("Lookup mode (prefix): match values starting with this. Range-enabled string fields only."),
12430
+ order: z22.enum(["asc", "desc"]).optional().describe("Lookup mode: sort direction by the looked-up field. `asc` (default) or `desc`."),
12431
+ startFrom: z22.string().optional().describe("Lookup mode: pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch the next."),
12432
+ limit: z22.number().int().min(1).max(MCP_MAX_LIMIT5).optional().describe(
12392
12433
  `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\`.`
12393
12434
  )
12394
12435
  };
@@ -12472,11 +12513,11 @@ var lookupPrincipal = ({ client, log }) => ({
12472
12513
  var lookup_principal_default = lookupPrincipal;
12473
12514
 
12474
12515
  // src/tools/version_history.ts
12475
- import { z as z22 } from "zod";
12516
+ import { z as z23 } from "zod";
12476
12517
  var inputSchema23 = {
12477
- resourceType: z22.enum(["record", "document"]).describe("Which kind of entity the id refers to: a record or a document."),
12478
- id: z22.string().min(1, "id is required").describe("The Vectros id of the record or document whose history you want."),
12479
- startFrom: z22.string().optional().describe("Pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch older entries.")
12518
+ resourceType: z23.enum(["record", "document"]).describe("Which kind of entity the id refers to: a record or a document."),
12519
+ id: z23.string().min(1, "id is required").describe("The Vectros id of the record or document whose history you want."),
12520
+ startFrom: z23.string().optional().describe("Pagination cursor \u2014 pass the `nextCursor` from the previous page to fetch older entries.")
12480
12521
  };
12481
12522
  var versionHistory = ({ client, log }) => ({
12482
12523
  name: "version_history",
@@ -12600,7 +12641,7 @@ var ALL_RESOURCE_FACTORIES = {
12600
12641
  };
12601
12642
 
12602
12643
  // src/zod-to-json-schema.ts
12603
- import { z as z23 } from "zod";
12644
+ import { z as z24 } from "zod";
12604
12645
  function zodShapeToJsonSchema(shape) {
12605
12646
  const properties = {};
12606
12647
  const required = [];
@@ -12615,40 +12656,40 @@ function zodShapeToJsonSchema(shape) {
12615
12656
  function zodTypeToJsonSchema(schema) {
12616
12657
  const description = schema.description;
12617
12658
  let current = schema;
12618
- while (current instanceof z23.ZodOptional || current instanceof z23.ZodDefault || current instanceof z23.ZodNullable) {
12659
+ while (current instanceof z24.ZodOptional || current instanceof z24.ZodDefault || current instanceof z24.ZodNullable) {
12619
12660
  current = current._def.innerType;
12620
12661
  }
12621
12662
  const base = description ? { description } : {};
12622
- if (current instanceof z23.ZodString) {
12663
+ if (current instanceof z24.ZodString) {
12623
12664
  return { ...base, type: "string" };
12624
12665
  }
12625
- if (current instanceof z23.ZodNumber) {
12666
+ if (current instanceof z24.ZodNumber) {
12626
12667
  return { ...base, type: "number" };
12627
12668
  }
12628
- if (current instanceof z23.ZodBoolean) {
12669
+ if (current instanceof z24.ZodBoolean) {
12629
12670
  return { ...base, type: "boolean" };
12630
12671
  }
12631
- if (current instanceof z23.ZodEnum) {
12672
+ if (current instanceof z24.ZodEnum) {
12632
12673
  return {
12633
12674
  ...base,
12634
12675
  type: "string",
12635
12676
  enum: current.options
12636
12677
  };
12637
12678
  }
12638
- if (current instanceof z23.ZodArray) {
12679
+ if (current instanceof z24.ZodArray) {
12639
12680
  return {
12640
12681
  ...base,
12641
12682
  type: "array",
12642
12683
  items: zodTypeToJsonSchema(current.element)
12643
12684
  };
12644
12685
  }
12645
- if (current instanceof z23.ZodObject) {
12686
+ if (current instanceof z24.ZodObject) {
12646
12687
  return {
12647
12688
  ...base,
12648
12689
  ...zodShapeToJsonSchema(current.shape)
12649
12690
  };
12650
12691
  }
12651
- if (current instanceof z23.ZodRecord) {
12692
+ if (current instanceof z24.ZodRecord) {
12652
12693
  const valueType = current._def.valueType;
12653
12694
  return {
12654
12695
  ...base,
@@ -12777,7 +12818,7 @@ var VectrosMCPServer = class {
12777
12818
  if (!tool) {
12778
12819
  result = toolError(req.params.name ?? "unknown", new Error("No such tool."));
12779
12820
  } else {
12780
- const parsed = z24.object(tool.inputSchema).strict().safeParse(req.params.arguments ?? {});
12821
+ const parsed = z25.object(tool.inputSchema).strict().safeParse(req.params.arguments ?? {});
12781
12822
  if (!parsed.success) {
12782
12823
  result = toolError(tool.name, new Error(formatArgError(tool, parsed.error)));
12783
12824
  } else {