/** * @fileoverview Tool for resolving a name or an identifier to an OpenAlex ID — names go to * autocomplete, identifiers to the deterministic by-ID lookup. * @module mcp-server/tools/definitions/resolve-name.tool */ import { z } from '@cyanheads/mcp-ts-core'; import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors'; export declare const resolveNameTool: import("@cyanheads/mcp-ts-core").ToolDefinition>; query: z.ZodString; filters: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ results: z.ZodArray; display_name: z.ZodNullable; entity_type: z.ZodString; cited_by_count: z.ZodNumber; works_count: z.ZodNullable; hint: z.ZodNullable; }, z.core.$strip>>; }, z.core.$strip>, readonly [{ readonly reason: "rate_limited"; readonly code: JsonRpcErrorCode.RateLimited; readonly when: "OpenAlex throttled the autocomplete request for exceeding its per-second ceiling (HTTP 429)."; readonly retryable: true; readonly recovery: "Wait several seconds and retry; consider lowering request frequency for this caller."; }, { readonly reason: "upstream_budget_exhausted"; readonly code: JsonRpcErrorCode.RateLimited; readonly when: "The OpenAlex daily usage budget is spent (HTTP 429)."; readonly retryable: false; readonly recovery: "The daily budget refills at midnight UTC — retrying sooner will not succeed. Set OPENALEX_API_KEY to a free key (https://openalex.org/settings/api) for a larger daily budget than anonymous access, or wait for the reset."; }, { readonly reason: "upstream_timeout"; readonly code: JsonRpcErrorCode.Timeout; readonly when: "OpenAlex did not respond within the request deadline."; readonly retryable: true; readonly recovery: "Retry after a short delay; if timeouts persist, narrow the request with tighter filters to reduce upstream load."; }, { readonly reason: "upstream_unavailable"; readonly code: JsonRpcErrorCode.ServiceUnavailable; readonly when: "OpenAlex was unreachable or unusable — HTTP 503, a connection failure, or a body that was empty, HTML, or unparseable JSON."; readonly retryable: true; readonly recovery: "Wait and retry; check https://openalex.org for service status if the outage persists."; }, { readonly reason: "upstream_unauthorized"; readonly code: JsonRpcErrorCode.Unauthorized; readonly when: "OpenAlex rejected the API key (HTTP 401)."; readonly recovery: "Check that OPENALEX_API_KEY is set to a valid OpenAlex account API key (free from https://openalex.org/settings/api)."; }, { readonly reason: "upstream_forbidden"; readonly code: JsonRpcErrorCode.Forbidden; readonly when: "OpenAlex denied access to autocomplete (HTTP 403)."; readonly recovery: "Confirm the API key has access to autocomplete, then retry the request."; }, { readonly reason: "comma_in_filter_value"; readonly code: JsonRpcErrorCode.InvalidParams; readonly when: "A `filters` value contains a comma, which collides with the OpenAlex filter separator."; readonly recovery: "Use `|` for OR within a filter value (e.g. \"2020|2021\"), or move a free-text phrase containing commas into the `query` parameter."; }, { readonly reason: "upstream_invalid_params"; readonly code: JsonRpcErrorCode.InvalidParams; readonly when: "OpenAlex rejected an invalid filter field name on the autocomplete query (HTTP 400)."; readonly recovery: "The upstream message names the rejected field and suggests close matches. Use openalex_describe_fields(entity_type, \"filter\") to browse valid filter fields, or drop `filters` entirely."; }, { readonly reason: "upstream_invalid_id_value"; readonly code: JsonRpcErrorCode.InvalidParams; readonly when: "A `filters` entry expecting an entity ID received a value that is not an OpenAlex ID — usually a name (HTTP 400)."; readonly recovery: "Resolve that name to an OpenAlex ID first — run this tool without the ID-valued filter, take the `id` from a match, then re-run with the ID."; }, { readonly reason: "upstream_invalid_params_other"; readonly code: JsonRpcErrorCode.InvalidParams; readonly when: "OpenAlex rejected the autocomplete request (HTTP 400) for a reason other than an invalid field name."; readonly recovery: "Read the upstream message in the error above and adjust the request — trim the query, check filter value formats, and ensure entity_type is a supported value."; }, { readonly reason: "upstream_validation_failed"; readonly code: JsonRpcErrorCode.ValidationError; readonly when: "OpenAlex rejected the autocomplete request as semantically invalid (HTTP 422)."; readonly recovery: "Read the upstream message for the specific field, then adjust the request to satisfy validation."; }], { readonly notice: z.ZodOptional; readonly budget: z.ZodOptional; }, z.core.$strip>>; }>; //# sourceMappingURL=resolve-name.tool.d.ts.map