parseapi-mcp 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -4
- package/dist/chunk-M5FQI2AW.js +619 -0
- package/dist/http.js +1 -1
- package/dist/registry.js +1 -1
- package/dist/stdio.js +1 -1
- package/package.json +5 -2
- package/dist/chunk-BR6YLDUP.js +0 -528
package/README.md
CHANGED
|
@@ -45,31 +45,52 @@ CI and headless setups skip the browser with a key from [parseapi.com](https://p
|
|
|
45
45
|
}
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
+
## API versions
|
|
49
|
+
|
|
50
|
+
The team's API version is selected in [Dashboard → API version](https://parseapi.com/dashboard/versions). One setting applies to every key and connected app in the team. Existing teams keep `1.0.0`; new teams start on `2.0.0`. Owners and admins can change it after reviewing and testing the target contract. Keys and app identities stay the same. Signing in or upgrading MCP does not change the team's version.
|
|
51
|
+
|
|
52
|
+
Published MCP/SDK `0.3.2` matches API `1.0.0`. This source tree's tool descriptions and SDK dependency expect API `2.0.0`; use a matching MCP release before changing the team's version. Test in a separate development team first; the change applies to all of the production team's integrations. The API returns the selected contract, so an upgrade can change the fields an agent receives. There is no version argument to add to tool calls. See [API versions and migration](https://parseapi.com/docs/versioning).
|
|
53
|
+
|
|
48
54
|
## Tools
|
|
49
55
|
|
|
50
|
-
|
|
56
|
+
58 local tools and 57 hosted tools cover the lookup operations. `ip_self` is local only. `time` returns current local time and Unix seconds. It accepts a timezone or coordinates and defaults to UTC when both are omitted. `date` parses the supplied date, or returns today in UTC when omitted. Existing `timezone` calls remain supported with their original arguments. Every tool returns the JSON the API serves.
|
|
51
57
|
|
|
52
|
-
Tools follow the lookup names: `country_states`, `city_search`, `postal_nearby`, `address`, `address_search`, `company`, `email`, `vat`, `iban`, `npi`, `vin`, `tariff`, `asn`, `mac`, `currency_rate`, and the rest. All search tools take `query`.
|
|
58
|
+
Tools follow the lookup names: `country_states`, `city_search`, `postal_nearby`, `address`, `address_search`, `company`, `email`, `vat`, `iban`, `bin`, `npi`, `vin`, `naics`, `naics_search`, `tariff`, `dns`, `asn`, `mac`, `currency_rate`, and the rest. All search tools take `query`.
|
|
59
|
+
|
|
60
|
+
NAICS paid deep records include classification `deep.exclusions`, each with a description and linked codes. Generic exclusions can have no linked codes. Omitted or null exclusions in older responses remain unknown. Search results also include `match`: the matched `field` (`name`, `term` or `naics`) and `text`, plus `corrections` with `from` and `to` tokens for typo fallback. Corrections are empty for exact, plural and prefix matches. Direct code lookups omit `match`. Older responses may omit it.
|
|
53
61
|
|
|
54
62
|
Example tool arguments:
|
|
55
63
|
|
|
56
64
|
| Tool | Arguments |
|
|
57
65
|
|---|---|
|
|
66
|
+
| `domain` | `{"domain":"example.com"}` (registration status) |
|
|
67
|
+
| `domain` | `{"domain":"example.com","deep":true}` (registration details on paid plans) |
|
|
68
|
+
| `dns` | `{"domain":"example.com","type":"TXT"}` |
|
|
69
|
+
| `mx` | `{"domain":"example.com"}` |
|
|
58
70
|
| `asn` | `{"asn":"AS13335"}` |
|
|
59
71
|
| `mac` | `{"mac":"00:1B:63:84:45:E6"}` |
|
|
72
|
+
| `bin` | `{"bin":"424242"}` |
|
|
60
73
|
| `country_states` | `{"code":"US"}` |
|
|
61
74
|
| `address_search` | `{"query":"1600 Pennsylvania","country":"US","city":"Washington","state":"DC"}` |
|
|
62
75
|
| `company` | `{"number":"552100554","country":"FR"}` |
|
|
63
|
-
| `
|
|
64
|
-
| `
|
|
76
|
+
| `time` | `{}` (UTC now) |
|
|
77
|
+
| `time` | `{"timezone":"America/New_York","at":"2026-09-05T09:00:00","to":"Asia/Tokyo"}` |
|
|
78
|
+
| `time` | `{"lat":40.71,"lon":-74.01}` |
|
|
65
79
|
| `date` | `{"date":"03/04/2026","format":"dmy"}` |
|
|
66
80
|
|
|
67
81
|
Address lookup returns standardized components and registration status for the US and France. Its `deep` object is currently empty. Company lookup returns validity, registration status and business details when available. `address_search` also accepts `postal` and `ip` to narrow or rank matches. French search needs `country: "FR"` and either `postal` or `city`.
|
|
68
82
|
|
|
83
|
+
|
|
69
84
|
Ordinary lookups retry up to twice after a transient failure. Metered lookups and address deep checks default to no retries. Cancelling a tool call cancels the pending SDK request.
|
|
70
85
|
|
|
71
86
|
Errors come back as JSON with a machine-readable `code`. Branch on `code`, never on message text. A miss is `not_found`. No key is `invalid_api_key`.
|
|
72
87
|
|
|
88
|
+
## Measurements
|
|
89
|
+
|
|
90
|
+
Call `measure` with `{ "measure": "5 ft 11 in", "to": "cm" }`. The result keeps the amount as the decimal string `"180.34"`. Without `to`, the result uses the canonical unit for its type. Optional `locale` and `system` (`us` or `imperial`) resolve explicit number or customary-unit ambiguity.
|
|
91
|
+
|
|
92
|
+
Call `measure_units` with `{ "unit": "m" }` to discover compatible targets, or `{}` for the reviewed catalog. Optional `query` and `type` filters narrow the list. Ambiguous input remains a successful result with `valid: false`, `reason`, and `choices`. Invalid targets return the ordinary API error. Both tools use pooled requests.
|
|
93
|
+
|
|
73
94
|
## Development
|
|
74
95
|
|
|
75
96
|
```bash
|
|
@@ -83,3 +104,10 @@ npm run serve # http on :8080
|
|
|
83
104
|
Offline tests pin the public tool names and argument schemas in `test/public-api.json`, exercise every operation and query option, and verify errors, retries and cancellation. Review baseline changes as public API changes. Publishing runs typecheck and offline tests first.
|
|
84
105
|
|
|
85
106
|
MIT licensed.
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
## Optional detail
|
|
110
|
+
|
|
111
|
+
Start with the default tool call. Use the same tool with `deep: true` for richer facts. Time, Date, Currency, Language, Emoji, Phone, IBAN and Point include detail on every plan. Geographic profiles, Name evidence and NAICS definitions require a paid plan. Carrier and HLR detail stays inside the same metered core unit, including Free allowance units, with no additional charge or second gate.
|
|
112
|
+
|
|
113
|
+
Search detail belongs to each returned entity. Time conversion puts target display detail in `to.deep`; only the source returns `deep.next_dst`. Name core parsing needs no dictionary lookup. Country, State and Postal tax references are in their paid deep bags.
|
|
@@ -0,0 +1,619 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/registry.ts
|
|
4
|
+
import { McpServer } from "@modelcontextprotocol/server";
|
|
5
|
+
import { parseAPI } from "@parseapi/sdk";
|
|
6
|
+
import * as z from "zod";
|
|
7
|
+
|
|
8
|
+
// src/errors.ts
|
|
9
|
+
import { ParseAPIError } from "@parseapi/sdk";
|
|
10
|
+
function ok(data) {
|
|
11
|
+
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
12
|
+
}
|
|
13
|
+
function errorJson(code, message, docs, requestId) {
|
|
14
|
+
return {
|
|
15
|
+
isError: true,
|
|
16
|
+
content: [{ type: "text", text: JSON.stringify({ code, message, docs, request_id: requestId }) }]
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function toErrorResult(err) {
|
|
20
|
+
if (err instanceof ParseAPIError) {
|
|
21
|
+
return errorJson(err.code, err.message, err.docs, err.requestId);
|
|
22
|
+
}
|
|
23
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
24
|
+
return errorJson("network_error", message, null, null);
|
|
25
|
+
}
|
|
26
|
+
function noKeyResult(transport) {
|
|
27
|
+
const where = transport === "stdio" ? "set it as the PARSEAPI_KEY environment variable for this MCP server" : "send it in the X-API-Key header";
|
|
28
|
+
return errorJson(
|
|
29
|
+
"invalid_api_key",
|
|
30
|
+
`No API key. Get a free key at https://parseapi.com and ${where}.`,
|
|
31
|
+
"https://parseapi.com/docs#invalid_api_key",
|
|
32
|
+
null
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// src/registry.ts
|
|
37
|
+
var VERSION = "0.4.0";
|
|
38
|
+
var deep = z.boolean().optional().describe("Include the nested deep object when available. Pricing depends on the operation.");
|
|
39
|
+
var lat = z.number().min(-90).max(90).describe("Latitude in decimal degrees");
|
|
40
|
+
var lon = z.number().min(-180).max(180).describe("Longitude in decimal degrees");
|
|
41
|
+
var iso2 = (what) => z.string().describe(`ISO 3166-1 alpha-2 ${what}, e.g. US`);
|
|
42
|
+
var countryOpt = z.string().optional().describe("ISO2, ISO3, or a country name. Optional when the lookup is unique.");
|
|
43
|
+
function buildServer(key, transport) {
|
|
44
|
+
const server = new McpServer(
|
|
45
|
+
{
|
|
46
|
+
name: "parseapi",
|
|
47
|
+
version: VERSION,
|
|
48
|
+
title: "ParseAPI",
|
|
49
|
+
description: "Lookups for agents: IP and place data, addresses, company numbers, email, VAT, IBAN, NPI, phone, domains, weather, currency, measurements, timezones, dates and holidays. Real reference data instead of guessing.",
|
|
50
|
+
websiteUrl: "https://parseapi.com"
|
|
51
|
+
},
|
|
52
|
+
{ capabilities: { tools: {} } }
|
|
53
|
+
);
|
|
54
|
+
const parse = key ? parseAPI(key) : null;
|
|
55
|
+
function tool(name, description, shape, fn, refine) {
|
|
56
|
+
server.registerTool(
|
|
57
|
+
name,
|
|
58
|
+
{
|
|
59
|
+
description,
|
|
60
|
+
inputSchema: refine ? refine(z.object(shape)) : z.object(shape),
|
|
61
|
+
annotations: { readOnlyHint: true }
|
|
62
|
+
},
|
|
63
|
+
async (args, context) => {
|
|
64
|
+
if (!parse) return noKeyResult(transport);
|
|
65
|
+
try {
|
|
66
|
+
return ok(await fn(parse, args, { signal: context.mcpReq.signal }));
|
|
67
|
+
} catch (err) {
|
|
68
|
+
return toErrorResult(err);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
tool(
|
|
74
|
+
"measure",
|
|
75
|
+
"Parse a measurement or convert it to a target unit. Supports mixed measurements such as 5 ft 11 in. Amount is a decimal string. Without to, returns the canonical unit for its type. Ambiguous input returns valid false, reason and choices. Use measure_units to discover accepted units. Pooled request, no separate check charge.",
|
|
76
|
+
{
|
|
77
|
+
measure: z.string().min(1).max(256).describe("Measurement to parse, e.g. 5 ft 11 in or 10 kg"),
|
|
78
|
+
to: z.string().min(1).max(128).optional().describe("Target unit, e.g. cm or lb"),
|
|
79
|
+
locale: z.string().min(1).max(32).optional().describe("Explicit number locale, e.g. de-DE"),
|
|
80
|
+
system: z.enum(["us", "imperial"]).optional().describe("Resolve an ambiguous customary unit using the stated system")
|
|
81
|
+
},
|
|
82
|
+
(c, a, request) => c.measure(a.measure, { ...request, to: a.to, locale: a.locale, system: a.system })
|
|
83
|
+
);
|
|
84
|
+
tool(
|
|
85
|
+
"measure_units",
|
|
86
|
+
"Discover the reviewed measurement units, canonical codes, types and aliases. With no filters, returns the full catalog. Pass unit to find compatible conversion targets. Combine query and type to narrow results.",
|
|
87
|
+
{
|
|
88
|
+
query: z.string().max(128).optional().describe("Search text, e.g. foot"),
|
|
89
|
+
type: z.string().min(1).max(64).optional().describe("Measurement type, e.g. length"),
|
|
90
|
+
unit: z.string().min(1).max(128).optional().describe("Return units compatible with this unit, e.g. m")
|
|
91
|
+
},
|
|
92
|
+
(c, a, request) => c.measure.units({ ...request, query: a.query, type: a.type, unit: a.unit })
|
|
93
|
+
);
|
|
94
|
+
tool(
|
|
95
|
+
"ip",
|
|
96
|
+
"Look up an IPv4 or IPv6 address: country, region, ASN, timezone. Deep adds datacenter, relay, tor and vpn flags.",
|
|
97
|
+
{ ip: z.string().describe("IPv4 or IPv6 address, e.g. 8.8.8.8"), deep },
|
|
98
|
+
(c, a, request) => c.ip(a.ip, { ...request, deep: a.deep })
|
|
99
|
+
);
|
|
100
|
+
if (transport === "stdio") {
|
|
101
|
+
tool(
|
|
102
|
+
"ip_self",
|
|
103
|
+
"Look up the public IP of the machine running this MCP server.",
|
|
104
|
+
{ deep },
|
|
105
|
+
(c, a, request) => c.ip.self({ ...request, deep: a.deep })
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
tool(
|
|
109
|
+
"continent",
|
|
110
|
+
"Look up a continent by code: name, area, population and population_period. The period is a reporting year or range, null when unknown or unverifiable.",
|
|
111
|
+
{ code: z.string().describe("Continent code: AF, AN, AS, EU, NA, OC, SA") },
|
|
112
|
+
(c, a, request) => c.continent(a.code, request)
|
|
113
|
+
);
|
|
114
|
+
tool(
|
|
115
|
+
"continent_countries",
|
|
116
|
+
"List every country on a continent.",
|
|
117
|
+
{ code: z.string().describe("Continent code: AF, AN, AS, EU, NA, OC, SA") },
|
|
118
|
+
(c, a, request) => c.continent.countries(a.code, request)
|
|
119
|
+
);
|
|
120
|
+
tool(
|
|
121
|
+
"bloc",
|
|
122
|
+
"Look up a country group by code: EU, EEA, Schengen, Eurozone, SEPA, NATO, and more. Returns the official name and the current member count.",
|
|
123
|
+
{
|
|
124
|
+
code: z.string().describe("Bloc code: EU, EEA, EFTA, SCHENGEN, EUROZONE, SEPA, NATO, OECD, G7, ASEAN, GCC, MERCOSUR")
|
|
125
|
+
},
|
|
126
|
+
(c, a, request) => c.bloc(a.code, request)
|
|
127
|
+
);
|
|
128
|
+
tool(
|
|
129
|
+
"bloc_countries",
|
|
130
|
+
"List the current members of a country group, each with name, flag, and calling code.",
|
|
131
|
+
{
|
|
132
|
+
code: z.string().describe("Bloc code: EU, EEA, EFTA, SCHENGEN, EUROZONE, SEPA, NATO, OECD, G7, ASEAN, GCC, MERCOSUR")
|
|
133
|
+
},
|
|
134
|
+
(c, a, request) => c.bloc.countries(a.code, request)
|
|
135
|
+
);
|
|
136
|
+
tool(
|
|
137
|
+
"country",
|
|
138
|
+
"Country names, language codes, currency, calling code and timezones. Deep adds the country reference profile, including population with its reporting period, tax and locale conventions, on paid plans.",
|
|
139
|
+
{ code: iso2("country code"), deep: deep.describe("Include the complete detail bag on a paid plan.") },
|
|
140
|
+
(c, a, request) => c.country(a.code, { ...request, deep: a.deep })
|
|
141
|
+
);
|
|
142
|
+
tool(
|
|
143
|
+
"country_states",
|
|
144
|
+
"List the states, provinces or regions of a country.",
|
|
145
|
+
{ code: iso2("country code") },
|
|
146
|
+
(c, a, request) => c.country.states(a.code, request)
|
|
147
|
+
);
|
|
148
|
+
tool(
|
|
149
|
+
"state",
|
|
150
|
+
"Look up a state or province by code or name. Deep adds its demographic and tax profile on paid plans, including population_period when verified. Pass country to resolve a colliding code.",
|
|
151
|
+
{
|
|
152
|
+
code: z.string().describe("State code or name, e.g. colorado, NC"),
|
|
153
|
+
country: countryOpt,
|
|
154
|
+
deep: deep.describe("Include the complete detail bag on a paid plan.")
|
|
155
|
+
},
|
|
156
|
+
(c, a, request) => c.state(a.code, { ...request, deep: a.deep, country: a.country })
|
|
157
|
+
);
|
|
158
|
+
tool(
|
|
159
|
+
"state_districts",
|
|
160
|
+
"List the districts, counties or departments of a state. Deep adds population and its reporting period to each result on paid plans.",
|
|
161
|
+
{
|
|
162
|
+
code: z.string().describe("State code or name, e.g. NC, colorado"),
|
|
163
|
+
country: countryOpt,
|
|
164
|
+
deep: deep.describe("Include population and its reporting period in each district detail bag on a paid plan.")
|
|
165
|
+
},
|
|
166
|
+
(c, a, request) => c.state.districts(a.code, { ...request, deep: a.deep, country: a.country })
|
|
167
|
+
);
|
|
168
|
+
tool(
|
|
169
|
+
"district",
|
|
170
|
+
"Look up a district, county or department by code or name. Deep adds area, population and seat on paid plans. Pass state to resolve a colliding name. Population includes a reporting year or period when verified. Paid deep property_tax contains annual_median, currency and period: median annual tax payable on owner-occupied homes in the area, adjusted to the final year of that period. It is not a rate or property bill. Unsupported, missing and censored estimates are null.",
|
|
171
|
+
{
|
|
172
|
+
code: z.string().describe("District code or name, e.g. 37081, guilford county"),
|
|
173
|
+
country: countryOpt,
|
|
174
|
+
state: z.string().optional().describe("ADM1 code or name to disambiguate, e.g. NC or louisiana"),
|
|
175
|
+
deep: deep.describe("Include the complete detail bag on a paid plan.")
|
|
176
|
+
},
|
|
177
|
+
(c, a, request) => c.district(a.code, { ...request, deep: a.deep, country: a.country, state: a.state })
|
|
178
|
+
);
|
|
179
|
+
tool(
|
|
180
|
+
"city",
|
|
181
|
+
"Resolve a city name to coordinates, timezone and administrative context. Deep adds demographic and geographic detail on paid plans. Pass country or state for name ties. Population includes a reporting year or period when verified.",
|
|
182
|
+
{
|
|
183
|
+
name: z.string().describe("City name, e.g. charlotte"),
|
|
184
|
+
country: countryOpt,
|
|
185
|
+
state: z.string().optional().describe("State code to disambiguate, e.g. NC"),
|
|
186
|
+
deep: deep.describe("Include the complete detail bag on a paid plan.")
|
|
187
|
+
},
|
|
188
|
+
(c, a, request) => c.city(a.name, { ...request, deep: a.deep, country: a.country, state: a.state })
|
|
189
|
+
);
|
|
190
|
+
tool(
|
|
191
|
+
"city_id",
|
|
192
|
+
"Resolve a stable city id. Deep adds the city profile on paid plans.",
|
|
193
|
+
{ id: z.string().describe("Stable city id, e.g. city_mb8mbqrkz8zb"), deep: deep.describe("Include the complete detail bag on a paid plan.") },
|
|
194
|
+
(c, a, request) => c.city.id(a.id, { ...request, deep: a.deep })
|
|
195
|
+
);
|
|
196
|
+
tool(
|
|
197
|
+
"city_search",
|
|
198
|
+
"Search city names. Deep adds the profile inside each returned city on paid plans.",
|
|
199
|
+
{
|
|
200
|
+
query: z.string().describe("Name prefix, e.g. char"),
|
|
201
|
+
country: countryOpt,
|
|
202
|
+
state: z.string().optional().describe("State code filter"),
|
|
203
|
+
limit: z.number().int().min(1).max(50).optional().describe("Max results"),
|
|
204
|
+
deep: deep.describe("Include the complete detail bag on a paid plan.")
|
|
205
|
+
},
|
|
206
|
+
(c, a, request) => c.city.search(a.query, { ...request, deep: a.deep, country: a.country, state: a.state, limit: a.limit })
|
|
207
|
+
);
|
|
208
|
+
tool(
|
|
209
|
+
"city_nearest",
|
|
210
|
+
"Find the nearest city with distance. Deep adds the city profile on paid plans.",
|
|
211
|
+
{ lat, lon, deep },
|
|
212
|
+
(c, a, request) => c.city.nearest(a.lat, a.lon, { ...request, deep: a.deep })
|
|
213
|
+
);
|
|
214
|
+
tool(
|
|
215
|
+
"city_nearby",
|
|
216
|
+
"Find nearby cities with distances. Deep adds the profile inside each returned city on paid plans.",
|
|
217
|
+
{
|
|
218
|
+
name: z.string().describe("Anchor city name, e.g. denver"),
|
|
219
|
+
country: countryOpt,
|
|
220
|
+
state: z.string().optional().describe("State code to disambiguate the anchor"),
|
|
221
|
+
radius: z.number().positive().optional().describe("Search radius, default 40 km"),
|
|
222
|
+
unit: z.enum(["km", "mi"]).optional().describe("Radius unit, default km"),
|
|
223
|
+
limit: z.number().int().min(1).max(50).optional().describe("Max results, default 10"),
|
|
224
|
+
deep: deep.describe("Include the complete detail bag on a paid plan.")
|
|
225
|
+
},
|
|
226
|
+
(c, a, request) => c.city.nearby(a.name, {
|
|
227
|
+
...request,
|
|
228
|
+
deep: a.deep,
|
|
229
|
+
country: a.country,
|
|
230
|
+
state: a.state,
|
|
231
|
+
radius: a.radius,
|
|
232
|
+
unit: a.unit,
|
|
233
|
+
limit: a.limit
|
|
234
|
+
})
|
|
235
|
+
);
|
|
236
|
+
tool(
|
|
237
|
+
"postal",
|
|
238
|
+
"Resolve a postal code to its place, coordinates and timezone. Deep adds area, population with its reporting period, tax references, neighbors and metro associations on paid plans. property_tax is a nullable area statistic with annual_median, currency and period: median annual tax payable on owner-occupied homes, adjusted to the final year of the period. It is not a rate or property bill. Unsupported, missing and censored estimates are null. Tax rates are percentages and alternative geographic references, not additive.",
|
|
239
|
+
{
|
|
240
|
+
code: z.string().describe("Postal or ZIP code, e.g. SW1A 1AA, 28202"),
|
|
241
|
+
country: countryOpt,
|
|
242
|
+
deep: deep.describe("Include the complete detail bag on a paid plan.")
|
|
243
|
+
},
|
|
244
|
+
(c, a, request) => c.postal(a.code, { ...request, deep: a.deep, country: a.country })
|
|
245
|
+
);
|
|
246
|
+
tool(
|
|
247
|
+
"postal_nearby",
|
|
248
|
+
"Find nearby postal codes with distances. Deep adds metropolitan associations to the origin and each result on paid plans.",
|
|
249
|
+
{
|
|
250
|
+
code: z.string().describe("Postal code to search around"),
|
|
251
|
+
country: countryOpt,
|
|
252
|
+
radius: z.number().positive().optional().describe("Search radius"),
|
|
253
|
+
unit: z.enum(["km", "mi"]).optional().describe("Radius unit, default km"),
|
|
254
|
+
deep: deep.describe("Include the complete detail bag on a paid plan.")
|
|
255
|
+
},
|
|
256
|
+
(c, a, request) => c.postal.nearby(a.code, { ...request, deep: a.deep, country: a.country, radius: a.radius, unit: a.unit })
|
|
257
|
+
);
|
|
258
|
+
tool(
|
|
259
|
+
"postal_distance",
|
|
260
|
+
"Distance between two postal codes. Deep adds metropolitan associations inside each endpoint on paid plans.",
|
|
261
|
+
{
|
|
262
|
+
from: z.string().describe("First postal code"),
|
|
263
|
+
to: z.string().describe("Second postal code"),
|
|
264
|
+
country: countryOpt,
|
|
265
|
+
deep: deep.describe("Include the complete detail bag on a paid plan.")
|
|
266
|
+
},
|
|
267
|
+
(c, a, request) => c.postal.distance(a.from, a.to, { ...request, deep: a.deep, country: a.country })
|
|
268
|
+
);
|
|
269
|
+
tool(
|
|
270
|
+
"address",
|
|
271
|
+
"Look up a US or French street address: house number, street, unit, city, state, postal code and registration status. Registration does not establish deliverability or verify an apartment. Deep is currently an empty object.",
|
|
272
|
+
{
|
|
273
|
+
address: z.string().describe("Street address, e.g. 1600 Pennsylvania Ave NW, Washington, DC 20500"),
|
|
274
|
+
country: z.string().optional().describe("Country: US or FR. Use FR or a written France suffix for France. Defaults to US."),
|
|
275
|
+
deep
|
|
276
|
+
},
|
|
277
|
+
(c, a, request) => c.address(a.address, { ...request, country: a.country, deep: a.deep })
|
|
278
|
+
);
|
|
279
|
+
tool(
|
|
280
|
+
"address_search",
|
|
281
|
+
"Search street addresses from a partial address. Prefer postal, or city and state, from the form. An optional end-user IP hints at locality. Empty results explain themselves with reason: more_input, missing_context or no_matches. With suggestions reason is null. Operational failures use API errors. French search requires country FR and either postal or city.",
|
|
282
|
+
{
|
|
283
|
+
query: z.string().describe("Partial street address, e.g. 1600 Pennsylvania"),
|
|
284
|
+
country: z.string().optional().describe("Country: US or FR. Defaults to US."),
|
|
285
|
+
postal: z.string().optional().describe("Postal code from the address form, preferred for locality context"),
|
|
286
|
+
city: z.string().optional().describe("City filter"),
|
|
287
|
+
state: z.string().optional().describe("State code filter"),
|
|
288
|
+
ip: z.string().optional().describe("End-user IP locality hint for server-side calls. Prefer explicit form context.")
|
|
289
|
+
},
|
|
290
|
+
(c, a, request) => c.address.search(a.query, { ...request, country: a.country, postal: a.postal, city: a.city, state: a.state, ip: a.ip })
|
|
291
|
+
);
|
|
292
|
+
tool(
|
|
293
|
+
"company",
|
|
294
|
+
"Parse a company number and its registered identity, status and address. Paid deep adds business activity and associated identifiers. Geography lookups are separate calls.",
|
|
295
|
+
{
|
|
296
|
+
number: z.string().describe("Company registration number, e.g. 552100554 with country FR"),
|
|
297
|
+
country: countryOpt,
|
|
298
|
+
deep
|
|
299
|
+
},
|
|
300
|
+
(c, a, request) => c.company(a.number, { ...request, country: a.country, deep: a.deep })
|
|
301
|
+
);
|
|
302
|
+
tool(
|
|
303
|
+
"point",
|
|
304
|
+
"Locate coordinates in their country, state, district and actual IANA timezone. Deep adds terrain and a compact nearest-city summary on every plan. The timezone ID stays in core. Nearest city is null when none is within 200 km.",
|
|
305
|
+
{ lat, lon, deep },
|
|
306
|
+
(c, a, request) => c.point(a.lat, a.lon, { ...request, deep: a.deep })
|
|
307
|
+
);
|
|
308
|
+
tool(
|
|
309
|
+
"elevation",
|
|
310
|
+
"Elevation in meters at coordinates.",
|
|
311
|
+
{ lat, lon },
|
|
312
|
+
(c, a, request) => c.elevation(a.lat, a.lon, request)
|
|
313
|
+
);
|
|
314
|
+
tool(
|
|
315
|
+
"weather",
|
|
316
|
+
"Current weather with observation time and station distance. Paid deep adds specialist current measurements, forecast, alerts, hourly and daily outlook, air quality and optional history. Metric and imperial pairs stay together. A date requires paid deep and adds the past UTC day in deep.history alongside current conditions.",
|
|
317
|
+
{
|
|
318
|
+
lat,
|
|
319
|
+
lon,
|
|
320
|
+
deep,
|
|
321
|
+
date: z.string().optional().describe("A past UTC day, YYYY-MM-DD. Requires paid deep. Adds deep.history alongside current conditions.")
|
|
322
|
+
},
|
|
323
|
+
(c, a, request) => c.weather(a.lat, a.lon, { ...request, deep: a.deep, date: a.date })
|
|
324
|
+
);
|
|
325
|
+
tool(
|
|
326
|
+
"email",
|
|
327
|
+
"Validate an email address: syntax, domain, MX, disposable, role, and a typo suggestion when the host looks misspelled. Deep returns mailbox deliverability and catch-all results, reusing a recent verification when available.",
|
|
328
|
+
{ email: z.string().describe("Email address to validate"), deep },
|
|
329
|
+
(c, a, request) => c.email(a.email, { ...request, deep: a.deep })
|
|
330
|
+
);
|
|
331
|
+
tool(
|
|
332
|
+
"vat",
|
|
333
|
+
"Validate a VAT number: format and checksum on every call. Deep asks the live EU registry for registered, legal name, and address. Pass from with your own VAT for a consultation identifier.",
|
|
334
|
+
{
|
|
335
|
+
number: z.string().describe("VAT number, with or without the country prefix"),
|
|
336
|
+
country: iso2("country code when the number has no prefix").optional(),
|
|
337
|
+
from: z.string().optional().describe("Your own VAT number. Returns a consultation identifier for your audit file"),
|
|
338
|
+
deep
|
|
339
|
+
},
|
|
340
|
+
(c, a, request) => c.vat(a.number, { ...request, country: a.country, from: a.from, deep: a.deep })
|
|
341
|
+
);
|
|
342
|
+
tool(
|
|
343
|
+
"iban",
|
|
344
|
+
"Parse an IBAN and check its format and checksum, with known bank identifiers. Deep adds check digits, branch and account decomposition on every plan. Does not verify an account exists.",
|
|
345
|
+
{
|
|
346
|
+
iban: z.string().describe("IBAN, with or without spaces, with or without the country prefix"),
|
|
347
|
+
country: iso2("country code when the number has no prefix").optional(),
|
|
348
|
+
deep: deep.describe("Include optional detail on every plan.")
|
|
349
|
+
},
|
|
350
|
+
(c, a, request) => c.iban(a.iban, { ...request, deep: a.deep, country: a.country })
|
|
351
|
+
);
|
|
352
|
+
tool(
|
|
353
|
+
"bin",
|
|
354
|
+
"Look up a 6-11 digit payment-card prefix. Returns the actual longest matched prefix, issuer, country, brand, card type and prepaid status where known. Unknown fields are null. Does not confirm a card or account exists. Pooled request on every plan.",
|
|
355
|
+
{
|
|
356
|
+
bin: z.string().describe("Card prefix as a string, 6-11 digits. Preserve leading zeros. Spaces and hyphens are accepted."),
|
|
357
|
+
deep: z.boolean().optional().describe("Include an empty deep object. No extra fields or separate charge.")
|
|
358
|
+
},
|
|
359
|
+
(c, a, request) => c.bin(a.bin, { ...request, deep: a.deep })
|
|
360
|
+
);
|
|
361
|
+
tool(
|
|
362
|
+
"npi",
|
|
363
|
+
"Validate an NPI and identify the registered provider, active/exclusion status, specialty and practice contact. Paid deep adds deactivation date and Medicare enrollment evidence.",
|
|
364
|
+
{
|
|
365
|
+
npi: z.string().describe("10-digit NPI number"),
|
|
366
|
+
deep
|
|
367
|
+
},
|
|
368
|
+
(c, a, request) => c.npi(a.npi, { ...request, deep: a.deep })
|
|
369
|
+
);
|
|
370
|
+
tool(
|
|
371
|
+
"phone",
|
|
372
|
+
"Parse and validate a phone number with national and international display formats. Deep adds numbering-plan state and timezone on every plan. These do not locate a handset.",
|
|
373
|
+
{
|
|
374
|
+
number: z.string().describe("Phone number, e.g. +14155552671"),
|
|
375
|
+
country: iso2("country code for national-format numbers").optional(),
|
|
376
|
+
deep
|
|
377
|
+
},
|
|
378
|
+
(c, a, request) => c.phone(a.number, { ...request, country: a.country, deep: a.deep })
|
|
379
|
+
);
|
|
380
|
+
tool(
|
|
381
|
+
"carrier",
|
|
382
|
+
"Look up current carrier, real line type and burner flag. Deep adds issuing city and state in the same metered lookup, including Free allowance units. No extra check or second paid gate.",
|
|
383
|
+
{
|
|
384
|
+
number: z.string().describe("Phone number, e.g. +14155552671"),
|
|
385
|
+
country: iso2("country code for national-format numbers").optional(),
|
|
386
|
+
deep: deep.describe("Include available detail within the same metered core unit. No extra charge or paid-plan gate.")
|
|
387
|
+
},
|
|
388
|
+
(c, a, request) => c.carrier(a.number, { ...request, deep: a.deep, country: a.country })
|
|
389
|
+
);
|
|
390
|
+
tool(
|
|
391
|
+
"caller",
|
|
392
|
+
"Look up the caller ID name (CNAM) for a NANP (+1) phone number. caller is the record verbatim, null when no record or outside NANP. Metered per lookup on a NANP number.",
|
|
393
|
+
{
|
|
394
|
+
number: z.string().describe("Phone number, e.g. +18004633339"),
|
|
395
|
+
country: iso2("country code for national-format numbers").optional()
|
|
396
|
+
},
|
|
397
|
+
(c, a, request) => c.caller(a.number, { ...request, country: a.country })
|
|
398
|
+
);
|
|
399
|
+
tool(
|
|
400
|
+
"hlr",
|
|
401
|
+
"Phone status at the last check: live means assigned and connected means reachable at that check. Cached results may be returned. Deep adds available roaming and network diagnostics in the same metered lookup, including Free allowance units. Null is unconfirmed.",
|
|
402
|
+
{
|
|
403
|
+
number: z.string().describe("Phone number, e.g. +447712345678"),
|
|
404
|
+
country: iso2("country code for national-format numbers").optional(),
|
|
405
|
+
deep: deep.describe("Include available detail within the same metered core unit. No extra charge or paid-plan gate.")
|
|
406
|
+
},
|
|
407
|
+
(c, a, request) => c.hlr(a.number, { ...request, deep: a.deep, country: a.country })
|
|
408
|
+
);
|
|
409
|
+
tool(
|
|
410
|
+
"domain",
|
|
411
|
+
"Check whether a domain is registered. Deep adds registration dates, registrar, status and DNSSEC, included on paid plans. Use dns for DNS records and mx for mail routing.",
|
|
412
|
+
{ domain: z.string().describe("Domain name, e.g. example.com"), deep: deep.describe("Include registration details on a paid plan.") },
|
|
413
|
+
(c, a, request) => c.domain(a.domain, { ...request, deep: a.deep })
|
|
414
|
+
);
|
|
415
|
+
tool(
|
|
416
|
+
"asn",
|
|
417
|
+
"Network name and country for an autonomous system number.",
|
|
418
|
+
{ asn: z.string().describe("Autonomous system number, such as AS13335 or 13335") },
|
|
419
|
+
(c, a, request) => c.asn(a.asn, request)
|
|
420
|
+
);
|
|
421
|
+
tool(
|
|
422
|
+
"mac",
|
|
423
|
+
"Normalize a 48-bit MAC address and return its registered assignment holder, local flag, and multicast flag. Vendor is null for local or multicast addresses.",
|
|
424
|
+
{ mac: z.string().describe("MAC address") },
|
|
425
|
+
(c, a, request) => c.mac(a.mac, request)
|
|
426
|
+
);
|
|
427
|
+
tool(
|
|
428
|
+
"dns",
|
|
429
|
+
"Look up published DNS records with TTLs. Pooled on every plan. Omit type to check all ten supported types. The selected question may include its CNAME chain. Values retain DNS presentation syntax, including TXT quoting.",
|
|
430
|
+
{
|
|
431
|
+
domain: z.string().describe("Domain or DNS name, including service names such as _dmarc.example.com"),
|
|
432
|
+
type: z.enum(["A", "AAAA", "CNAME", "MX", "NS", "TXT", "SOA", "CAA", "SRV", "PTR"]).optional().describe("DNS question type. Omit to check all supported types.")
|
|
433
|
+
},
|
|
434
|
+
(c, a, request) => c.dns(a.domain, { ...request, type: a.type })
|
|
435
|
+
);
|
|
436
|
+
tool(
|
|
437
|
+
"mx",
|
|
438
|
+
"MX records for a domain.",
|
|
439
|
+
{ domain: z.string().describe("Domain name") },
|
|
440
|
+
(c, a, request) => c.mx(a.domain, request)
|
|
441
|
+
);
|
|
442
|
+
tool(
|
|
443
|
+
"useragent",
|
|
444
|
+
"Parse a User-Agent string: browser, OS, device, bot detection.",
|
|
445
|
+
{ ua: z.string().describe("The User-Agent string to parse"), deep },
|
|
446
|
+
(c, a, request) => c.useragent(a.ua, { ...request, deep: a.deep })
|
|
447
|
+
);
|
|
448
|
+
tool(
|
|
449
|
+
"vin",
|
|
450
|
+
"Decode a VIN to year, make, model, trim, body and vehicle type. Paid deep adds specifications, manufacturing detail and recalls.",
|
|
451
|
+
{ vin: z.string().describe("The VIN as you have it. Spaces and punctuation fold out"), deep },
|
|
452
|
+
(c, a, request) => c.vin(a.vin, { ...request, deep: a.deep })
|
|
453
|
+
);
|
|
454
|
+
tool(
|
|
455
|
+
"tariff",
|
|
456
|
+
"Look up a tariff code, description, lineage and general rate. Paid deep adds statistical units and the special and other schedule columns. Optional origin with deep resolves country-specific measures. Without origin, schedule detail is available and origin-dependent fields are null. A null effective rate is not a zero rate.",
|
|
457
|
+
{
|
|
458
|
+
code: z.string().describe("HTS code, 4 to 10 digits, dots optional, e.g. 8471.30.01.00"),
|
|
459
|
+
origin: iso2("country of origin for duty resolution, only read with deep").optional(),
|
|
460
|
+
deep
|
|
461
|
+
},
|
|
462
|
+
(c, a, request) => c.tariff(a.code, { ...request, deep: a.deep, origin: a.origin })
|
|
463
|
+
);
|
|
464
|
+
tool(
|
|
465
|
+
"tariff_search",
|
|
466
|
+
"Search US tariff schedule descriptions by product. Returns up to 20 lines, best match first, each with hts, description, and the general duty rate.",
|
|
467
|
+
{ query: z.string().describe("Product words, e.g. sunglasses, laptop, coffee") },
|
|
468
|
+
(c, a, request) => c.tariff.search(a.query, request)
|
|
469
|
+
);
|
|
470
|
+
tool(
|
|
471
|
+
"naics",
|
|
472
|
+
"Look up a US NAICS 2022 code, title and parent hierarchy. Deep adds definition, children and exclusions on paid plans.",
|
|
473
|
+
{ code: z.string().describe("NAICS code, e.g. 541511 or sector range 31-33"), deep: deep.describe("Include the complete detail bag on a paid plan.") },
|
|
474
|
+
(c, a, request) => c.naics(a.code, { ...request, deep: a.deep })
|
|
475
|
+
);
|
|
476
|
+
tool(
|
|
477
|
+
"naics_search",
|
|
478
|
+
"Search US NAICS 2022 titles and activities. Matching text and corrections stay with the result. Deep adds definition, children and exclusions inside each result on paid plans.",
|
|
479
|
+
{
|
|
480
|
+
query: z.string().min(1).max(100).describe("Industry keywords, e.g. coffee shop"),
|
|
481
|
+
limit: z.number().int().min(1).max(50).optional().describe("Maximum results, 1-50. Default 10."),
|
|
482
|
+
deep: deep.describe("Include the complete detail bag on a paid plan.")
|
|
483
|
+
},
|
|
484
|
+
(c, a, request) => c.naics.search(a.query, { ...request, deep: a.deep, limit: a.limit })
|
|
485
|
+
);
|
|
486
|
+
tool(
|
|
487
|
+
"currency",
|
|
488
|
+
"Currency name, symbols and decimal places. Deep adds numeric code, plural name and using countries on every plan.",
|
|
489
|
+
{ code: z.string().describe("ISO 4217 code, e.g. USD"), deep: deep.describe("Include optional detail on every plan.") },
|
|
490
|
+
(c, a, request) => c.currency(a.code, { ...request, deep: a.deep })
|
|
491
|
+
);
|
|
492
|
+
tool(
|
|
493
|
+
"currency_rate",
|
|
494
|
+
"Reference exchange rate between two currencies. Pass date for a past business day, amount to convert.",
|
|
495
|
+
{
|
|
496
|
+
base: z.string().describe("Base currency ISO 4217 code, e.g. USD"),
|
|
497
|
+
quote: z.string().describe("Quote currency ISO 4217 code, e.g. EUR"),
|
|
498
|
+
date: z.string().optional().describe(
|
|
499
|
+
"YYYY-MM-DD. Official rate for that business day. A weekend or holiday resolves to the last published day on or before it"
|
|
500
|
+
),
|
|
501
|
+
amount: z.number().optional().describe("Appends amount and converted, rounded to the quote currency minor-unit digits")
|
|
502
|
+
},
|
|
503
|
+
(c, a, request) => c.currency.rate(a.base, a.quote, { ...request, date: a.date, amount: a.amount })
|
|
504
|
+
);
|
|
505
|
+
tool(
|
|
506
|
+
"language",
|
|
507
|
+
"Language names, script and writing direction. Deep adds ISO3 and country associations on every plan.",
|
|
508
|
+
{ code: z.string().describe("Language code, e.g. en, ja, gsw"), deep: deep.describe("Include optional detail on every plan.") },
|
|
509
|
+
(c, a, request) => c.language(a.code, { ...request, deep: a.deep })
|
|
510
|
+
);
|
|
511
|
+
tool(
|
|
512
|
+
"name",
|
|
513
|
+
"Parse a name into prefix, first, middle, last and suffix. Paid deep adds dictionary membership, gender evidence, salutation and country associations. Country scopes evidence, never nationality. Junk returns valid false.",
|
|
514
|
+
{
|
|
515
|
+
name: z.string().describe("The name to parse, e.g. Smith, John or BILLY OSHALL"),
|
|
516
|
+
country: z.string().optional().describe("ISO2 country context for gender, e.g. IT"),
|
|
517
|
+
deep: deep.describe("Include the complete detail bag on a paid plan.")
|
|
518
|
+
},
|
|
519
|
+
(c, a, request) => c.name(a.name, { ...request, deep: a.deep, country: a.country })
|
|
520
|
+
);
|
|
521
|
+
tool(
|
|
522
|
+
"time",
|
|
523
|
+
"Current local time, Unix seconds, exact UTC offset and DST. Omit timezone for UTC or pass both coordinates. at selects the moment; to converts it. Deep adds friendly name, numeric offsets and the next source clock transition on every plan.",
|
|
524
|
+
{
|
|
525
|
+
timezone: z.string().min(1).optional().describe("IANA timezone, e.g. America/New_York. Omit for UTC when coordinates are absent"),
|
|
526
|
+
lat: lat.optional(),
|
|
527
|
+
lon: lon.optional(),
|
|
528
|
+
at: z.string().min(1).optional().describe("ISO 8601 time, default now. With to, a time without a UTC offset is source wall time. Otherwise it is UTC. Include an offset to disambiguate a repeated local time"),
|
|
529
|
+
to: z.string().min(1).optional().describe("Destination IANA timezone, e.g. Asia/Tokyo. Returns to.at and to.unix at the same instant"),
|
|
530
|
+
deep: deep.describe("Include optional detail on every plan.")
|
|
531
|
+
},
|
|
532
|
+
(c, a, request) => a.lat !== void 0 && a.lon !== void 0 ? c.time.at(a.lat, a.lon, { ...request, deep: a.deep, at: a.at, to: a.to }) : c.time(a.timezone, { ...request, deep: a.deep, at: a.at, to: a.to }),
|
|
533
|
+
(schema) => schema.refine(
|
|
534
|
+
(a) => a.timezone !== void 0 ? a.lat === void 0 && a.lon === void 0 : a.lat === void 0 === (a.lon === void 0),
|
|
535
|
+
{ message: "Pass a timezone, both lat and lon, or neither for UTC." }
|
|
536
|
+
)
|
|
537
|
+
);
|
|
538
|
+
tool(
|
|
539
|
+
"timezone",
|
|
540
|
+
"Compatibility tool; use time for new integrations. Look up a timezone from an IANA id or from lat and lon. Offset, DST, local time. Pass at for a specific instant. Pass to with another IANA id to convert a time between zones: the response appends at (wall time in the from zone) and to.at (the converted time). Open ocean answers the nautical Etc/GMT zone.",
|
|
541
|
+
{
|
|
542
|
+
timezone: z.string().min(1).optional().describe("IANA timezone id, e.g. America/New_York"),
|
|
543
|
+
lat: lat.optional(),
|
|
544
|
+
lon: lon.optional(),
|
|
545
|
+
at: z.string().optional().describe(
|
|
546
|
+
"ISO 8601 time, default now. With to and no UTC offset, reads as wall time in the from zone"
|
|
547
|
+
),
|
|
548
|
+
to: z.string().optional().describe("Convert: the other IANA zone, e.g. Asia/Tokyo. Requires timezone, not lat/lon")
|
|
549
|
+
},
|
|
550
|
+
(c, a, request) => {
|
|
551
|
+
if (a.lat != null && a.lon != null) {
|
|
552
|
+
return c.timezone.at(a.lat, a.lon, { ...request, at: a.at });
|
|
553
|
+
}
|
|
554
|
+
if (!a.timezone) {
|
|
555
|
+
return Promise.reject(new Error("Pass timezone or lat and lon"));
|
|
556
|
+
}
|
|
557
|
+
return c.timezone(a.timezone, { ...request, at: a.at, to: a.to });
|
|
558
|
+
},
|
|
559
|
+
(schema) => schema.refine(
|
|
560
|
+
(a) => a.timezone !== void 0 ? a.lat === void 0 && a.lon === void 0 : a.lat !== void 0 && a.lon !== void 0 && a.to === void 0,
|
|
561
|
+
{ message: "Pass either timezone (with optional to), or both lat and lon." }
|
|
562
|
+
)
|
|
563
|
+
);
|
|
564
|
+
tool(
|
|
565
|
+
"date",
|
|
566
|
+
"Parse a date to ISO date, validity and Unix midnight. Ambiguous numeric dates need format. to adds signed days between; omit date for UTC today. Deep adds calendar details on every plan.",
|
|
567
|
+
{
|
|
568
|
+
date: z.string().min(1).optional().describe("The date as you have it, any common format. Omit for today (UTC)"),
|
|
569
|
+
format: z.enum(["mdy", "dmy"]).optional().describe("Breaks the month-first / day-first tie on numeric dates like 03/04/2026"),
|
|
570
|
+
to: z.string().optional().describe("Another date. Appends to (normalized ISO) and days (signed days between)"),
|
|
571
|
+
deep: deep.describe("Include optional detail on every plan.")
|
|
572
|
+
},
|
|
573
|
+
(c, a, request) => {
|
|
574
|
+
if (a.date == null) return c.date.today({ ...request, deep: a.deep, to: a.to });
|
|
575
|
+
return c.date(a.date, { ...request, deep: a.deep, format: a.format, to: a.to });
|
|
576
|
+
},
|
|
577
|
+
(schema) => schema.refine(
|
|
578
|
+
(a) => a.format === void 0 || a.date !== void 0,
|
|
579
|
+
{ message: "Pass date when specifying format; omit both for today." }
|
|
580
|
+
)
|
|
581
|
+
);
|
|
582
|
+
tool(
|
|
583
|
+
"holiday",
|
|
584
|
+
"Public holidays and cultural observances for a country and year. Each row carries type: public or observance.",
|
|
585
|
+
{
|
|
586
|
+
country: iso2("country code"),
|
|
587
|
+
year: z.number().int().optional().describe("Year, default current")
|
|
588
|
+
},
|
|
589
|
+
(c, a, request) => c.holiday(a.country, { ...request, year: a.year })
|
|
590
|
+
);
|
|
591
|
+
tool(
|
|
592
|
+
"holiday_date",
|
|
593
|
+
"Whether a specific date is a holiday or observance in a country. holiday is null when it is not.",
|
|
594
|
+
{ country: iso2("country code"), date: z.string().describe("Date as YYYY-MM-DD") },
|
|
595
|
+
(c, a, request) => c.holiday.date(a.country, a.date, request)
|
|
596
|
+
);
|
|
597
|
+
tool(
|
|
598
|
+
"emoji",
|
|
599
|
+
"Resolve an emoji character, shortcode or name. Deep adds encoding, keywords and skin variants on every plan.",
|
|
600
|
+
{ emoji: z.string().describe("Emoji name or the character itself, e.g. rocket"), deep: deep.describe("Include optional detail on every plan.") },
|
|
601
|
+
(c, a, request) => c.emoji(a.emoji, { ...request, deep: a.deep })
|
|
602
|
+
);
|
|
603
|
+
tool(
|
|
604
|
+
"emoji_search",
|
|
605
|
+
"Search emoji by keyword. Deep adds encoding and skin-variant detail inside each result on every plan.",
|
|
606
|
+
{
|
|
607
|
+
query: z.string().describe("Search keyword, e.g. fire"),
|
|
608
|
+
limit: z.number().int().min(1).max(50).optional().describe("Max results"),
|
|
609
|
+
deep: deep.describe("Include optional detail on every plan.")
|
|
610
|
+
},
|
|
611
|
+
(c, a, request) => c.emoji.search(a.query, { ...request, deep: a.deep, limit: a.limit })
|
|
612
|
+
);
|
|
613
|
+
return server;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
export {
|
|
617
|
+
VERSION,
|
|
618
|
+
buildServer
|
|
619
|
+
};
|
package/dist/http.js
CHANGED
package/dist/registry.js
CHANGED
package/dist/stdio.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "parseapi-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"mcpName": "com.parseapi/mcp",
|
|
5
5
|
"description": "Official ParseAPI MCP server. Look up places, addresses, company numbers, email, phone, weather, dates and more.",
|
|
6
6
|
"keywords": [
|
|
@@ -47,12 +47,15 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@modelcontextprotocol/server": "^2.0.0",
|
|
49
49
|
"@modelcontextprotocol/node": "^2.0.0",
|
|
50
|
-
"@parseapi/sdk": "^0.
|
|
50
|
+
"@parseapi/sdk": "^0.4.0",
|
|
51
51
|
"zod": "^4.0.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/node": "^22.10.0",
|
|
55
55
|
"tsup": "^8.3.5",
|
|
56
56
|
"typescript": "^5.7.0"
|
|
57
|
+
},
|
|
58
|
+
"overrides": {
|
|
59
|
+
"esbuild": "0.27.2"
|
|
57
60
|
}
|
|
58
61
|
}
|
package/dist/chunk-BR6YLDUP.js
DELETED
|
@@ -1,528 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// src/registry.ts
|
|
4
|
-
import { McpServer } from "@modelcontextprotocol/server";
|
|
5
|
-
import { parseAPI } from "@parseapi/sdk";
|
|
6
|
-
import * as z from "zod";
|
|
7
|
-
|
|
8
|
-
// src/errors.ts
|
|
9
|
-
import { ParseAPIError } from "@parseapi/sdk";
|
|
10
|
-
function ok(data) {
|
|
11
|
-
return { content: [{ type: "text", text: JSON.stringify(data) }] };
|
|
12
|
-
}
|
|
13
|
-
function errorJson(code, message, docs, requestId) {
|
|
14
|
-
return {
|
|
15
|
-
isError: true,
|
|
16
|
-
content: [{ type: "text", text: JSON.stringify({ code, message, docs, request_id: requestId }) }]
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
function toErrorResult(err) {
|
|
20
|
-
if (err instanceof ParseAPIError) {
|
|
21
|
-
return errorJson(err.code, err.message, err.docs, err.requestId);
|
|
22
|
-
}
|
|
23
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
24
|
-
return errorJson("network_error", message, null, null);
|
|
25
|
-
}
|
|
26
|
-
function noKeyResult(transport) {
|
|
27
|
-
const where = transport === "stdio" ? "set it as the PARSEAPI_KEY environment variable for this MCP server" : "send it in the X-API-Key header";
|
|
28
|
-
return errorJson(
|
|
29
|
-
"invalid_api_key",
|
|
30
|
-
`No API key. Get a free key at https://parseapi.com and ${where}.`,
|
|
31
|
-
"https://parseapi.com/docs#invalid_api_key",
|
|
32
|
-
null
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// src/registry.ts
|
|
37
|
-
var VERSION = "0.3.2";
|
|
38
|
-
var deep = z.boolean().optional().describe("Include the nested deep object when available. Pricing depends on the operation.");
|
|
39
|
-
var lat = z.number().min(-90).max(90).describe("Latitude in decimal degrees");
|
|
40
|
-
var lon = z.number().min(-180).max(180).describe("Longitude in decimal degrees");
|
|
41
|
-
var iso2 = (what) => z.string().describe(`ISO 3166-1 alpha-2 ${what}, e.g. US`);
|
|
42
|
-
var countryOpt = z.string().optional().describe("ISO2, ISO3, or a country name. Optional when the lookup is unique.");
|
|
43
|
-
function buildServer(key, transport) {
|
|
44
|
-
const server = new McpServer(
|
|
45
|
-
{
|
|
46
|
-
name: "parseapi",
|
|
47
|
-
version: VERSION,
|
|
48
|
-
title: "ParseAPI",
|
|
49
|
-
description: "Lookups for agents: IP and place data, addresses, company numbers, email, VAT, IBAN, NPI, phone, domains, weather, currency, timezones, dates and holidays. Real reference data instead of guessing.",
|
|
50
|
-
websiteUrl: "https://parseapi.com"
|
|
51
|
-
},
|
|
52
|
-
{ capabilities: { tools: {} } }
|
|
53
|
-
);
|
|
54
|
-
const parse = key ? parseAPI(key) : null;
|
|
55
|
-
function tool(name, description, shape, fn, refine) {
|
|
56
|
-
server.registerTool(
|
|
57
|
-
name,
|
|
58
|
-
{
|
|
59
|
-
description,
|
|
60
|
-
inputSchema: refine ? refine(z.object(shape)) : z.object(shape),
|
|
61
|
-
annotations: { readOnlyHint: true }
|
|
62
|
-
},
|
|
63
|
-
async (args, context) => {
|
|
64
|
-
if (!parse) return noKeyResult(transport);
|
|
65
|
-
try {
|
|
66
|
-
return ok(await fn(parse, args, { signal: context.mcpReq.signal }));
|
|
67
|
-
} catch (err) {
|
|
68
|
-
return toErrorResult(err);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
tool(
|
|
74
|
-
"ip",
|
|
75
|
-
"Look up an IPv4 or IPv6 address: country, region, ASN, timezone. Deep adds datacenter, relay, tor and vpn flags.",
|
|
76
|
-
{ ip: z.string().describe("IPv4 or IPv6 address, e.g. 8.8.8.8"), deep },
|
|
77
|
-
(c, a, request) => c.ip(a.ip, { ...request, deep: a.deep })
|
|
78
|
-
);
|
|
79
|
-
if (transport === "stdio") {
|
|
80
|
-
tool(
|
|
81
|
-
"ip_self",
|
|
82
|
-
"Look up the public IP of the machine running this MCP server.",
|
|
83
|
-
{ deep },
|
|
84
|
-
(c, a, request) => c.ip.self({ ...request, deep: a.deep })
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
tool(
|
|
88
|
-
"continent",
|
|
89
|
-
"Look up a continent by code: name, area, population.",
|
|
90
|
-
{ code: z.string().describe("Continent code: AF, AN, AS, EU, NA, OC, SA") },
|
|
91
|
-
(c, a, request) => c.continent(a.code, request)
|
|
92
|
-
);
|
|
93
|
-
tool(
|
|
94
|
-
"continent_countries",
|
|
95
|
-
"List every country on a continent.",
|
|
96
|
-
{ code: z.string().describe("Continent code: AF, AN, AS, EU, NA, OC, SA") },
|
|
97
|
-
(c, a, request) => c.continent.countries(a.code, request)
|
|
98
|
-
);
|
|
99
|
-
tool(
|
|
100
|
-
"bloc",
|
|
101
|
-
"Look up a country group by code: EU, EEA, Schengen, Eurozone, SEPA, NATO, and more. Returns the official name and the current member count.",
|
|
102
|
-
{
|
|
103
|
-
code: z.string().describe("Bloc code: EU, EEA, EFTA, SCHENGEN, EUROZONE, SEPA, NATO, OECD, G7, ASEAN, GCC, MERCOSUR")
|
|
104
|
-
},
|
|
105
|
-
(c, a, request) => c.bloc(a.code, request)
|
|
106
|
-
);
|
|
107
|
-
tool(
|
|
108
|
-
"bloc_countries",
|
|
109
|
-
"List the current members of a country group, each with name, flag, and calling code.",
|
|
110
|
-
{
|
|
111
|
-
code: z.string().describe("Bloc code: EU, EEA, EFTA, SCHENGEN, EUROZONE, SEPA, NATO, OECD, G7, ASEAN, GCC, MERCOSUR")
|
|
112
|
-
},
|
|
113
|
-
(c, a, request) => c.bloc.countries(a.code, request)
|
|
114
|
-
);
|
|
115
|
-
tool(
|
|
116
|
-
"country",
|
|
117
|
-
"Look up a country: names, capital, currency, languages, calling code, timezones.",
|
|
118
|
-
{ code: iso2("country code") },
|
|
119
|
-
(c, a, request) => c.country(a.code, request)
|
|
120
|
-
);
|
|
121
|
-
tool(
|
|
122
|
-
"country_states",
|
|
123
|
-
"List the states, provinces or regions of a country.",
|
|
124
|
-
{ code: iso2("country code") },
|
|
125
|
-
(c, a, request) => c.country.states(a.code, request)
|
|
126
|
-
);
|
|
127
|
-
tool(
|
|
128
|
-
"state",
|
|
129
|
-
"Look up a state, province or region by code or name. Unique names resolve without a country. A colliding code 404s asking for ?country=. Country takes ISO2, ISO3, or a name.",
|
|
130
|
-
{
|
|
131
|
-
code: z.string().describe("State code or name, e.g. colorado, NC"),
|
|
132
|
-
country: countryOpt
|
|
133
|
-
},
|
|
134
|
-
(c, a, request) => c.state(a.code, { ...request, country: a.country })
|
|
135
|
-
);
|
|
136
|
-
tool(
|
|
137
|
-
"state_districts",
|
|
138
|
-
"List the districts, counties or departments of a state.",
|
|
139
|
-
{
|
|
140
|
-
code: z.string().describe("State code or name, e.g. NC, colorado"),
|
|
141
|
-
country: countryOpt
|
|
142
|
-
},
|
|
143
|
-
(c, a, request) => c.state.districts(a.code, { ...request, country: a.country })
|
|
144
|
-
);
|
|
145
|
-
tool(
|
|
146
|
-
"district",
|
|
147
|
-
"Look up a district, county or department by code or name. Pass state when a name collides.",
|
|
148
|
-
{
|
|
149
|
-
code: z.string().describe("District code or name, e.g. 37081, guilford county"),
|
|
150
|
-
country: countryOpt,
|
|
151
|
-
state: z.string().optional().describe("ADM1 code or name to disambiguate, e.g. NC or louisiana")
|
|
152
|
-
},
|
|
153
|
-
(c, a, request) => c.district(a.code, { ...request, country: a.country, state: a.state })
|
|
154
|
-
);
|
|
155
|
-
tool(
|
|
156
|
-
"city",
|
|
157
|
-
"Look up a city by name: type, capital status (capital_of), district, elevation, area in km2, coordinates, timezone. Pass country or state to disambiguate name ties.",
|
|
158
|
-
{
|
|
159
|
-
name: z.string().describe("City name, e.g. charlotte"),
|
|
160
|
-
country: countryOpt,
|
|
161
|
-
state: z.string().optional().describe("State code to disambiguate, e.g. NC")
|
|
162
|
-
},
|
|
163
|
-
(c, a, request) => c.city(a.name, { ...request, country: a.country, state: a.state })
|
|
164
|
-
);
|
|
165
|
-
tool(
|
|
166
|
-
"city_id",
|
|
167
|
-
"Refetch a city by its stable parse id from an earlier response.",
|
|
168
|
-
{ id: z.string().describe("Stable city id, e.g. city_mb8mbqrkz8zb") },
|
|
169
|
-
(c, a, request) => c.city.id(a.id, request)
|
|
170
|
-
);
|
|
171
|
-
tool(
|
|
172
|
-
"city_search",
|
|
173
|
-
"Search cities by name prefix. Use when the exact name is unknown.",
|
|
174
|
-
{
|
|
175
|
-
query: z.string().describe("Name prefix, e.g. char"),
|
|
176
|
-
country: countryOpt,
|
|
177
|
-
state: z.string().optional().describe("State code filter"),
|
|
178
|
-
limit: z.number().int().min(1).max(50).optional().describe("Max results")
|
|
179
|
-
},
|
|
180
|
-
(c, a, request) => c.city.search(a.query, { ...request, country: a.country, state: a.state, limit: a.limit })
|
|
181
|
-
);
|
|
182
|
-
tool(
|
|
183
|
-
"city_nearest",
|
|
184
|
-
"Find the nearest city to coordinates.",
|
|
185
|
-
{ lat, lon },
|
|
186
|
-
(c, a, request) => c.city.nearest(a.lat, a.lon, request)
|
|
187
|
-
);
|
|
188
|
-
tool(
|
|
189
|
-
"city_nearby",
|
|
190
|
-
"List cities around a named city, nearest first, with distance. Default radius 40 km.",
|
|
191
|
-
{
|
|
192
|
-
name: z.string().describe("Anchor city name, e.g. denver"),
|
|
193
|
-
country: countryOpt,
|
|
194
|
-
state: z.string().optional().describe("State code to disambiguate the anchor"),
|
|
195
|
-
radius: z.number().positive().optional().describe("Search radius, default 40 km"),
|
|
196
|
-
unit: z.enum(["km", "mi"]).optional().describe("Radius unit, default km"),
|
|
197
|
-
limit: z.number().int().min(1).max(50).optional().describe("Max results, default 10")
|
|
198
|
-
},
|
|
199
|
-
(c, a, request) => c.city.nearby(a.name, {
|
|
200
|
-
...request,
|
|
201
|
-
country: a.country,
|
|
202
|
-
state: a.state,
|
|
203
|
-
radius: a.radius,
|
|
204
|
-
unit: a.unit,
|
|
205
|
-
limit: a.limit
|
|
206
|
-
})
|
|
207
|
-
);
|
|
208
|
-
tool(
|
|
209
|
-
"postal",
|
|
210
|
-
"Look up a postal or ZIP code: place name, country name, coordinates, state, district, area, timezone, elevation. Unique codes resolve without a country. A collision 404s asking for ?country=. Never defaults to US.",
|
|
211
|
-
{
|
|
212
|
-
code: z.string().describe("Postal or ZIP code, e.g. SW1A 1AA, 28202"),
|
|
213
|
-
country: countryOpt
|
|
214
|
-
},
|
|
215
|
-
(c, a, request) => c.postal(a.code, { ...request, country: a.country })
|
|
216
|
-
);
|
|
217
|
-
tool(
|
|
218
|
-
"postal_nearby",
|
|
219
|
-
"List postal codes near a given one, sorted by distance. Unique codes resolve without a country.",
|
|
220
|
-
{
|
|
221
|
-
code: z.string().describe("Postal code to search around"),
|
|
222
|
-
country: countryOpt,
|
|
223
|
-
radius: z.number().positive().optional().describe("Search radius"),
|
|
224
|
-
unit: z.enum(["km", "mi"]).optional().describe("Radius unit, default km")
|
|
225
|
-
},
|
|
226
|
-
(c, a, request) => c.postal.nearby(a.code, { ...request, country: a.country, radius: a.radius, unit: a.unit })
|
|
227
|
-
);
|
|
228
|
-
tool(
|
|
229
|
-
"postal_distance",
|
|
230
|
-
"Distance between two postal codes in the same country. Unique codes resolve without a country.",
|
|
231
|
-
{
|
|
232
|
-
from: z.string().describe("First postal code"),
|
|
233
|
-
to: z.string().describe("Second postal code"),
|
|
234
|
-
country: countryOpt
|
|
235
|
-
},
|
|
236
|
-
(c, a, request) => c.postal.distance(a.from, a.to, { ...request, country: a.country })
|
|
237
|
-
);
|
|
238
|
-
tool(
|
|
239
|
-
"address",
|
|
240
|
-
"Look up a US or French street address: house number, street, unit, city, state, postal code and registration status. Registration does not establish deliverability or verify an apartment. Deep is currently an empty object.",
|
|
241
|
-
{
|
|
242
|
-
address: z.string().describe("Street address, e.g. 1600 Pennsylvania Ave NW, Washington, DC 20500"),
|
|
243
|
-
country: z.string().optional().describe("Country: US or FR. Use FR or a written France suffix for France. Defaults to US."),
|
|
244
|
-
deep
|
|
245
|
-
},
|
|
246
|
-
(c, a, request) => c.address(a.address, { ...request, country: a.country, deep: a.deep })
|
|
247
|
-
);
|
|
248
|
-
tool(
|
|
249
|
-
"address_search",
|
|
250
|
-
"Search US or French street addresses from a partial address. Postal code, city, state and user IP can narrow or rank matches. French search requires country FR and either postal or city.",
|
|
251
|
-
{
|
|
252
|
-
query: z.string().describe("Partial street address, e.g. 1600 Pennsylvania"),
|
|
253
|
-
country: z.string().optional().describe("Country: US or FR. Defaults to US."),
|
|
254
|
-
postal: z.string().optional().describe("Postal code filter"),
|
|
255
|
-
city: z.string().optional().describe("City filter"),
|
|
256
|
-
state: z.string().optional().describe("State code filter"),
|
|
257
|
-
ip: z.string().optional().describe("User IP address for ranking nearby matches")
|
|
258
|
-
},
|
|
259
|
-
(c, a, request) => c.address.search(a.query, { ...request, country: a.country, postal: a.postal, city: a.city, state: a.state, ip: a.ip })
|
|
260
|
-
);
|
|
261
|
-
tool(
|
|
262
|
-
"company",
|
|
263
|
-
"Look up a company registration number: validity, registration status, name, activity and address when available. Pass country when more than one scheme can match. Deep adds country, postal and city data.",
|
|
264
|
-
{
|
|
265
|
-
number: z.string().describe("Company registration number, e.g. 552100554 with country FR"),
|
|
266
|
-
country: countryOpt,
|
|
267
|
-
deep
|
|
268
|
-
},
|
|
269
|
-
(c, a, request) => c.company(a.number, { ...request, country: a.country, deep: a.deep })
|
|
270
|
-
);
|
|
271
|
-
tool(
|
|
272
|
-
"point",
|
|
273
|
-
"Reverse geocode coordinates to country, state, district and nearest city. Deep adds richer admin data.",
|
|
274
|
-
{ lat, lon, deep },
|
|
275
|
-
(c, a, request) => c.point(a.lat, a.lon, { ...request, deep: a.deep })
|
|
276
|
-
);
|
|
277
|
-
tool(
|
|
278
|
-
"elevation",
|
|
279
|
-
"Elevation in meters at coordinates.",
|
|
280
|
-
{ lat, lon },
|
|
281
|
-
(c, a, request) => c.elevation(a.lat, a.lon, request)
|
|
282
|
-
);
|
|
283
|
-
tool(
|
|
284
|
-
"weather",
|
|
285
|
-
"Current weather observation at coordinates. Every measurement ships metric and imperial side by side. Deep adds minute-by-minute rain, hourly and daily rows worldwide, alerts, and air quality. With deep, date returns a past day as deep.history.",
|
|
286
|
-
{
|
|
287
|
-
lat,
|
|
288
|
-
lon,
|
|
289
|
-
deep,
|
|
290
|
-
date: z.string().optional().describe("A past UTC day, YYYY-MM-DD. Requires deep. Returns that day as deep.history")
|
|
291
|
-
},
|
|
292
|
-
(c, a, request) => c.weather(a.lat, a.lon, { ...request, deep: a.deep, date: a.date })
|
|
293
|
-
);
|
|
294
|
-
tool(
|
|
295
|
-
"email",
|
|
296
|
-
"Validate an email address: syntax, domain, MX, disposable, role, and a typo suggestion when the host looks misspelled. Deep runs a live mailbox verification.",
|
|
297
|
-
{ email: z.string().describe("Email address to validate"), deep },
|
|
298
|
-
(c, a, request) => c.email(a.email, { ...request, deep: a.deep })
|
|
299
|
-
);
|
|
300
|
-
tool(
|
|
301
|
-
"vat",
|
|
302
|
-
"Validate a VAT number: format and checksum on every call. Deep asks the live EU registry for registered, legal name, and address. Pass from with your own VAT for a consultation identifier.",
|
|
303
|
-
{
|
|
304
|
-
number: z.string().describe("VAT number, with or without the country prefix"),
|
|
305
|
-
country: iso2("country code when the number has no prefix").optional(),
|
|
306
|
-
from: z.string().optional().describe("Your own VAT number. Returns a consultation identifier for your audit file"),
|
|
307
|
-
deep
|
|
308
|
-
},
|
|
309
|
-
(c, a, request) => c.vat(a.number, { ...request, country: a.country, from: a.from, deep: a.deep })
|
|
310
|
-
);
|
|
311
|
-
tool(
|
|
312
|
-
"iban",
|
|
313
|
-
"Parse an IBAN: checksum and structure. Returns the normalized number, the print form for display, country, checksum digits, bank, branch, and account identifiers, plus bank_name and bic when available. Junk answers valid false, never a 404. Pass country when the value has no prefix.",
|
|
314
|
-
{
|
|
315
|
-
iban: z.string().describe("IBAN, with or without spaces, with or without the country prefix"),
|
|
316
|
-
country: iso2("country code when the number has no prefix").optional()
|
|
317
|
-
},
|
|
318
|
-
(c, a, request) => c.iban(a.iban, { ...request, country: a.country })
|
|
319
|
-
);
|
|
320
|
-
tool(
|
|
321
|
-
"npi",
|
|
322
|
-
"Look up a US healthcare provider by NPI: name, specialty, practice address, deactivation date, and exclusion status. Deep adds Medicare enrollment on paid plans.",
|
|
323
|
-
{
|
|
324
|
-
npi: z.string().describe("10-digit NPI number"),
|
|
325
|
-
deep
|
|
326
|
-
},
|
|
327
|
-
(c, a, request) => c.npi(a.npi, { ...request, deep: a.deep })
|
|
328
|
-
);
|
|
329
|
-
tool(
|
|
330
|
-
"phone",
|
|
331
|
-
"Validate and parse a phone number: country, type, area-code state, timezone, formats. Pass country for national-format numbers.",
|
|
332
|
-
{
|
|
333
|
-
number: z.string().describe("Phone number, e.g. +14155552671"),
|
|
334
|
-
country: iso2("country code for national-format numbers").optional(),
|
|
335
|
-
deep
|
|
336
|
-
},
|
|
337
|
-
(c, a, request) => c.phone(a.number, { ...request, country: a.country, deep: a.deep })
|
|
338
|
-
);
|
|
339
|
-
tool(
|
|
340
|
-
"carrier",
|
|
341
|
-
"Look up the current carrier serving a phone number: carrier name, network type including voip, burner app flag, issuing city and state. Metered per lookup on a valid number.",
|
|
342
|
-
{
|
|
343
|
-
number: z.string().describe("Phone number, e.g. +14155552671"),
|
|
344
|
-
country: iso2("country code for national-format numbers").optional()
|
|
345
|
-
},
|
|
346
|
-
(c, a, request) => c.carrier(a.number, { ...request, country: a.country })
|
|
347
|
-
);
|
|
348
|
-
tool(
|
|
349
|
-
"caller",
|
|
350
|
-
"Look up the caller ID name (CNAM) for a US or Canada phone number. caller is the record verbatim, null when no record or outside NANP. Metered per lookup on a NANP number.",
|
|
351
|
-
{
|
|
352
|
-
number: z.string().describe("Phone number, e.g. +18004633339"),
|
|
353
|
-
country: iso2("country code for national-format numbers").optional()
|
|
354
|
-
},
|
|
355
|
-
(c, a, request) => c.caller(a.number, { ...request, country: a.country })
|
|
356
|
-
);
|
|
357
|
-
tool(
|
|
358
|
-
"hlr",
|
|
359
|
-
"Live network status for a phone number worldwide: live means assigned, connected means the handset is reachable right now. Outside North America adds roaming and network details. Metered per lookup on a valid number.",
|
|
360
|
-
{
|
|
361
|
-
number: z.string().describe("Phone number, e.g. +447712345678"),
|
|
362
|
-
country: iso2("country code for national-format numbers").optional()
|
|
363
|
-
},
|
|
364
|
-
(c, a, request) => c.hlr(a.number, { ...request, country: a.country })
|
|
365
|
-
);
|
|
366
|
-
tool(
|
|
367
|
-
"domain",
|
|
368
|
-
"Look up a domain: registration, DNS, mail setup. Deep adds richer checks.",
|
|
369
|
-
{ domain: z.string().describe("Domain name, e.g. example.com"), deep },
|
|
370
|
-
(c, a, request) => c.domain(a.domain, { ...request, deep: a.deep })
|
|
371
|
-
);
|
|
372
|
-
tool(
|
|
373
|
-
"asn",
|
|
374
|
-
"Network name and country for an autonomous system number.",
|
|
375
|
-
{ asn: z.string().describe("Autonomous system number, such as AS13335 or 13335") },
|
|
376
|
-
(c, a, request) => c.asn(a.asn, request)
|
|
377
|
-
);
|
|
378
|
-
tool(
|
|
379
|
-
"mac",
|
|
380
|
-
"Normalize a 48-bit MAC address and return its registered assignment holder, local flag, and multicast flag. Vendor is null for local or multicast addresses.",
|
|
381
|
-
{ mac: z.string().describe("MAC address") },
|
|
382
|
-
(c, a, request) => c.mac(a.mac, request)
|
|
383
|
-
);
|
|
384
|
-
tool(
|
|
385
|
-
"mx",
|
|
386
|
-
"MX records for a domain.",
|
|
387
|
-
{ domain: z.string().describe("Domain name") },
|
|
388
|
-
(c, a, request) => c.mx(a.domain, request)
|
|
389
|
-
);
|
|
390
|
-
tool(
|
|
391
|
-
"useragent",
|
|
392
|
-
"Parse a User-Agent string: browser, OS, device, bot detection.",
|
|
393
|
-
{ ua: z.string().describe("The User-Agent string to parse"), deep },
|
|
394
|
-
(c, a, request) => c.useragent(a.ua, { ...request, deep: a.deep })
|
|
395
|
-
);
|
|
396
|
-
tool(
|
|
397
|
-
"vin",
|
|
398
|
-
"Decode a 17-character VIN: year, make, model, trim, body, engine, drive, transmission, manufacturer, and assembly plant. Junk or a failed check digit answers valid false, never a 404. Deep adds open recall campaigns on paid plans.",
|
|
399
|
-
{ vin: z.string().describe("The VIN as you have it. Spaces and punctuation fold out"), deep },
|
|
400
|
-
(c, a, request) => c.vin(a.vin, { ...request, deep: a.deep })
|
|
401
|
-
);
|
|
402
|
-
tool(
|
|
403
|
-
"tariff",
|
|
404
|
-
"US import duty. Look up an HTS code: description, duty rates verbatim (general, special, column 2), units, parent lineage, and the official revision that answered. Deep with an origin country resolves the Chapter 99 tariff measures that apply from that origin, with a composed effective_rate when the components compose cleanly (null otherwise, null beats a guess). Unknown code is a 404. US schedule only.",
|
|
405
|
-
{
|
|
406
|
-
code: z.string().describe("HTS code, 4 to 10 digits, dots optional, e.g. 8471.30.01.00"),
|
|
407
|
-
origin: iso2("country of origin for duty resolution, only read with deep").optional(),
|
|
408
|
-
deep
|
|
409
|
-
},
|
|
410
|
-
(c, a, request) => c.tariff(a.code, { ...request, deep: a.deep, origin: a.origin })
|
|
411
|
-
);
|
|
412
|
-
tool(
|
|
413
|
-
"tariff_search",
|
|
414
|
-
"Search US tariff schedule descriptions by product. Returns up to 20 lines, best match first, each with hts, description, and the general duty rate.",
|
|
415
|
-
{ query: z.string().describe("Product words, e.g. sunglasses, laptop, coffee") },
|
|
416
|
-
(c, a, request) => c.tariff.search(a.query, request)
|
|
417
|
-
);
|
|
418
|
-
tool(
|
|
419
|
-
"currency",
|
|
420
|
-
"Look up a currency: name, symbol, decimal places, countries using it.",
|
|
421
|
-
{ code: z.string().describe("ISO 4217 code, e.g. USD") },
|
|
422
|
-
(c, a, request) => c.currency(a.code, request)
|
|
423
|
-
);
|
|
424
|
-
tool(
|
|
425
|
-
"currency_rate",
|
|
426
|
-
"Reference exchange rate between two currencies. Pass date for a past business day, amount to convert.",
|
|
427
|
-
{
|
|
428
|
-
base: z.string().describe("Base currency ISO 4217 code, e.g. USD"),
|
|
429
|
-
quote: z.string().describe("Quote currency ISO 4217 code, e.g. EUR"),
|
|
430
|
-
date: z.string().optional().describe(
|
|
431
|
-
"YYYY-MM-DD. Official rate for that business day. A weekend or holiday resolves to the last published day on or before it"
|
|
432
|
-
),
|
|
433
|
-
amount: z.number().optional().describe("Appends amount and converted, rounded to the quote currency minor-unit digits")
|
|
434
|
-
},
|
|
435
|
-
(c, a, request) => c.currency.rate(a.base, a.quote, { ...request, date: a.date, amount: a.amount })
|
|
436
|
-
);
|
|
437
|
-
tool(
|
|
438
|
-
"language",
|
|
439
|
-
"Look up a language by BCP 47 or ISO 639-3 code: names, script, direction.",
|
|
440
|
-
{ code: z.string().describe("Language code, e.g. en, ja, gsw") },
|
|
441
|
-
(c, a, request) => c.language(a.code, request)
|
|
442
|
-
);
|
|
443
|
-
tool(
|
|
444
|
-
"name",
|
|
445
|
-
"Parse a person name: prefix, first, middle, last, suffix, gender, salutation. Junk input returns valid false. Gender comes from dictionary data and is null when the data does not decide.",
|
|
446
|
-
{ name: z.string().describe("The name to parse, e.g. Smith, John or BILLY OSHALL") },
|
|
447
|
-
(c, a, request) => c.name(a.name, request)
|
|
448
|
-
);
|
|
449
|
-
tool(
|
|
450
|
-
"timezone",
|
|
451
|
-
"Look up a timezone from an IANA id or from lat and lon. Offset, DST, local time. Pass at for a specific instant. Pass to with another IANA id to convert a time between zones: the response appends at (wall time in the from zone) and to.at (the converted time). Open ocean answers the nautical Etc/GMT zone.",
|
|
452
|
-
{
|
|
453
|
-
timezone: z.string().min(1).optional().describe("IANA timezone id, e.g. America/New_York"),
|
|
454
|
-
lat: lat.optional(),
|
|
455
|
-
lon: lon.optional(),
|
|
456
|
-
at: z.string().optional().describe(
|
|
457
|
-
"ISO 8601 time, default now. With to and no UTC offset, reads as wall time in the from zone"
|
|
458
|
-
),
|
|
459
|
-
to: z.string().optional().describe("Convert: the other IANA zone, e.g. Asia/Tokyo. Requires timezone, not lat/lon")
|
|
460
|
-
},
|
|
461
|
-
(c, a, request) => {
|
|
462
|
-
if (a.lat != null && a.lon != null) {
|
|
463
|
-
return c.timezone.at(a.lat, a.lon, { ...request, at: a.at });
|
|
464
|
-
}
|
|
465
|
-
if (!a.timezone) {
|
|
466
|
-
return Promise.reject(new Error("Pass timezone or lat and lon"));
|
|
467
|
-
}
|
|
468
|
-
return c.timezone(a.timezone, { ...request, at: a.at, to: a.to });
|
|
469
|
-
},
|
|
470
|
-
(schema) => schema.refine(
|
|
471
|
-
(a) => a.timezone !== void 0 ? a.lat === void 0 && a.lon === void 0 : a.lat !== void 0 && a.lon !== void 0 && a.to === void 0,
|
|
472
|
-
{ message: "Pass either timezone (with optional to), or both lat and lon." }
|
|
473
|
-
)
|
|
474
|
-
);
|
|
475
|
-
tool(
|
|
476
|
-
"date",
|
|
477
|
-
"Parse a date in any common format (2026-03-29, March 29, 2026, 3/29/2026, 20260829) into calendar facts: ISO date, weekday, ISO week, day of year, quarter, leap year, unix time. Ambiguous numeric dates answer valid false unless format asserts a reading, never a guess. Pass to with another date for the signed days between. Omit date for today (UTC), so to alone answers days from today.",
|
|
478
|
-
{
|
|
479
|
-
date: z.string().min(1).optional().describe("The date as you have it, any common format. Omit for today (UTC)"),
|
|
480
|
-
format: z.enum(["mdy", "dmy"]).optional().describe("Breaks the month-first / day-first tie on numeric dates like 03/04/2026"),
|
|
481
|
-
to: z.string().optional().describe("Another date. Appends to (normalized ISO) and days (signed days between)")
|
|
482
|
-
},
|
|
483
|
-
(c, a, request) => {
|
|
484
|
-
if (a.date == null) return c.date.today({ ...request, to: a.to });
|
|
485
|
-
return c.date(a.date, { ...request, format: a.format, to: a.to });
|
|
486
|
-
},
|
|
487
|
-
(schema) => schema.refine(
|
|
488
|
-
(a) => a.format === void 0 || a.date !== void 0,
|
|
489
|
-
{ message: "Pass date when specifying format; omit both for today." }
|
|
490
|
-
)
|
|
491
|
-
);
|
|
492
|
-
tool(
|
|
493
|
-
"holiday",
|
|
494
|
-
"Public holidays and cultural observances for a country and year. Each row carries type: public or observance.",
|
|
495
|
-
{
|
|
496
|
-
country: iso2("country code"),
|
|
497
|
-
year: z.number().int().optional().describe("Year, default current")
|
|
498
|
-
},
|
|
499
|
-
(c, a, request) => c.holiday(a.country, { ...request, year: a.year })
|
|
500
|
-
);
|
|
501
|
-
tool(
|
|
502
|
-
"holiday_date",
|
|
503
|
-
"Whether a specific date is a holiday or observance in a country. holiday is null when it is not.",
|
|
504
|
-
{ country: iso2("country code"), date: z.string().describe("Date as YYYY-MM-DD") },
|
|
505
|
-
(c, a, request) => c.holiday.date(a.country, a.date, request)
|
|
506
|
-
);
|
|
507
|
-
tool(
|
|
508
|
-
"emoji",
|
|
509
|
-
"Look up an emoji by name or character: unicode, hex, skin tones.",
|
|
510
|
-
{ emoji: z.string().describe("Emoji name or the character itself, e.g. rocket") },
|
|
511
|
-
(c, a, request) => c.emoji(a.emoji, request)
|
|
512
|
-
);
|
|
513
|
-
tool(
|
|
514
|
-
"emoji_search",
|
|
515
|
-
"Search emoji by keyword.",
|
|
516
|
-
{
|
|
517
|
-
query: z.string().describe("Search keyword, e.g. fire"),
|
|
518
|
-
limit: z.number().int().min(1).max(50).optional().describe("Max results")
|
|
519
|
-
},
|
|
520
|
-
(c, a, request) => c.emoji.search(a.query, { ...request, limit: a.limit })
|
|
521
|
-
);
|
|
522
|
-
return server;
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
export {
|
|
526
|
-
VERSION,
|
|
527
|
-
buildServer
|
|
528
|
-
};
|