@cyanheads/geonames-mcp-server 0.1.1 → 0.1.2
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/AGENTS.md +4 -3
- package/CLAUDE.md +4 -3
- package/README.md +64 -36
- package/changelog/0.1.x/0.1.2.md +26 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/tools/definitions/find-postal-codes.tool.d.ts +6 -0
- package/dist/mcp-server/tools/definitions/find-postal-codes.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/find-postal-codes.tool.js +14 -2
- package/dist/mcp-server/tools/definitions/find-postal-codes.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-children.tool.d.ts +6 -4
- package/dist/mcp-server/tools/definitions/get-children.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-children.tool.js +49 -10
- package/dist/mcp-server/tools/definitions/get-children.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-countries.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-countries.tool.js +1 -1
- package/dist/mcp-server/tools/definitions/get-countries.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/index.d.ts +27 -2
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/reverse-geocode.tool.d.ts +8 -0
- package/dist/mcp-server/tools/definitions/reverse-geocode.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/reverse-geocode.tool.js +64 -24
- package/dist/mcp-server/tools/definitions/reverse-geocode.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-places.tool.d.ts +12 -0
- package/dist/mcp-server/tools/definitions/search-places.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-places.tool.js +38 -1
- package/dist/mcp-server/tools/definitions/search-places.tool.js.map +1 -1
- package/dist/mcp-server/tools/shared-inputs.d.ts +47 -4
- package/dist/mcp-server/tools/shared-inputs.d.ts.map +1 -1
- package/dist/mcp-server/tools/shared-inputs.js +95 -11
- package/dist/mcp-server/tools/shared-inputs.js.map +1 -1
- package/dist/services/geonames/country-codes.d.ts +26 -0
- package/dist/services/geonames/country-codes.d.ts.map +1 -0
- package/dist/services/geonames/country-codes.js +284 -0
- package/dist/services/geonames/country-codes.js.map +1 -0
- package/dist/services/geonames/geonames-service.d.ts +7 -2
- package/dist/services/geonames/geonames-service.d.ts.map +1 -1
- package/dist/services/geonames/geonames-service.js +13 -7
- package/dist/services/geonames/geonames-service.js.map +1 -1
- package/dist/services/geonames/response-parsers.d.ts +7 -3
- package/dist/services/geonames/response-parsers.d.ts.map +1 -1
- package/dist/services/geonames/response-parsers.js +25 -6
- package/dist/services/geonames/response-parsers.js.map +1 -1
- package/dist/services/geonames/types.d.ts +11 -3
- package/dist/services/geonames/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/server.json +9 -3
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview geonames_get_children — the direct children of a GeoNames feature in the
|
|
3
|
-
* administrative, tourism,
|
|
4
|
-
*
|
|
3
|
+
* administrative, tourism, or dependency tree (`childrenJSON`, 1 credit, cached a day). The
|
|
4
|
+
* whole list is fetched once, so paging and name filtering are local. A non-empty tourism
|
|
5
|
+
* or dependency list is compared with the administrative one, which GeoNames returns in its
|
|
6
|
+
* place when the feature has no such tree (1 more credit unless cached); an empty one is
|
|
7
|
+
* not, since by that fallback the administrative list is empty too.
|
|
5
8
|
* @module mcp-server/tools/definitions/get-children.tool
|
|
6
9
|
*/
|
|
7
10
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
@@ -9,19 +12,37 @@ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
|
9
12
|
import { blankAsUnset, geonameIdInput, geonamesUsernameInput, limitInput, lowerCased, nameContainsInput, nameMatcher, offsetInput, paginate, USERNAME_ALIASES, } from '../shared-inputs.js';
|
|
10
13
|
import { getGeoNamesService } from '../../../services/geonames/geonames-service.js';
|
|
11
14
|
import { inlineText, tableCell } from '../../../utils/inline-text.js';
|
|
12
|
-
const HIERARCHIES = [
|
|
15
|
+
const HIERARCHIES = [
|
|
16
|
+
'administrative',
|
|
17
|
+
'tourism',
|
|
18
|
+
'dependency',
|
|
19
|
+
];
|
|
13
20
|
/** The most rows `childrenJSON` is asked for per parent. */
|
|
14
21
|
const FETCH_CAP = 1000;
|
|
22
|
+
const fallbackRule = (tree) => `GeoNames answers with the administrative children when a feature has no ${tree} tree`;
|
|
23
|
+
/**
|
|
24
|
+
* True when a tree's whole fetched list is the administrative one: the same geonameIds,
|
|
25
|
+
* each as often, in any order, and the same upstream total.
|
|
26
|
+
*/
|
|
27
|
+
function isAdministrativeList(tree, administrative) {
|
|
28
|
+
if (administrative?.totalCount !== tree.totalCount ||
|
|
29
|
+
administrative.children.length !== tree.children.length) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
const sortedIds = ({ children }) => children.map((child) => child.geonameId).toSorted((a, b) => a - b);
|
|
33
|
+
const administrativeIds = sortedIds(administrative);
|
|
34
|
+
return sortedIds(tree).every((id, index) => id === administrativeIds[index]);
|
|
35
|
+
}
|
|
15
36
|
/** A child row as this tool returns it: the gazetteer fields minus the country label, id, and distance. */
|
|
16
37
|
const toChild = ({ countryGeonameId: _countryId, countryName: _countryName, distanceInKm: _distance, featureClassName: _className, ...child }) => child;
|
|
17
38
|
const orNotAvailable = (value) => value === undefined ? 'Not available' : tableCell(value);
|
|
18
39
|
export const getChildrenTool = tool('geonames_get_children', {
|
|
19
40
|
title: 'List GeoNames children',
|
|
20
|
-
description: "List the direct children of a GeoNames feature — a continent's countries, a country's first-level divisions, a state's counties, a city's sections — in the administrative tree, or in the tourism,
|
|
41
|
+
description: "List the direct children of a GeoNames feature — Earth's continents, a continent's countries, a country's first-level divisions, a state's counties, a city's sections — in the administrative tree, or in the tourism tree (islands, coasts, and their municipalities; almost all in Spain) or the dependency tree (a country's dependent territories). Start from a country's geonameId (geonames_get_countries) or any admin division's. Children are mostly admin divisions (class A) and populated places (class P); continents and coasts are class L and islands class T. For other feature types inside a place, use geonames_search_places with a boundingBox. GeoNames answers a tourism or dependency request with the administrative children when the feature has no such tree, so the tool compares the two lists and sets sameAsAdministrative when they match, keeping the rows (a real tree can match too). The full child list is fetched once (1 GeoNames credit) and cached, so paging and nameContains filtering are free; a tourism or dependency call also reads the administrative list for the comparison, 1 more credit unless it is cached.",
|
|
21
42
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
22
43
|
input: z.object({
|
|
23
44
|
geonameId: geonameIdInput.describe('GeoNames id of the parent feature, a positive integer up to 2147483647 such as 6252001 (United States), as returned in geonameId by the other geonames tools. A geonames.org/<id> URL is reduced to its id.'),
|
|
24
|
-
hierarchy: blankAsUnset(lowerCased(z.enum(HIERARCHIES).default('administrative'))).describe(
|
|
45
|
+
hierarchy: blankAsUnset(lowerCased(z.enum(HIERARCHIES).default('administrative'))).describe("Which tree to descend: administrative (the default: continents (class L), countries, admin divisions, populated places), tourism (islands (class T), coasts (class L), and their municipalities; almost all in Spain), or dependency (a country's dependent territories). For a feature with no tourism or dependency tree, GeoNames answers with its administrative children, which sameAsAdministrative flags; the comparison reads the administrative list, 1 more credit unless it is cached. Case-insensitive."),
|
|
25
46
|
nameContains: nameContainsInput.describe('Keep only children whose name or toponym name contains every word of this text as a substring (kansas also matches Arkansas), ignoring case, accents, and punctuation.'),
|
|
26
47
|
limit: limitInput(500, 100),
|
|
27
48
|
offset: offsetInput(),
|
|
@@ -32,6 +53,10 @@ export const getChildrenTool = tool('geonames_get_children', {
|
|
|
32
53
|
found: z.boolean().describe('False when GeoNames has no feature with this geonameId.'),
|
|
33
54
|
parentGeonameId: z.number().describe('The geonameId whose children were requested.'),
|
|
34
55
|
hierarchy: z.enum(HIERARCHIES).describe('The tree that was descended.'),
|
|
56
|
+
sameAsAdministrative: z
|
|
57
|
+
.boolean()
|
|
58
|
+
.optional()
|
|
59
|
+
.describe('Tourism and dependency trees only, when the feature has children there: true when they are exactly its administrative children (same geonameIds and total). GeoNames answers with the administrative children when a feature has no such tree, so true most likely means it has none; a real tree can also match.'),
|
|
35
60
|
guidance: z.string().optional().describe('What to do next; present only when found is false.'),
|
|
36
61
|
children: z
|
|
37
62
|
.array(z
|
|
@@ -93,7 +118,7 @@ export const getChildrenTool = tool('geonames_get_children', {
|
|
|
93
118
|
notice: z
|
|
94
119
|
.string()
|
|
95
120
|
.optional()
|
|
96
|
-
.describe('Guidance when there are no children, nothing matched, the offset is past the end, more pages remain, or GeoNames holds more children than it returns.'),
|
|
121
|
+
.describe('Guidance when a tourism or dependency answer is the administrative children, there are no children, nothing matched, the offset is past the end, more pages remain, or GeoNames holds more children than it returns.'),
|
|
97
122
|
},
|
|
98
123
|
errors: [
|
|
99
124
|
{
|
|
@@ -142,7 +167,8 @@ export const getChildrenTool = tool('geonames_get_children', {
|
|
|
142
167
|
const { hierarchy } = input;
|
|
143
168
|
const parentGeonameId = Number(input.geonameId);
|
|
144
169
|
const service = getGeoNamesService();
|
|
145
|
-
const
|
|
170
|
+
const account = service.resolveAccount(input.geonamesUsername);
|
|
171
|
+
const result = await service.children(input.geonameId, hierarchy, account, ctx);
|
|
146
172
|
if (result === undefined) {
|
|
147
173
|
return {
|
|
148
174
|
found: false,
|
|
@@ -153,16 +179,22 @@ export const getChildrenTool = tool('geonames_get_children', {
|
|
|
153
179
|
};
|
|
154
180
|
}
|
|
155
181
|
const all = result.children;
|
|
182
|
+
const sameAsAdministrative = hierarchy === 'administrative' || all.length === 0
|
|
183
|
+
? undefined
|
|
184
|
+
: isAdministrativeList(result, await service.children(input.geonameId, 'administrative', account, ctx));
|
|
156
185
|
const matcher = input.nameContains === undefined ? undefined : nameMatcher(input.nameContains);
|
|
157
186
|
const matches = matcher ? all.filter((child) => matcher([child.name, child.toponymName])) : all;
|
|
158
187
|
const { page, nextOffset } = paginate(matches, input.offset, input.limit);
|
|
159
188
|
ctx.enrich.total(matches.length);
|
|
160
189
|
ctx.enrich({ shown: page.length });
|
|
161
190
|
const fragments = [];
|
|
191
|
+
if (sameAsAdministrative) {
|
|
192
|
+
fragments.push(`These are the same children as the administrative tree's. ${fallbackRule(hierarchy)}, so this feature most likely has none; a real ${hierarchy} tree can also match its administrative children.`);
|
|
193
|
+
}
|
|
162
194
|
if (all.length === 0) {
|
|
163
195
|
fragments.push(hierarchy === 'administrative'
|
|
164
|
-
? 'This feature has no children in the administrative tree. Try hierarchy tourism
|
|
165
|
-
: `This feature has no children in the ${hierarchy} tree
|
|
196
|
+
? 'This feature has no children in the administrative tree. Try hierarchy tourism or dependency, or search inside it with geonames_search_places and a boundingBox.'
|
|
197
|
+
: `This feature has no children in the ${hierarchy} tree, nor in the administrative tree: ${fallbackRule(hierarchy)}. Try hierarchy ${hierarchy === 'tourism' ? 'dependency' : 'tourism'}, or search inside it with geonames_search_places and a boundingBox.`);
|
|
166
198
|
}
|
|
167
199
|
else if (matches.length === 0 && input.nameContains !== undefined) {
|
|
168
200
|
fragments.push(`No child name contains "${inlineText(input.nameContains)}" among ${all.length}; call again without nameContains to browse them all.`);
|
|
@@ -184,16 +216,23 @@ export const getChildrenTool = tool('geonames_get_children', {
|
|
|
184
216
|
found: true,
|
|
185
217
|
parentGeonameId,
|
|
186
218
|
hierarchy,
|
|
219
|
+
...(sameAsAdministrative === undefined ? {} : { sameAsAdministrative }),
|
|
187
220
|
children: page.map(toChild),
|
|
188
221
|
...(nextOffset === undefined ? {} : { nextOffset }),
|
|
189
222
|
};
|
|
190
223
|
},
|
|
191
224
|
format: (result) => {
|
|
225
|
+
const tree = result.sameAsAdministrative
|
|
226
|
+
? `${result.hierarchy} tree: same as the administrative children, GeoNames' answer when a feature has no ${result.hierarchy} tree`
|
|
227
|
+
: `${result.hierarchy} tree`;
|
|
192
228
|
const lines = [
|
|
193
|
-
`## GeoNames children of geonameId ${result.parentGeonameId} (${
|
|
229
|
+
`## GeoNames children of geonameId ${result.parentGeonameId} (${tree})`,
|
|
194
230
|
'',
|
|
195
231
|
`**Found:** ${result.found}`,
|
|
196
232
|
];
|
|
233
|
+
if (result.sameAsAdministrative !== undefined) {
|
|
234
|
+
lines.push('', `**Same as administrative children:** ${result.sameAsAdministrative}`);
|
|
235
|
+
}
|
|
197
236
|
if (result.guidance !== undefined)
|
|
198
237
|
lines.push('', inlineText(result.guidance));
|
|
199
238
|
if (result.found && result.children.length === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-children.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-children.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EACL,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,QAAQ,EACR,gBAAgB,GACjB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAE/D,MAAM,WAAW,GAAG,CAAC,gBAAgB,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,CAAU,CAAC;AAEtF,4DAA4D;AAC5D,MAAM,SAAS,GAAG,IAAI,CAAC;AAEvB,2GAA2G;AAC3G,MAAM,OAAO,GAAG,CAAC,EACf,gBAAgB,EAAE,UAAU,EAC5B,WAAW,EAAE,YAAY,EACzB,YAAY,EAAE,SAAS,EACvB,gBAAgB,EAAE,UAAU,EAC5B,GAAG,KAAK,EACA,EAAE,EAAE,CAAC,KAAK,CAAC;AAErB,MAAM,cAAc,GAAG,CAAC,KAAyB,EAAU,EAAE,CAC3D,KAAK,KAAK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C,UAAU,CAAC,GAAG;wBAC3D,KAAK,CAAC,SAAS,IAAI,OAAO,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE;qBACvD;yBACE,MAAM,CAAC,OAAO,CAAC;yBACf,IAAI,CAAC,GAAG,CAAC,CAAC;gBACnB,KAAK,CAAC,IAAI,CACR,KAAK;oBACH,KAAK,CAAC,SAAS;oBACf,IAAI;oBACJ,OAAO;oBACP,cAAc,CAAC,KAAK,CAAC,WAAW,CAAC;oBACjC,MAAM;oBACN,KAAK,CAAC,UAAU,KAAK,SAAS;wBAC5B,CAAC,CAAC,eAAe;wBACjB,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC;oBAC5C,KAAK,CAAC,GAAG,KAAK,SAAS,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS;wBAChD,CAAC,CAAC,eAAe;wBACjB,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,EAAE;iBACjC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAClB,CAAC;YACJ,CAAC;QACH,CAAC;QACD,IAAI,MAAM,CAAC,UAAU,KAAK,SAAS;YAAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,qBAAqB,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC;QAC/F,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"get-children.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-children.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EACL,YAAY,EAC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SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG;wBAC3D,KAAK,CAAC,SAAS,IAAI,OAAO,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE;qBACvD;yBACE,MAAM,CAAC,OAAO,CAAC;yBACf,IAAI,CAAC,GAAG,CAAC,CAAC;gBACnB,KAAK,CAAC,IAAI,CACR,KAAK;oBACH,KAAK,CAAC,SAAS;oBACf,IAAI;oBACJ,OAAO;oBACP,cAAc,CAAC,KAAK,CAAC,WAAW,CAAC;oBACjC,MAAM;oBACN,KAAK,CAAC,UAAU,KAAK,SAAS;wBAC5B,CAAC,CAAC,eAAe;wBACjB,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC;oBAC5C,KAAK,CAAC,GAAG,KAAK,SAAS,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS;wBAChD,CAAC,CAAC,eAAe;wBACjB,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,EAAE;iBACjC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAClB,CAAC;YACJ,CAAC;QACH,CAAC;QACD,IAAI,MAAM,CAAC,UAAU,KAAK,SAAS;YAAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,qBAAqB,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC;QAC/F,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-countries.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-countries.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA4BjE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"get-countries.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-countries.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA4BjE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+O3B,CAAC"}
|
|
@@ -40,7 +40,7 @@ export const getCountriesTool = tool('geonames_get_countries', {
|
|
|
40
40
|
isoNumeric: z
|
|
41
41
|
.string()
|
|
42
42
|
.optional()
|
|
43
|
-
.describe('ISO 3166-1 numeric code. Absent where GeoNames gives none.'),
|
|
43
|
+
.describe('ISO 3166-1 numeric code. Absent where ISO assigns none (Kosovo) or GeoNames gives none.'),
|
|
44
44
|
fipsCode: z
|
|
45
45
|
.string()
|
|
46
46
|
.optional()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-countries.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-countries.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,UAAU,EACV,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,gBAAgB,GACjB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,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EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,EAC7E,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE,CAC9B,CACF,CAAC,QAAQ,CACR,wJAAwJ,CACzJ;QACD,YAAY,EAAE,iBAAiB,CAAC,QAAQ,CACtC,+JAA+J,CAChK;QACD,KAAK,EAAE,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC;QAC1B,MAAM,EAAE,WAAW,EAAE;QACrB,gBAAgB,EAAE,qBAAqB,CAAC,QAAQ,CAC9C,oOAAoO,CACrO;KACF,CAAC;IACF,YAAY,EAAE,gBAAgB;IAC9B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,SAAS,EAAE,CAAC;aACT,KAAK,CACJ,CAAC;aACE,MAAM,CAAC;YACN,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;YAC5D,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;YAC1D,UAAU,EAAE,CAAC;iBACV,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,
|
|
1
|
+
{"version":3,"file":"get-countries.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-countries.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,UAAU,EACV,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,gBAAgB,GACjB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,M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AI,MAAM,IAAI,EAAE;iBAC1C,CAAC;gBACF,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACzC,CAAC;QACH,CAAC;QACD,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC/B,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,gCAAgC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;QAC1F,CAAC;QACD,IAAI,MAAM,CAAC,UAAU,KAAK,SAAS;YAAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,qBAAqB,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC;QAC/F,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -43,6 +43,12 @@ export declare const allToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolD
|
|
|
43
43
|
readonly when: "A field the mode requires is missing, or countries is given in mode nearby. The message names the field.";
|
|
44
44
|
readonly recovery: "Supply the fields the chosen mode needs (code: postalCode; place_name: placeName; nearby: lat and lng, without countries) and call geonames_find_postal_codes again.";
|
|
45
45
|
readonly severity: "notice";
|
|
46
|
+
}, {
|
|
47
|
+
readonly reason: "unknown_country_code";
|
|
48
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
49
|
+
readonly when: "A countries entry is a well-formed alpha-3 or three-digit numeric code that no country has.";
|
|
50
|
+
readonly recovery: "Find the country with geonames_get_countries (nameContains matches its name), then call again with its alpha-2, alpha-3, or numeric code.";
|
|
51
|
+
readonly severity: "notice";
|
|
46
52
|
}, {
|
|
47
53
|
readonly reason: "username_required";
|
|
48
54
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Unauthorized;
|
|
@@ -250,12 +256,24 @@ export declare const allToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolD
|
|
|
250
256
|
readonly when: "match was set without query.";
|
|
251
257
|
readonly recovery: "Call geonames_search_places again with query text for the chosen match mode, or drop match to search by filters alone.";
|
|
252
258
|
readonly severity: "notice";
|
|
259
|
+
}, {
|
|
260
|
+
readonly reason: "unknown_country_code";
|
|
261
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
262
|
+
readonly when: "A countries entry is a well-formed alpha-3 or three-digit numeric code that no country has.";
|
|
263
|
+
readonly recovery: "Find the country with geonames_get_countries (nameContains matches its name), then call again with its alpha-2, alpha-3, or numeric code.";
|
|
264
|
+
readonly severity: "notice";
|
|
253
265
|
}, {
|
|
254
266
|
readonly reason: "unknown_feature_code";
|
|
255
267
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
256
268
|
readonly when: "A featureCodes entry is not a GeoNames feature code.";
|
|
257
269
|
readonly recovery: "Look up valid codes with geonames_list_reference topic feature_codes, then retry with a listed code.";
|
|
258
270
|
readonly severity: "notice";
|
|
271
|
+
}, {
|
|
272
|
+
readonly reason: "feature_filter_mismatch";
|
|
273
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
274
|
+
readonly when: "featureClasses and featureCodes are both set and a code's class is not listed or a listed class has no listed code, or cities (class P only) is set beside another class or a code outside class P. GeoNames intersects the filters, so those entries match nothing.";
|
|
275
|
+
readonly recovery: `${string} ${string}`;
|
|
276
|
+
readonly severity: "notice";
|
|
259
277
|
}, {
|
|
260
278
|
readonly reason: "invalid_bounding_box";
|
|
261
279
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
@@ -363,7 +381,6 @@ export declare const allToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolD
|
|
|
363
381
|
hierarchy: import("zod").ZodPreprocess<import("zod").ZodPreprocess<import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
364
382
|
administrative: "administrative";
|
|
365
383
|
dependency: "dependency";
|
|
366
|
-
geography: "geography";
|
|
367
384
|
tourism: "tourism";
|
|
368
385
|
}>>, unknown>, unknown>;
|
|
369
386
|
nameContains: import("zod").ZodPreprocess<import("zod").ZodOptional<import("zod").ZodString>, unknown>;
|
|
@@ -376,9 +393,9 @@ export declare const allToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolD
|
|
|
376
393
|
hierarchy: import("zod").ZodEnum<{
|
|
377
394
|
administrative: "administrative";
|
|
378
395
|
dependency: "dependency";
|
|
379
|
-
geography: "geography";
|
|
380
396
|
tourism: "tourism";
|
|
381
397
|
}>;
|
|
398
|
+
sameAsAdministrative: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
382
399
|
guidance: import("zod").ZodOptional<import("zod").ZodString>;
|
|
383
400
|
children: import("zod").ZodArray<import("zod").ZodObject<{
|
|
384
401
|
geonameId: import("zod").ZodNumber;
|
|
@@ -459,6 +476,7 @@ export declare const allToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolD
|
|
|
459
476
|
}>>>, unknown>;
|
|
460
477
|
featureCodes: import("zod").ZodPreprocess<import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>, unknown>;
|
|
461
478
|
includeTimezone: import("zod").ZodPreprocess<import("zod").ZodDefault<import("zod").ZodBoolean>, unknown>;
|
|
479
|
+
coastalBufferKm: import("zod").ZodPreprocess<import("zod").ZodDefault<import("zod").ZodNumber>, unknown>;
|
|
462
480
|
geonamesUsername: import("zod").ZodPreprocess<import("zod").ZodOptional<import("zod").ZodString>, unknown>;
|
|
463
481
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
464
482
|
lat: import("zod").ZodNumber;
|
|
@@ -466,6 +484,7 @@ export declare const allToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolD
|
|
|
466
484
|
country: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
467
485
|
countryCode: import("zod").ZodString;
|
|
468
486
|
countryName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
487
|
+
distanceInKm: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
469
488
|
}, import("zod/v4/core").$strip>>;
|
|
470
489
|
adminLevels: import("zod").ZodArray<import("zod").ZodObject<{
|
|
471
490
|
level: import("zod").ZodNumber;
|
|
@@ -519,6 +538,12 @@ export declare const allToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolD
|
|
|
519
538
|
readonly when: "cities was combined with featureClasses or featureCodes.";
|
|
520
539
|
readonly recovery: "Call geonames_reverse_geocode again with cities for the nearest populated places, or featureClasses/featureCodes for the nearest features of a type, not both.";
|
|
521
540
|
readonly severity: "notice";
|
|
541
|
+
}, {
|
|
542
|
+
readonly reason: "feature_filter_mismatch";
|
|
543
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
544
|
+
readonly when: "featureClasses and featureCodes are both set and a code's class is not listed or a listed class has no listed code. GeoNames intersects the two lists, so those entries match nothing.";
|
|
545
|
+
readonly recovery: "Call geonames_reverse_geocode again with featureCodes alone (each code implies its class) or featureClasses alone; for a whole class plus codes of another class, make one call per class.";
|
|
546
|
+
readonly severity: "notice";
|
|
522
547
|
}, {
|
|
523
548
|
readonly reason: "username_required";
|
|
524
549
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Unauthorized;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAS9B,CAAC"}
|
|
@@ -31,6 +31,7 @@ export declare const reverseGeocodeTool: import("@cyanheads/mcp-ts-core").ToolDe
|
|
|
31
31
|
}>>>, unknown>;
|
|
32
32
|
featureCodes: z.ZodPreprocess<z.ZodOptional<z.ZodArray<z.ZodString>>, unknown>;
|
|
33
33
|
includeTimezone: z.ZodPreprocess<z.ZodDefault<z.ZodBoolean>, unknown>;
|
|
34
|
+
coastalBufferKm: z.ZodPreprocess<z.ZodDefault<z.ZodNumber>, unknown>;
|
|
34
35
|
geonamesUsername: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
|
|
35
36
|
}, z.core.$strip>, z.ZodObject<{
|
|
36
37
|
lat: z.ZodNumber;
|
|
@@ -38,6 +39,7 @@ export declare const reverseGeocodeTool: import("@cyanheads/mcp-ts-core").ToolDe
|
|
|
38
39
|
country: z.ZodOptional<z.ZodObject<{
|
|
39
40
|
countryCode: z.ZodString;
|
|
40
41
|
countryName: z.ZodOptional<z.ZodString>;
|
|
42
|
+
distanceInKm: z.ZodOptional<z.ZodNumber>;
|
|
41
43
|
}, z.core.$strip>>;
|
|
42
44
|
adminLevels: z.ZodArray<z.ZodObject<{
|
|
43
45
|
level: z.ZodNumber;
|
|
@@ -91,6 +93,12 @@ export declare const reverseGeocodeTool: import("@cyanheads/mcp-ts-core").ToolDe
|
|
|
91
93
|
readonly when: "cities was combined with featureClasses or featureCodes.";
|
|
92
94
|
readonly recovery: "Call geonames_reverse_geocode again with cities for the nearest populated places, or featureClasses/featureCodes for the nearest features of a type, not both.";
|
|
93
95
|
readonly severity: "notice";
|
|
96
|
+
}, {
|
|
97
|
+
readonly reason: "feature_filter_mismatch";
|
|
98
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
99
|
+
readonly when: "featureClasses and featureCodes are both set and a code's class is not listed or a listed class has no listed code. GeoNames intersects the two lists, so those entries match nothing.";
|
|
100
|
+
readonly recovery: "Call geonames_reverse_geocode again with featureCodes alone (each code implies its class) or featureClasses alone; for a whole class plus codes of another class, make one call per class.";
|
|
101
|
+
readonly severity: "notice";
|
|
94
102
|
}, {
|
|
95
103
|
readonly reason: "username_required";
|
|
96
104
|
readonly code: JsonRpcErrorCode.Unauthorized;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reverse-geocode.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/reverse-geocode.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"reverse-geocode.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/reverse-geocode.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA6DjE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqf7B,CAAC"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
10
10
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
11
|
-
import { blankAsUnset, citiesInput, featureClassesInput, featureCodesInput, geonamesUsernameInput, latInput, lngInput, USERNAME_ALIASES, } from '../shared-inputs.js';
|
|
11
|
+
import { blankAsUnset, citiesInput, featureClassesInput, featureCodesInput, featureFilterMismatch, geonamesUsernameInput, latInput, lngInput, USERNAME_ALIASES, } from '../shared-inputs.js';
|
|
12
12
|
import { getFeatureCode } from '../../../services/geonames/feature-codes.js';
|
|
13
13
|
import { getGeoNamesService } from '../../../services/geonames/geonames-service.js';
|
|
14
14
|
import { inlineText, tableCell } from '../../../utils/inline-text.js';
|
|
@@ -20,6 +20,11 @@ const OCEAN_BUDGET_MS = 10_000;
|
|
|
20
20
|
const MAX_NEARBY = 50;
|
|
21
21
|
/** GeoNames' free-tier ceiling on the nearby radius (status 24 beyond). */
|
|
22
22
|
const MAX_RADIUS_KM = 300;
|
|
23
|
+
/**
|
|
24
|
+
* Ceiling on the containment buffer: room for harbors, estuaries, and the 12-nautical-mile
|
|
25
|
+
* territorial sea, and well below the 300 km GeoNames rejects with status 24.
|
|
26
|
+
*/
|
|
27
|
+
const MAX_COASTAL_BUFFER_KM = 50;
|
|
23
28
|
const NEARBY_KINDS = ['populated_places', 'features', 'none'];
|
|
24
29
|
const NEARBY_TITLES = {
|
|
25
30
|
populated_places: 'Nearest populated places',
|
|
@@ -33,7 +38,7 @@ const toTimezone = ({ countryName: _countryName, ...timezone }) => timezone;
|
|
|
33
38
|
const orNotAvailable = (value) => value === undefined ? 'Not available' : tableCell(String(value));
|
|
34
39
|
export const reverseGeocodeTool = tool('geonames_reverse_geocode', {
|
|
35
40
|
title: 'Reverse geocode with GeoNames',
|
|
36
|
-
description: "Resolve a latitude/longitude to the country and admin subdivisions that contain it (down to ADM5, each with its geonameId and ISO 3166-2 code where one exists), or the ocean or sea when the point is offshore, plus the nearest populated places with distances; these include neighborhood sections (PPLX) and historical places (PPLH), marked by featureCode. Set featureClasses or featureCodes to list the nearest features of that type instead (peaks, lakes, airports), cities to keep only places above a population tier, and includeTimezone for the IANA timezone with local time, sunrise, and sunset (offshore points get only GeoNames' UTC-offset estimate). Costs 1 GeoNames credit for containment, plus 3 for nearest populated places or 4 for nearest features (nearbyLimit 0 skips them), 1 for the ocean when no country contains the point, and 1 for the timezone.",
|
|
41
|
+
description: "Resolve a latitude/longitude to the country and admin subdivisions that contain it (down to ADM5, each with its geonameId and ISO 3166-2 code where one exists), or the ocean or sea when the point is offshore, plus the nearest populated places with distances; these include neighborhood sections (PPLX) and historical places (PPLH), marked by featureCode. Set featureClasses or featureCodes to list the nearest features of that type instead (peaks, lakes, airports), cities to keep only places above a population tier, and includeTimezone for the IANA timezone with local time, sunrise, and sunset (offshore points get only GeoNames' UTC-offset estimate). A harbor, pier, or shoreline point can fall just outside every country outline and resolve to the sea; coastalBufferKm (up to 50) matches the nearest country within that distance instead. Costs 1 GeoNames credit for containment, with or without the buffer, plus 3 for nearest populated places or 4 for nearest features (nearbyLimit 0 skips them), 1 for the ocean when no country contains the point or lies within the buffer, and 1 for the timezone.",
|
|
37
42
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
38
43
|
input: z.object({
|
|
39
44
|
lat: latInput,
|
|
@@ -41,9 +46,10 @@ export const reverseGeocodeTool = tool('geonames_reverse_geocode', {
|
|
|
41
46
|
nearbyLimit: blankAsUnset(z.number().int().min(0).max(MAX_NEARBY).default(5)).describe('How many nearest places or features to list, 0 to 50. Default 5. 0 skips the nearby lookup and its 3 or 4 credits.'),
|
|
42
47
|
radiusKm: blankAsUnset(z.number().positive().max(MAX_RADIUS_KM).default(20)).describe("Radius in kilometres for the nearby lookup, above 0 and at most 300 (GeoNames' free-tier limit). Default 20."),
|
|
43
48
|
cities: citiesInput.describe("Keep only nearby populated places with a population of at least 1,000 (cities1000), 5,000 (cities5000), or 15,000 (cities15000), plus seats of admin divisions: GeoNames' cities tiers. Not combinable with featureClasses or featureCodes."),
|
|
44
|
-
featureClasses: featureClassesInput.describe('List the nearest features of these GeoNames classes instead of populated places: A admin divisions, H water, L areas, P populated places, R roads, S spots and buildings, T terrain, U undersea, V vegetation. A list or a comma-separated string; case-insensitive. Not combinable with cities.'),
|
|
45
|
-
featureCodes: featureCodesInput.describe(
|
|
49
|
+
featureClasses: featureClassesInput.describe('List the nearest features of these GeoNames classes instead of populated places: A admin divisions, H water, L areas, P populated places, R roads, S spots and buildings, T terrain, U undersea, V vegetation. A list or a comma-separated string; case-insensitive. With featureCodes too, the two lists intersect: list exactly the classes of those codes, or pass featureCodes alone. Not combinable with cities.'),
|
|
50
|
+
featureCodes: featureCodesInput.describe("List the nearest features with these GeoNames codes instead of populated places (MT mountain, PK peak, LK lake, AIRP airport), up to 20, as a list or a comma-separated string. Case-insensitive; a class prefix (T.MT) is dropped. Each code implies its class; with featureClasses too, the two lists intersect, so featureClasses must list exactly these codes' classes. geonames_list_reference topic feature_codes lists every code. Not combinable with cities."),
|
|
46
51
|
includeTimezone: blankAsUnset(z.boolean().default(false)).describe('Also return the timezone: IANA id, UTC offsets, local time, sunrise, and sunset (1 more credit). Default false.'),
|
|
52
|
+
coastalBufferKm: blankAsUnset(z.number().min(0).max(MAX_COASTAL_BUFFER_KM).default(0)).describe("When no country contains the point, match the nearest country within this many kilometres, 0 to 50. Default 0: exact containment only. Set it for a harbor, pier, or shoreline point, which can fall just outside a country's outline as GeoNames maps it and otherwise resolves to the sea; a match carries country.distanceInKm. The nearby and timezone lookups keep the exact point. No extra credit."),
|
|
47
53
|
geonamesUsername: geonamesUsernameInput,
|
|
48
54
|
}),
|
|
49
55
|
inputAliases: USERNAME_ALIASES,
|
|
@@ -57,9 +63,13 @@ export const reverseGeocodeTool = tool('geonames_reverse_geocode', {
|
|
|
57
63
|
.string()
|
|
58
64
|
.optional()
|
|
59
65
|
.describe('Country name. Absent when GeoNames sent none.'),
|
|
66
|
+
distanceInKm: z
|
|
67
|
+
.number()
|
|
68
|
+
.optional()
|
|
69
|
+
.describe('Kilometres from the point to this country as GeoNames maps it, to the metre. Present only when no country contains the point and this one was matched within coastalBufferKm.'),
|
|
60
70
|
})
|
|
61
71
|
.optional()
|
|
62
|
-
.describe('The country containing the point; absent offshore and in unmapped areas.'),
|
|
72
|
+
.describe('The country containing the point, or with coastalBufferKm the nearest country within that distance (then distanceInKm is set); absent offshore and in unmapped areas.'),
|
|
63
73
|
adminLevels: z
|
|
64
74
|
.array(z
|
|
65
75
|
.object({
|
|
@@ -75,8 +85,8 @@ export const reverseGeocodeTool = tool('geonames_reverse_geocode', {
|
|
|
75
85
|
.optional()
|
|
76
86
|
.describe('ISO 3166-2 code of the division, subdivision part only (IDF, not FR-IDF), where one exists.'),
|
|
77
87
|
})
|
|
78
|
-
.describe('One admin division containing the point.'))
|
|
79
|
-
.describe('Admin divisions containing the point, first level first;
|
|
88
|
+
.describe('One admin division containing the point, or for a country matched within coastalBufferKm, the one nearest it.'))
|
|
89
|
+
.describe('Admin divisions containing the point, first level first; for a country matched within coastalBufferKm, the divisions of its part nearest the point. Empty offshore, and where GeoNames records no subdivision of the country.'),
|
|
80
90
|
ocean: z
|
|
81
91
|
.object({
|
|
82
92
|
name: z.string().describe('Name of the ocean or sea.'),
|
|
@@ -86,7 +96,7 @@ export const reverseGeocodeTool = tool('geonames_reverse_geocode', {
|
|
|
86
96
|
.describe('GeoNames feature id of the water body. Absent when GeoNames has none.'),
|
|
87
97
|
})
|
|
88
98
|
.optional()
|
|
89
|
-
.describe('The ocean or sea at the point; present only when no country contains it.'),
|
|
99
|
+
.describe('The ocean or sea at the point; present only when no country contains it or lies within coastalBufferKm.'),
|
|
90
100
|
nearbyKind: z
|
|
91
101
|
.enum(NEARBY_KINDS)
|
|
92
102
|
.describe('What nearby lists: populated_places, features (featureClasses or featureCodes was set), or none (nearbyLimit 0).'),
|
|
@@ -148,7 +158,9 @@ export const reverseGeocodeTool = tool('geonames_reverse_geocode', {
|
|
|
148
158
|
.describe('ISO 3166-1 alpha-2 code of the timezone country. Absent offshore.'),
|
|
149
159
|
rawOffsetInHours: z.number().describe('Standard UTC offset in hours, without DST.'),
|
|
150
160
|
gmtOffsetInHours: z.number().describe('UTC offset in hours on 1 January.'),
|
|
151
|
-
dstOffsetInHours: z
|
|
161
|
+
dstOffsetInHours: z
|
|
162
|
+
.number()
|
|
163
|
+
.describe("UTC offset in hours on 1 July. Without a timezoneId the offsets are GeoNames' open-water estimate, which has no DST, so this equals rawOffsetInHours."),
|
|
152
164
|
localTime: z
|
|
153
165
|
.string()
|
|
154
166
|
.optional()
|
|
@@ -174,7 +186,7 @@ export const reverseGeocodeTool = tool('geonames_reverse_geocode', {
|
|
|
174
186
|
notice: z
|
|
175
187
|
.string()
|
|
176
188
|
.optional()
|
|
177
|
-
.describe('Guidance when the point is offshore or unmapped, nothing is nearby, nearby is full, or no IANA timezone covers it.'),
|
|
189
|
+
.describe('Guidance when the point is offshore or unmapped, its country was matched within coastalBufferKm, nothing is nearby, nearby is full, or no IANA timezone covers it.'),
|
|
178
190
|
},
|
|
179
191
|
errors: [
|
|
180
192
|
{
|
|
@@ -191,6 +203,13 @@ export const reverseGeocodeTool = tool('geonames_reverse_geocode', {
|
|
|
191
203
|
recovery: 'Call geonames_reverse_geocode again with cities for the nearest populated places, or featureClasses/featureCodes for the nearest features of a type, not both.',
|
|
192
204
|
severity: 'notice',
|
|
193
205
|
},
|
|
206
|
+
{
|
|
207
|
+
reason: 'feature_filter_mismatch',
|
|
208
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
209
|
+
when: "featureClasses and featureCodes are both set and a code's class is not listed or a listed class has no listed code. GeoNames intersects the two lists, so those entries match nothing.",
|
|
210
|
+
recovery: 'Call geonames_reverse_geocode again with featureCodes alone (each code implies its class) or featureClasses alone; for a whole class plus codes of another class, make one call per class.',
|
|
211
|
+
severity: 'notice',
|
|
212
|
+
},
|
|
194
213
|
{
|
|
195
214
|
reason: 'username_required',
|
|
196
215
|
code: JsonRpcErrorCode.Unauthorized,
|
|
@@ -234,7 +253,7 @@ export const reverseGeocodeTool = tool('geonames_reverse_geocode', {
|
|
|
234
253
|
async handler(input, ctx) {
|
|
235
254
|
const startedAt = Date.now();
|
|
236
255
|
ctx.enrich({ truncated: false, shown: 0, cap: input.nearbyLimit });
|
|
237
|
-
const { lat, lng, nearbyLimit, radiusKm, cities, featureClasses, featureCodes } = input;
|
|
256
|
+
const { lat, lng, nearbyLimit, radiusKm, cities, featureClasses, featureCodes, coastalBufferKm, } = input;
|
|
238
257
|
if (cities !== undefined && (featureClasses !== undefined || featureCodes !== undefined)) {
|
|
239
258
|
throw ctx.fail('conflicting_filters', 'cities narrows the nearest populated places, while featureClasses and featureCodes switch to the nearest features of a type; pass one or the other.');
|
|
240
259
|
}
|
|
@@ -242,6 +261,11 @@ export const reverseGeocodeTool = tool('geonames_reverse_geocode', {
|
|
|
242
261
|
if (unknownCodes.length > 0) {
|
|
243
262
|
throw ctx.fail('unknown_feature_code', `Not a GeoNames feature code: ${unknownCodes.join(', ')}.`, { featureCodes: unknownCodes });
|
|
244
263
|
}
|
|
264
|
+
const mismatch = featureFilterMismatch({ featureClasses, featureCodes });
|
|
265
|
+
if (mismatch !== undefined) {
|
|
266
|
+
const { message, ...offending } = mismatch;
|
|
267
|
+
throw ctx.fail('feature_filter_mismatch', message, offending);
|
|
268
|
+
}
|
|
245
269
|
const service = getGeoNamesService();
|
|
246
270
|
const account = service.resolveAccount(input.geonamesUsername);
|
|
247
271
|
const nearbyKind = nearbyLimit === 0
|
|
@@ -249,9 +273,11 @@ export const reverseGeocodeTool = tool('geonames_reverse_geocode', {
|
|
|
249
273
|
: featureClasses !== undefined || featureCodes !== undefined
|
|
250
274
|
? 'features'
|
|
251
275
|
: 'populated_places';
|
|
252
|
-
/** Containment, then the ocean only when no country contains the point. */
|
|
276
|
+
/** Containment, then the ocean only when no country contains the point or lies within the buffer. */
|
|
253
277
|
const locate = async () => {
|
|
254
|
-
const subdivision = await service.subdivision(lat, lng, account, ctx
|
|
278
|
+
const subdivision = await service.subdivision(lat, lng, account, ctx, {
|
|
279
|
+
bufferKm: coastalBufferKm,
|
|
280
|
+
});
|
|
255
281
|
if (subdivision !== undefined)
|
|
256
282
|
return { subdivision };
|
|
257
283
|
const remainingMs = TOOL_BUDGET_MS - (Date.now() - startedAt);
|
|
@@ -276,10 +302,26 @@ export const reverseGeocodeTool = tool('geonames_reverse_geocode', {
|
|
|
276
302
|
const shown = nearby.length;
|
|
277
303
|
ctx.enrich({ shown });
|
|
278
304
|
const fragments = [];
|
|
279
|
-
if (subdivision === undefined) {
|
|
280
|
-
fragments.push(
|
|
281
|
-
?
|
|
282
|
-
: `No country contains this point; it lies in ${inlineText(ocean.name)}.
|
|
305
|
+
if (subdivision === undefined && ocean !== undefined) {
|
|
306
|
+
fragments.push(coastalBufferKm > 0
|
|
307
|
+
? `No country lies within ${coastalBufferKm} km of this point; it lies in ${inlineText(ocean.name)}.`
|
|
308
|
+
: `No country contains this point; it lies in ${inlineText(ocean.name)}. A harbor or shoreline point just outside a country's outline resolves to the water body: set coastalBufferKm (up to ${MAX_COASTAL_BUFFER_KM}) to match the nearest country within that distance.`);
|
|
309
|
+
}
|
|
310
|
+
else if (subdivision === undefined) {
|
|
311
|
+
const noCountry = coastalBufferKm > 0
|
|
312
|
+
? `GeoNames has no country within ${coastalBufferKm} km of this point and no ocean for it`
|
|
313
|
+
: 'GeoNames has no country or ocean for this point';
|
|
314
|
+
fragments.push(`${noCountry} (polar or unmapped area); geonames_search_places with a boundingBox around it can still find named features.`);
|
|
315
|
+
if (coastalBufferKm === 0) {
|
|
316
|
+
fragments.push(`A shoreline point just outside a country's outline can land here too: set coastalBufferKm (up to ${MAX_COASTAL_BUFFER_KM}) to match the nearest country within that distance.`);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
else if (subdivision.country?.distanceInKm !== undefined) {
|
|
320
|
+
const { countryCode, countryName, distanceInKm } = subdivision.country;
|
|
321
|
+
const label = countryName === undefined
|
|
322
|
+
? inlineText(countryCode)
|
|
323
|
+
: `${inlineText(countryName)} (${inlineText(countryCode)})`;
|
|
324
|
+
fragments.push(`No country contains this point exactly; ${label} was matched ${distanceInKm} km away, within the ${coastalBufferKm} km coastal buffer.`);
|
|
283
325
|
}
|
|
284
326
|
const widen = radiusKm < MAX_RADIUS_KM
|
|
285
327
|
? `raise radiusKm (max ${MAX_RADIUS_KM})`
|
|
@@ -288,12 +330,10 @@ export const reverseGeocodeTool = tool('geonames_reverse_geocode', {
|
|
|
288
330
|
fragments.push(`No populated place within ${radiusKm} km${cities === undefined ? '' : ` in ${cities}`}; ${widen}${cities === undefined ? '' : ' or drop cities'}.`);
|
|
289
331
|
}
|
|
290
332
|
if (nearbyKind === 'features' && shown === 0) {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
.filter(Boolean)
|
|
296
|
-
.join(' or ');
|
|
333
|
+
// Past feature_filter_mismatch, any listed classes are the codes' own: the codes are the filter.
|
|
334
|
+
const filter = featureCodes === undefined
|
|
335
|
+
? `of class ${featureClasses?.join(', ')}`
|
|
336
|
+
: `with code ${featureCodes.join(', ')}`;
|
|
297
337
|
fragments.push(`No feature ${filter} within ${radiusKm} km; ${widen} or widen the feature filter (geonames_list_reference topic feature_codes).`);
|
|
298
338
|
}
|
|
299
339
|
if (shown > 0 && shown === nearbyLimit) {
|
|
@@ -325,7 +365,7 @@ export const reverseGeocodeTool = tool('geonames_reverse_geocode', {
|
|
|
325
365
|
const { country, ocean, timezone } = result;
|
|
326
366
|
lines.push(`**Country:** ${country === undefined
|
|
327
367
|
? 'None'
|
|
328
|
-
: `${country.countryName === undefined ? '' : `${inlineText(country.countryName)} `}(${inlineText(country.countryCode)})`}`);
|
|
368
|
+
: `${country.countryName === undefined ? '' : `${inlineText(country.countryName)} `}(${inlineText(country.countryCode)})${country.distanceInKm === undefined ? '' : `, ${country.distanceInKm} km away (matched within the coastal buffer)`}`}`);
|
|
329
369
|
if (ocean !== undefined) {
|
|
330
370
|
lines.push(`**Ocean or sea:** ${inlineText(ocean.name)}${ocean.geonameId === undefined ? '' : ` (geonameId ${ocean.geonameId})`}`);
|
|
331
371
|
}
|