/** * @fileoverview Lightweight study count tool — no data fetched, just the total. * @module mcp-server/tools/definitions/get-study-count.tool */ import { z } from '@cyanheads/mcp-ts-core'; import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors'; export declare const getStudyCount: import("@cyanheads/mcp-ts-core").ToolDefinition; conditionQuery: z.ZodOptional; interventionQuery: z.ZodOptional; locationQuery: z.ZodOptional; sponsorQuery: z.ZodOptional; titleQuery: z.ZodOptional; outcomeQuery: z.ZodOptional; statusFilter: z.ZodOptional]>>; phaseFilter: z.ZodOptional]>>; advancedFilter: z.ZodOptional; includeUnknownEnrollment: z.ZodDefault; }, z.core.$strip>, z.ZodObject<{ totalCount: z.ZodNumber; }, z.core.$strip>, readonly [{ readonly reason: "blank_value"; readonly code: JsonRpcErrorCode.ValidationError; readonly when: "A parameter was supplied with a blank, whitespace-only, or empty-list value. A phaseFilter entry of only quotes or invisible format characters (zero-width space) is blank."; readonly recovery: "Supply a value containing non-whitespace, or for a list parameter at least one non-blank entry. Only when the parameter is optional and you meant to leave it unset, omit it entirely instead — omission and a blank value mean different things here."; }, { readonly reason: "field_invalid"; readonly code: JsonRpcErrorCode.ValidationError; readonly when: "An AREA[] expression in advancedFilter or a query parameter names a field ClinicalTrials.gov does not recognize or cannot search by value — often a module or group such as LeadSponsor instead of a leaf piece such as LeadSponsorName — or puts a valid field where upstream refuses it: a study-level field or a search area inside SEARCH[Location](…), or RANGE[] on a field that is not a date, number, or age."; readonly recovery: "Call clinicaltrials_get_field_definitions to browse the field tree; use PascalCase piece names like OverallStatus, Phase, or StudyType. AREA expressions and clinicaltrials_get_field_values take leaf pieces only: LeadSponsorName, not the group LeadSponsor."; readonly thrownBy: "service"; }, { readonly reason: "enum_invalid"; readonly code: JsonRpcErrorCode.ValidationError; readonly when: "A phaseFilter entry resolves to none of the six phase values, or statusFilter or an AREA[] expression carries a value ClinicalTrials.gov does not accept."; readonly recovery: "Call clinicaltrials_get_field_values with fields=[\"OverallStatus\"] or fields=[\"Phase\"] to see the valid enum values the filter accepts."; }, { readonly reason: "query_parse_error"; readonly code: JsonRpcErrorCode.ValidationError; readonly when: "A free-text query or advancedFilter expression uses syntax the upstream Essie parser rejects — typically a `[` or `]` outside an AREA[…] / RANGE[…] expression, an unmatched `(` / `)`, or an unterminated quote in a query/conditionQuery/etc. value."; readonly recovery: "Field-scoped search uses AREA[FieldName]value, which works in the free-text fields (query, conditionQuery, etc.) as well as in advancedFilter — call clinicaltrials_get_field_definitions to look up the right FieldName. A `[` or `]` outside an AREA[…] / RANGE[…] expression fails; `( )` group sub-expressions and are safe when matched; `,` acts as AND. Free-text fields otherwise take plain words plus AND, OR, NOT."; readonly thrownBy: "service"; }, { readonly reason: "request_too_long"; readonly code: JsonRpcErrorCode.ValidationError; readonly when: "The request URL runs past the length ClinicalTrials.gov accepts — typically a very long free-text query or advancedFilter expression."; readonly recovery: "Shorten the longest inputs — a free-text query, advancedFilter, or a long fields or conditions list — or split a long list across several calls with fewer entries each, so the request URL fits within the length ClinicalTrials.gov accepts."; readonly thrownBy: "service"; }, { readonly reason: "rate_limited"; readonly code: JsonRpcErrorCode.RateLimited; readonly when: "ClinicalTrials.gov answered HTTP 429 on every attempt, or the call’s time budget ran out after a 429."; readonly recovery: "ClinicalTrials.gov rate-limited the request after several retries; wait about a minute before trying again."; readonly retryable: true; readonly thrownBy: "service"; }, { readonly reason: "retry_deadline_exceeded"; readonly code: JsonRpcErrorCode.Timeout; readonly when: "ClinicalTrials.gov did not answer within the call’s time budget, which covers every request, retry, and wait the call makes."; readonly recovery: "Retry after a minute or two. If the call asked for a lot at once — a large pageSize, many fields, or many nctIds — ask for less per call, or split the request across several calls."; readonly retryable: true; readonly thrownBy: "service"; }, { readonly reason: "upstream_timeout"; readonly code: JsonRpcErrorCode.Timeout; readonly when: "ClinicalTrials.gov answered HTTP 504 (gateway timeout) or 408 (request timeout), or sent no answer within the per-attempt timeout, on every attempt."; readonly recovery: "Retry after a few minutes. If it fails again, narrow the request — a more specific query or filter, a smaller pageSize, or fewer fields or nctIds — so ClinicalTrials.gov has less to compute and return."; readonly retryable: true; readonly thrownBy: "service"; }, { readonly reason: "upstream_unavailable"; readonly code: JsonRpcErrorCode.ServiceUnavailable; readonly when: "Every attempt failed on ClinicalTrials.gov’s side — HTTP 500, 502, or 503, a dropped connection or one the network gave up opening, or a 200 body that is not the JSON the route serves (an HTML page, unparseable text, the wrong shape) — or it answered with another 5xx, such as 505, or the connection was refused or its host name did not resolve, none of which is retried."; readonly recovery: "Retry the same call unchanged after a few minutes — the arguments were not at fault. If it keeps failing, ClinicalTrials.gov is down; tell the user rather than rewording the query."; readonly retryable: true; readonly thrownBy: "service"; }, { readonly reason: "upstream_rejected"; readonly code: JsonRpcErrorCode.ServiceUnavailable; readonly when: "ClinicalTrials.gov refused the request with a status its API does not use for a bad query — HTTP 501, a 3xx, or a 4xx such as 401, 403, or 410 — or answered with an HTML error page in place of its own 404."; readonly recovery: "Do not retry the same call right away or reword it — ClinicalTrials.gov refused it for a reason unrelated to the arguments, and it will refuse again. Tell the user the registry is not serving this request, and try again later."; readonly retryable: false; readonly thrownBy: "service"; }], { readonly searchCriteria: z.ZodOptional>; readonly notice: z.ZodOptional; }>; //# sourceMappingURL=get-study-count.tool.d.ts.map