@ignfab/geocontext 0.8.2 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -11
- package/dist/gpf/adminexpress.d.ts +2 -1
- package/dist/gpf/adminexpress.js +7 -3
- package/dist/gpf/adminexpress.js.map +1 -1
- package/dist/gpf/altitude.d.ts +2 -1
- package/dist/gpf/altitude.js +13 -19
- package/dist/gpf/altitude.js.map +1 -1
- package/dist/gpf/geocode.d.ts +3 -1
- package/dist/gpf/geocode.js +19 -8
- package/dist/gpf/geocode.js.map +1 -1
- package/dist/gpf/parcellaire-express.d.ts +2 -1
- package/dist/gpf/parcellaire-express.js +8 -4
- package/dist/gpf/parcellaire-express.js.map +1 -1
- package/dist/gpf/urbanisme.d.ts +4 -2
- package/dist/gpf/urbanisme.js +32 -5
- package/dist/gpf/urbanisme.js.map +1 -1
- package/dist/gpf/wfs.d.ts +11 -14
- package/dist/gpf/wfs.js +138 -43
- package/dist/gpf/wfs.js.map +1 -1
- package/dist/logger.js.map +1 -1
- package/dist/resources/WfsCqlFilterResource.d.ts +10 -0
- package/dist/resources/WfsCqlFilterResource.js +21 -0
- package/dist/resources/WfsCqlFilterResource.js.map +1 -0
- package/dist/resources/readMarkdownResource.d.ts +1 -0
- package/dist/resources/readMarkdownResource.js +21 -0
- package/dist/resources/readMarkdownResource.js.map +1 -0
- package/dist/tools/AdminexpressTool.d.ts +58 -15
- package/dist/tools/AdminexpressTool.js +33 -13
- package/dist/tools/AdminexpressTool.js.map +1 -1
- package/dist/tools/AltitudeTool.d.ts +64 -16
- package/dist/tools/AltitudeTool.js +30 -12
- package/dist/tools/AltitudeTool.js.map +1 -1
- package/dist/tools/AssietteSupTool.d.ts +64 -16
- package/dist/tools/AssietteSupTool.js +34 -13
- package/dist/tools/AssietteSupTool.js.map +1 -1
- package/dist/tools/CadastreTool.d.ts +68 -15
- package/dist/tools/CadastreTool.js +35 -13
- package/dist/tools/CadastreTool.js.map +1 -1
- package/dist/tools/GeocodeTool.d.ts +73 -10
- package/dist/tools/GeocodeTool.js +35 -9
- package/dist/tools/GeocodeTool.js.map +1 -1
- package/dist/tools/GpfWfsDescribeTypeTool.d.ts +114 -22
- package/dist/tools/GpfWfsDescribeTypeTool.js +38 -15
- package/dist/tools/GpfWfsDescribeTypeTool.js.map +1 -1
- package/dist/tools/GpfWfsGetFeaturesTool.d.ts +65 -28
- package/dist/tools/GpfWfsGetFeaturesTool.js +117 -47
- package/dist/tools/GpfWfsGetFeaturesTool.js.map +1 -1
- package/dist/tools/GpfWfsListTypesTool.d.ts +18 -6
- package/dist/tools/GpfWfsListTypesTool.js +16 -8
- package/dist/tools/GpfWfsListTypesTool.js.map +1 -1
- package/dist/tools/GpfWfsSearchTypesTool.d.ts +61 -14
- package/dist/tools/GpfWfsSearchTypesTool.js +38 -17
- package/dist/tools/GpfWfsSearchTypesTool.js.map +1 -1
- package/dist/tools/UrbanismeTool.d.ts +63 -15
- package/dist/tools/UrbanismeTool.js +42 -13
- package/dist/tools/UrbanismeTool.js.map +1 -1
- package/dist/tools/toolAnnotations.d.ts +6 -0
- package/dist/tools/toolAnnotations.js +7 -0
- package/dist/tools/toolAnnotations.js.map +1 -0
- package/package.json +3 -3
|
@@ -1,22 +1,70 @@
|
|
|
1
1
|
import { MCPTool } from "mcp-framework";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
lon:
|
|
5
|
-
lat:
|
|
6
|
-
}
|
|
7
|
-
|
|
3
|
+
declare const assietteSupInputSchema: z.ZodObject<{
|
|
4
|
+
lon: z.ZodNumber;
|
|
5
|
+
lat: z.ZodNumber;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
lon?: number;
|
|
8
|
+
lat?: number;
|
|
9
|
+
}, {
|
|
10
|
+
lon?: number;
|
|
11
|
+
lat?: number;
|
|
12
|
+
}>;
|
|
13
|
+
type AssietteSupInput = z.infer<typeof assietteSupInputSchema>;
|
|
14
|
+
declare class AssietteSupTool extends MCPTool<AssietteSupInput> {
|
|
8
15
|
name: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
lat: {
|
|
16
|
-
type: z.ZodNumber;
|
|
17
|
-
description: string;
|
|
18
|
-
};
|
|
16
|
+
title: string;
|
|
17
|
+
annotations: {
|
|
18
|
+
readonly readOnlyHint: true;
|
|
19
|
+
readonly destructiveHint: false;
|
|
20
|
+
readonly idempotentHint: true;
|
|
21
|
+
readonly openWorldHint: true;
|
|
19
22
|
};
|
|
20
|
-
|
|
23
|
+
description: string;
|
|
24
|
+
protected outputSchemaShape: z.ZodObject<{
|
|
25
|
+
results: z.ZodArray<z.ZodObject<{
|
|
26
|
+
type: z.ZodString;
|
|
27
|
+
id: z.ZodString;
|
|
28
|
+
bbox: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
29
|
+
distance: z.ZodNumber;
|
|
30
|
+
}, "strip", z.ZodUnknown, z.objectOutputType<{
|
|
31
|
+
type: z.ZodString;
|
|
32
|
+
id: z.ZodString;
|
|
33
|
+
bbox: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
34
|
+
distance: z.ZodNumber;
|
|
35
|
+
}, z.ZodUnknown, "strip">, z.objectInputType<{
|
|
36
|
+
type: z.ZodString;
|
|
37
|
+
id: z.ZodString;
|
|
38
|
+
bbox: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
39
|
+
distance: z.ZodNumber;
|
|
40
|
+
}, z.ZodUnknown, "strip">>, "many">;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
results?: z.objectOutputType<{
|
|
43
|
+
type: z.ZodString;
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
bbox: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
46
|
+
distance: z.ZodNumber;
|
|
47
|
+
}, z.ZodUnknown, "strip">[];
|
|
48
|
+
}, {
|
|
49
|
+
results?: z.objectInputType<{
|
|
50
|
+
type: z.ZodString;
|
|
51
|
+
id: z.ZodString;
|
|
52
|
+
bbox: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
53
|
+
distance: z.ZodNumber;
|
|
54
|
+
}, z.ZodUnknown, "strip">[];
|
|
55
|
+
}>;
|
|
56
|
+
schema: z.ZodObject<{
|
|
57
|
+
lon: z.ZodNumber;
|
|
58
|
+
lat: z.ZodNumber;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
lon?: number;
|
|
61
|
+
lat?: number;
|
|
62
|
+
}, {
|
|
63
|
+
lon?: number;
|
|
64
|
+
lat?: number;
|
|
65
|
+
}>;
|
|
66
|
+
execute(input: AssietteSupInput): Promise<{
|
|
67
|
+
results: any;
|
|
68
|
+
}>;
|
|
21
69
|
}
|
|
22
70
|
export default AssietteSupTool;
|
|
@@ -1,22 +1,43 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MCPTool } from "mcp-framework";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { getAssiettesServitudes, URBANISME_SOURCE } from "../gpf/urbanisme.js";
|
|
4
|
+
import logger from "../logger.js";
|
|
5
|
+
import { READ_ONLY_OPEN_WORLD_TOOL_ANNOTATIONS } from "./toolAnnotations.js";
|
|
6
|
+
const assietteSupInputSchema = z.object({
|
|
7
|
+
lon: z
|
|
8
|
+
.number()
|
|
9
|
+
.min(-180)
|
|
10
|
+
.max(180)
|
|
11
|
+
.describe("La longitude du point."),
|
|
12
|
+
lat: z
|
|
13
|
+
.number()
|
|
14
|
+
.min(-90)
|
|
15
|
+
.max(90)
|
|
16
|
+
.describe("La latitude du point."),
|
|
17
|
+
});
|
|
18
|
+
const assietteSupResultSchema = z
|
|
19
|
+
.object({
|
|
20
|
+
type: z.string().describe("Le type d'assiette de servitude d'utilité publique renvoyé."),
|
|
21
|
+
id: z.string().describe("L'identifiant de l'assiette."),
|
|
22
|
+
bbox: z.array(z.number()).describe("La boîte englobante de l'assiette.").optional(),
|
|
23
|
+
distance: z.number().describe("La distance entre le point demandé et l'assiette retenue."),
|
|
24
|
+
})
|
|
25
|
+
.catchall(z.unknown());
|
|
26
|
+
const assietteSupOutputSchema = z.object({
|
|
27
|
+
results: z.array(assietteSupResultSchema).describe("La liste des assiettes de servitudes d'utilité publique pertinentes pour le point demandé."),
|
|
28
|
+
});
|
|
4
29
|
class AssietteSupTool extends MCPTool {
|
|
5
30
|
name = "assiette_sup";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
lat: {
|
|
13
|
-
type: z.number(),
|
|
14
|
-
description: "La latitude du point",
|
|
15
|
-
},
|
|
16
|
-
};
|
|
31
|
+
title = "Servitudes d’utilité publique";
|
|
32
|
+
annotations = READ_ONLY_OPEN_WORLD_TOOL_ANNOTATIONS;
|
|
33
|
+
description = `Renvoie, pour un point donné par sa longitude et sa latitude, la liste des assiettes de servitudes d'utilité publique (SUP) pertinentes à proximité, avec leurs propriétés associées. Les résultats peuvent inclure des assiettes ponctuelles, linéaires ou surfaciques. (source : ${URBANISME_SOURCE}).`;
|
|
34
|
+
outputSchemaShape = assietteSupOutputSchema;
|
|
35
|
+
schema = assietteSupInputSchema;
|
|
17
36
|
async execute(input) {
|
|
18
37
|
logger.info(`assiette_sup(${input.lon},${input.lat})...`);
|
|
19
|
-
return
|
|
38
|
+
return {
|
|
39
|
+
results: await getAssiettesServitudes(input.lon, input.lat),
|
|
40
|
+
};
|
|
20
41
|
}
|
|
21
42
|
}
|
|
22
43
|
export default AssietteSupTool;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssietteSupTool.js","sourceRoot":"","sources":["../../src/tools/AssietteSupTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"AssietteSupTool.js","sourceRoot":"","sources":["../../src/tools/Assiet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AAC;CACjJ,CAAC,CAAC;AAEH,MAAM,eAAgB,SAAQ,OAAyB;IACrD,IAAI,GAAG,cAAc,CAAC;IACtB,KAAK,GAAG,+BAA+B,CAAC;IACxC,WAAW,GAAG,qCAAqC,CAAC;IACpD,WAAW,GAAG,sRAAsR,gBAAgB,IAAI,CAAC;IAC/S,iBAAiB,GAAG,uBAAuB,CAAC;IAEtD,MAAM,GAAG,sBAAsB,CAAC;IAEhC,KAAK,CAAC,OAAO,CAAC,KAAuB;QACnC,MAAM,CAAC,IAAI,CAAC,gBAAgB,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC;QAC1D,OAAO;YACL,OAAO,EAAE,MAAM,sBAAsB,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC;SAC5D,CAAC;IACJ,CAAC;CACF;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -1,22 +1,75 @@
|
|
|
1
1
|
import { MCPTool } from "mcp-framework";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
lon:
|
|
5
|
-
lat:
|
|
6
|
-
}
|
|
3
|
+
declare const cadastreInputSchema: z.ZodObject<{
|
|
4
|
+
lon: z.ZodNumber;
|
|
5
|
+
lat: z.ZodNumber;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
lon?: number;
|
|
8
|
+
lat?: number;
|
|
9
|
+
}, {
|
|
10
|
+
lon?: number;
|
|
11
|
+
lat?: number;
|
|
12
|
+
}>;
|
|
13
|
+
type CadastreInput = z.infer<typeof cadastreInputSchema>;
|
|
7
14
|
declare class CadastreTool extends MCPTool<CadastreInput> {
|
|
8
15
|
name: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
lat: {
|
|
16
|
-
type: z.ZodNumber;
|
|
17
|
-
description: string;
|
|
18
|
-
};
|
|
16
|
+
title: string;
|
|
17
|
+
annotations: {
|
|
18
|
+
readonly readOnlyHint: true;
|
|
19
|
+
readonly destructiveHint: false;
|
|
20
|
+
readonly idempotentHint: true;
|
|
21
|
+
readonly openWorldHint: true;
|
|
19
22
|
};
|
|
20
|
-
|
|
23
|
+
description: string;
|
|
24
|
+
protected outputSchemaShape: z.ZodObject<{
|
|
25
|
+
results: z.ZodArray<z.ZodObject<{
|
|
26
|
+
type: z.ZodString;
|
|
27
|
+
id: z.ZodString;
|
|
28
|
+
bbox: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
29
|
+
distance: z.ZodNumber;
|
|
30
|
+
source: z.ZodString;
|
|
31
|
+
}, "strip", z.ZodUnknown, z.objectOutputType<{
|
|
32
|
+
type: z.ZodString;
|
|
33
|
+
id: z.ZodString;
|
|
34
|
+
bbox: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
35
|
+
distance: z.ZodNumber;
|
|
36
|
+
source: z.ZodString;
|
|
37
|
+
}, z.ZodUnknown, "strip">, z.objectInputType<{
|
|
38
|
+
type: z.ZodString;
|
|
39
|
+
id: z.ZodString;
|
|
40
|
+
bbox: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
41
|
+
distance: z.ZodNumber;
|
|
42
|
+
source: z.ZodString;
|
|
43
|
+
}, z.ZodUnknown, "strip">>, "many">;
|
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
|
45
|
+
results?: z.objectOutputType<{
|
|
46
|
+
type: z.ZodString;
|
|
47
|
+
id: z.ZodString;
|
|
48
|
+
bbox: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
49
|
+
distance: z.ZodNumber;
|
|
50
|
+
source: z.ZodString;
|
|
51
|
+
}, z.ZodUnknown, "strip">[];
|
|
52
|
+
}, {
|
|
53
|
+
results?: z.objectInputType<{
|
|
54
|
+
type: z.ZodString;
|
|
55
|
+
id: z.ZodString;
|
|
56
|
+
bbox: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
57
|
+
distance: z.ZodNumber;
|
|
58
|
+
source: z.ZodString;
|
|
59
|
+
}, z.ZodUnknown, "strip">[];
|
|
60
|
+
}>;
|
|
61
|
+
schema: z.ZodObject<{
|
|
62
|
+
lon: z.ZodNumber;
|
|
63
|
+
lat: z.ZodNumber;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
lon?: number;
|
|
66
|
+
lat?: number;
|
|
67
|
+
}, {
|
|
68
|
+
lon?: number;
|
|
69
|
+
lat?: number;
|
|
70
|
+
}>;
|
|
71
|
+
execute(input: CadastreInput): Promise<{
|
|
72
|
+
results: array<object>;
|
|
73
|
+
}>;
|
|
21
74
|
}
|
|
22
75
|
export default CadastreTool;
|
|
@@ -1,22 +1,44 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MCPTool } from "mcp-framework";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { getParcellaireExpress, PARCELLAIRE_EXPRESS_TYPES, PARCELLAIRE_EXPRESS_SOURCE } from "../gpf/parcellaire-express.js";
|
|
4
|
+
import logger from "../logger.js";
|
|
5
|
+
import { READ_ONLY_OPEN_WORLD_TOOL_ANNOTATIONS } from "./toolAnnotations.js";
|
|
6
|
+
const cadastreInputSchema = z.object({
|
|
7
|
+
lon: z
|
|
8
|
+
.number()
|
|
9
|
+
.min(-180)
|
|
10
|
+
.max(180)
|
|
11
|
+
.describe("La longitude du point."),
|
|
12
|
+
lat: z
|
|
13
|
+
.number()
|
|
14
|
+
.min(-90)
|
|
15
|
+
.max(90)
|
|
16
|
+
.describe("La latitude du point."),
|
|
17
|
+
});
|
|
18
|
+
const cadastreResultSchema = z
|
|
19
|
+
.object({
|
|
20
|
+
type: z.string().describe(`Le type d'objet cadastral (${PARCELLAIRE_EXPRESS_TYPES.join(", ")}).`),
|
|
21
|
+
id: z.string().describe("L'identifiant de l'objet cadastral."),
|
|
22
|
+
bbox: z.array(z.number()).describe("La boîte englobante de l'objet cadastral.").optional(),
|
|
23
|
+
distance: z.number().describe("La distance entre le point demandé et l'objet cadastral retenu."),
|
|
24
|
+
source: z.string().describe("La source des données cadastrales."),
|
|
25
|
+
})
|
|
26
|
+
.catchall(z.unknown());
|
|
27
|
+
const cadastreOutputSchema = z.object({
|
|
28
|
+
results: z.array(cadastreResultSchema).describe("La liste des objets cadastraux les plus proches du point demandé."),
|
|
29
|
+
});
|
|
4
30
|
class CadastreTool extends MCPTool {
|
|
5
31
|
name = "cadastre";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
lat: {
|
|
13
|
-
type: z.number(),
|
|
14
|
-
description: "La latitude du point",
|
|
15
|
-
},
|
|
16
|
-
};
|
|
32
|
+
title = "Informations cadastrales";
|
|
33
|
+
annotations = READ_ONLY_OPEN_WORLD_TOOL_ANNOTATIONS;
|
|
34
|
+
description = `Renvoie, pour un point donné par sa longitude et sa latitude, la liste des objets cadastraux (${PARCELLAIRE_EXPRESS_TYPES.join(', ')}) les plus proches, avec leurs informations associées. Les résultats sont retournés au plus une fois par type lorsqu'ils sont disponibles. (source : ${PARCELLAIRE_EXPRESS_SOURCE}).`;
|
|
35
|
+
outputSchemaShape = cadastreOutputSchema;
|
|
36
|
+
schema = cadastreInputSchema;
|
|
17
37
|
async execute(input) {
|
|
18
38
|
logger.info(`cadastre(${input.lon},${input.lat})...`);
|
|
19
|
-
return
|
|
39
|
+
return {
|
|
40
|
+
results: await getParcellaireExpress(input.lon, input.lat),
|
|
41
|
+
};
|
|
20
42
|
}
|
|
21
43
|
}
|
|
22
44
|
export default CadastreTool;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CadastreTool.js","sourceRoot":"","sources":["../../src/tools/CadastreTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"CadastreTool.js","sourceRoot":"","sources":["../../src/tools/CadastreTool.ts"],"names":[],"mappings":"AAAA,O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CAAC,MAAM,CAAC;IACpC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,QAAQ,CAAC,mEAAmE,CAAC;CACrH,CAAC,CAAC;AAEH,MAAM,YAAa,SAAQ,OAAsB;IAC/C,IAAI,GAAG,UAAU,CAAC;IAClB,KAAK,GAAG,0BAA0B,CAAC;IACnC,WAAW,GAAG,qCAAqC,CAAC;IACpD,WAAW,GAAG,iGAAiG,yBAAyB,CAAC,IAAI,CAAC,IAAI,CAAC,wJAAwJ,0BAA0B,IAAI,CAAC;IAChU,iBAAiB,GAAG,oBAAoB,CAAC;IAEnD,MAAM,GAAG,mBAAmB,CAAC;IAE7B,KAAK,CAAC,OAAO,CAAC,KAAoB;QAChC,MAAM,CAAC,IAAI,CAAC,YAAY,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC;QACtD,OAAO;YACL,OAAO,EAAE,MAAM,qBAAqB,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC;SAC3D,CAAC;IACJ,CAAC;CACF;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1,17 +1,80 @@
|
|
|
1
1
|
import { MCPTool } from "mcp-framework";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
text:
|
|
5
|
-
|
|
3
|
+
declare const geocodeInputSchema: z.ZodObject<{
|
|
4
|
+
text: z.ZodString;
|
|
5
|
+
maximumResponses: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
text?: string;
|
|
8
|
+
maximumResponses?: number;
|
|
9
|
+
}, {
|
|
10
|
+
text?: string;
|
|
11
|
+
maximumResponses?: number;
|
|
12
|
+
}>;
|
|
13
|
+
type GeocodeInput = z.infer<typeof geocodeInputSchema>;
|
|
6
14
|
declare class GeocodeTool extends MCPTool<GeocodeInput> {
|
|
7
15
|
name: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
title: string;
|
|
17
|
+
annotations: {
|
|
18
|
+
readonly readOnlyHint: true;
|
|
19
|
+
readonly destructiveHint: false;
|
|
20
|
+
readonly idempotentHint: true;
|
|
21
|
+
readonly openWorldHint: true;
|
|
14
22
|
};
|
|
15
|
-
|
|
23
|
+
description: string;
|
|
24
|
+
protected outputSchemaShape: z.ZodObject<{
|
|
25
|
+
results: z.ZodArray<z.ZodObject<{
|
|
26
|
+
lon: z.ZodNumber;
|
|
27
|
+
lat: z.ZodNumber;
|
|
28
|
+
fulltext: z.ZodString;
|
|
29
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
30
|
+
city: z.ZodOptional<z.ZodString>;
|
|
31
|
+
zipcode: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
lon?: number;
|
|
34
|
+
lat?: number;
|
|
35
|
+
fulltext?: string;
|
|
36
|
+
kind?: string;
|
|
37
|
+
city?: string;
|
|
38
|
+
zipcode?: string;
|
|
39
|
+
}, {
|
|
40
|
+
lon?: number;
|
|
41
|
+
lat?: number;
|
|
42
|
+
fulltext?: string;
|
|
43
|
+
kind?: string;
|
|
44
|
+
city?: string;
|
|
45
|
+
zipcode?: string;
|
|
46
|
+
}>, "many">;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
results?: {
|
|
49
|
+
lon?: number;
|
|
50
|
+
lat?: number;
|
|
51
|
+
fulltext?: string;
|
|
52
|
+
kind?: string;
|
|
53
|
+
city?: string;
|
|
54
|
+
zipcode?: string;
|
|
55
|
+
}[];
|
|
56
|
+
}, {
|
|
57
|
+
results?: {
|
|
58
|
+
lon?: number;
|
|
59
|
+
lat?: number;
|
|
60
|
+
fulltext?: string;
|
|
61
|
+
kind?: string;
|
|
62
|
+
city?: string;
|
|
63
|
+
zipcode?: string;
|
|
64
|
+
}[];
|
|
65
|
+
}>;
|
|
66
|
+
schema: z.ZodObject<{
|
|
67
|
+
text: z.ZodString;
|
|
68
|
+
maximumResponses: z.ZodOptional<z.ZodNumber>;
|
|
69
|
+
}, "strip", z.ZodTypeAny, {
|
|
70
|
+
text?: string;
|
|
71
|
+
maximumResponses?: number;
|
|
72
|
+
}, {
|
|
73
|
+
text?: string;
|
|
74
|
+
maximumResponses?: number;
|
|
75
|
+
}>;
|
|
76
|
+
execute(input: GeocodeInput): Promise<{
|
|
77
|
+
results: any;
|
|
78
|
+
}>;
|
|
16
79
|
}
|
|
17
80
|
export default GeocodeTool;
|
|
@@ -2,18 +2,44 @@ import { MCPTool } from "mcp-framework";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { geocode, GEOCODE_SOURCE } from "../gpf/geocode.js";
|
|
4
4
|
import logger from "../logger.js";
|
|
5
|
+
import { READ_ONLY_OPEN_WORLD_TOOL_ANNOTATIONS } from "./toolAnnotations.js";
|
|
6
|
+
const geocodeInputSchema = z.object({
|
|
7
|
+
text: z
|
|
8
|
+
.string()
|
|
9
|
+
.trim()
|
|
10
|
+
.min(1, "le texte ne doit pas être vide")
|
|
11
|
+
.describe("Le texte devant être completé et géocodé"),
|
|
12
|
+
maximumResponses: z
|
|
13
|
+
.number()
|
|
14
|
+
.int()
|
|
15
|
+
.min(1)
|
|
16
|
+
.max(10)
|
|
17
|
+
.optional()
|
|
18
|
+
.describe("Le nombre maximum de résultats à retourner (entre 1 et 10). Défaut : 3."),
|
|
19
|
+
});
|
|
20
|
+
const geocodeResultSchema = z.object({
|
|
21
|
+
lon: z.number().describe("La longitude du résultat."),
|
|
22
|
+
lat: z.number().describe("La latitude du résultat."),
|
|
23
|
+
fulltext: z.string().describe("Le libellé complet du résultat."),
|
|
24
|
+
kind: z.string().describe("La nature du résultat géocodé.").optional(),
|
|
25
|
+
city: z.string().describe("La commune du résultat.").optional(),
|
|
26
|
+
zipcode: z.string().describe("Le code postal du résultat.").optional(),
|
|
27
|
+
});
|
|
28
|
+
const geocodeOutputSchema = z.object({
|
|
29
|
+
results: z.array(geocodeResultSchema).describe("La liste ordonnée des résultats géocodés."),
|
|
30
|
+
});
|
|
5
31
|
class GeocodeTool extends MCPTool {
|
|
6
32
|
name = "geocode";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
};
|
|
33
|
+
title = "Géocodage de lieux et d’adresses";
|
|
34
|
+
annotations = READ_ONLY_OPEN_WORLD_TOOL_ANNOTATIONS;
|
|
35
|
+
description = `Renvoie des résultats d'autocomplétion géocodés à partir d'un texte libre (lieu, adresse, POI), avec coordonnées, libellé complet et informations de localisation (kind, city, zipcode). (source : ${GEOCODE_SOURCE}).`;
|
|
36
|
+
outputSchemaShape = geocodeOutputSchema;
|
|
37
|
+
schema = geocodeInputSchema;
|
|
14
38
|
async execute(input) {
|
|
15
|
-
logger.info(`geocode(${input.text})...`);
|
|
16
|
-
return
|
|
39
|
+
logger.info(`geocode(${input.text}, ${input.maximumResponses ?? 3})...`);
|
|
40
|
+
return {
|
|
41
|
+
results: await geocode(input.text, input.maximumResponses),
|
|
42
|
+
};
|
|
17
43
|
}
|
|
18
44
|
}
|
|
19
45
|
export default GeocodeTool;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeocodeTool.js","sourceRoot":"","sources":["../../src/tools/GeocodeTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"GeocodeTool.js","sourceRoot":"","sources":["../../src/tools/GeocodeTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC5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AqB;IAC7C,IAAI,GAAG,SAAS,CAAC;IACjB,KAAK,GAAG,kCAAkC,CAAC;IAC3C,WAAW,GAAG,qCAAqC,CAAC;IACpD,WAAW,GAAG,sMAAsM,cAAc,IAAI,CAAC;IAC7N,iBAAiB,GAAG,mBAAmB,CAAC;IAElD,MAAM,GAAG,kBAAkB,CAAC;IAE5B,KAAK,CAAC,OAAO,CAAC,KAAmB;QAC/B,MAAM,CAAC,IAAI,CAAC,WAAW,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,gBAAgB,IAAI,CAAC,MAAM,CAAC,CAAC;QACzE,OAAO;YACL,OAAO,EAAE,MAAM,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,gBAAgB,CAAC;SAC3D,CAAC;IACJ,CAAC;CACF;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -1,32 +1,124 @@
|
|
|
1
1
|
import { MCPTool } from "mcp-framework";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import type { Collection } from "@ignfab/gpf-schema-store";
|
|
4
|
+
declare const gpfWfsDescribeTypeInputSchema: z.ZodObject<{
|
|
5
|
+
typename: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
typename?: string;
|
|
8
|
+
}, {
|
|
9
|
+
typename?: string;
|
|
10
|
+
}>;
|
|
11
|
+
type GpfWfsDescribeTypeInput = z.infer<typeof gpfWfsDescribeTypeInputSchema>;
|
|
6
12
|
declare class GpfWfsDescribeTypeTool extends MCPTool<GpfWfsDescribeTypeInput> {
|
|
7
13
|
name: string;
|
|
14
|
+
title: string;
|
|
15
|
+
annotations: {
|
|
16
|
+
readonly readOnlyHint: true;
|
|
17
|
+
readonly destructiveHint: false;
|
|
18
|
+
readonly idempotentHint: true;
|
|
19
|
+
readonly openWorldHint: true;
|
|
20
|
+
};
|
|
8
21
|
description: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
22
|
+
protected outputSchemaShape: z.ZodObject<{
|
|
23
|
+
result: z.ZodObject<{
|
|
24
|
+
id: z.ZodString;
|
|
25
|
+
namespace: z.ZodString;
|
|
26
|
+
name: z.ZodString;
|
|
27
|
+
title: z.ZodString;
|
|
28
|
+
description: z.ZodString;
|
|
29
|
+
properties: z.ZodArray<z.ZodObject<{
|
|
30
|
+
name: z.ZodString;
|
|
31
|
+
type: z.ZodString;
|
|
32
|
+
title: z.ZodOptional<z.ZodString>;
|
|
33
|
+
description: z.ZodOptional<z.ZodString>;
|
|
34
|
+
enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
35
|
+
defaultCrs: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
type?: string;
|
|
38
|
+
name?: string;
|
|
39
|
+
title?: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
enum?: string[];
|
|
42
|
+
defaultCrs?: string;
|
|
43
|
+
}, {
|
|
44
|
+
type?: string;
|
|
45
|
+
name?: string;
|
|
46
|
+
title?: string;
|
|
47
|
+
description?: string;
|
|
48
|
+
enum?: string[];
|
|
49
|
+
defaultCrs?: string;
|
|
50
|
+
}>, "many">;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
id?: string;
|
|
53
|
+
namespace?: string;
|
|
54
|
+
name?: string;
|
|
55
|
+
title?: string;
|
|
56
|
+
description?: string;
|
|
57
|
+
properties?: {
|
|
58
|
+
type?: string;
|
|
59
|
+
name?: string;
|
|
60
|
+
title?: string;
|
|
61
|
+
description?: string;
|
|
62
|
+
enum?: string[];
|
|
63
|
+
defaultCrs?: string;
|
|
64
|
+
}[];
|
|
65
|
+
}, {
|
|
66
|
+
id?: string;
|
|
67
|
+
namespace?: string;
|
|
68
|
+
name?: string;
|
|
69
|
+
title?: string;
|
|
70
|
+
description?: string;
|
|
71
|
+
properties?: {
|
|
72
|
+
type?: string;
|
|
73
|
+
name?: string;
|
|
74
|
+
title?: string;
|
|
75
|
+
description?: string;
|
|
76
|
+
enum?: string[];
|
|
77
|
+
defaultCrs?: string;
|
|
78
|
+
}[];
|
|
79
|
+
}>;
|
|
80
|
+
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
result?: {
|
|
82
|
+
id?: string;
|
|
83
|
+
namespace?: string;
|
|
84
|
+
name?: string;
|
|
85
|
+
title?: string;
|
|
86
|
+
description?: string;
|
|
87
|
+
properties?: {
|
|
88
|
+
type?: string;
|
|
89
|
+
name?: string;
|
|
90
|
+
title?: string;
|
|
91
|
+
description?: string;
|
|
92
|
+
enum?: string[];
|
|
93
|
+
defaultCrs?: string;
|
|
94
|
+
}[];
|
|
13
95
|
};
|
|
14
|
-
}
|
|
96
|
+
}, {
|
|
97
|
+
result?: {
|
|
98
|
+
id?: string;
|
|
99
|
+
namespace?: string;
|
|
100
|
+
name?: string;
|
|
101
|
+
title?: string;
|
|
102
|
+
description?: string;
|
|
103
|
+
properties?: {
|
|
104
|
+
type?: string;
|
|
105
|
+
name?: string;
|
|
106
|
+
title?: string;
|
|
107
|
+
description?: string;
|
|
108
|
+
enum?: string[];
|
|
109
|
+
defaultCrs?: string;
|
|
110
|
+
}[];
|
|
111
|
+
};
|
|
112
|
+
}>;
|
|
113
|
+
schema: z.ZodObject<{
|
|
114
|
+
typename: z.ZodString;
|
|
115
|
+
}, "strip", z.ZodTypeAny, {
|
|
116
|
+
typename?: string;
|
|
117
|
+
}, {
|
|
118
|
+
typename?: string;
|
|
119
|
+
}>;
|
|
15
120
|
execute(input: GpfWfsDescribeTypeInput): Promise<{
|
|
16
|
-
|
|
17
|
-
title?: string;
|
|
18
|
-
abstract?: string;
|
|
19
|
-
boundingBox?: import("@camptocamp/ogc-client").BoundingBox;
|
|
20
|
-
defaultCrs: import("@camptocamp/ogc-client").CrsCode;
|
|
21
|
-
properties: Record<string, import("@camptocamp/ogc-client").FeaturePropertyType>;
|
|
22
|
-
geometryName?: string;
|
|
23
|
-
geometryType?: import("@camptocamp/ogc-client").FeatureGeometryType;
|
|
24
|
-
objectCount?: number;
|
|
25
|
-
keywords?: string[];
|
|
26
|
-
} | {
|
|
27
|
-
type: string;
|
|
28
|
-
message: any;
|
|
29
|
-
help: string;
|
|
121
|
+
result: Collection;
|
|
30
122
|
}>;
|
|
31
123
|
}
|
|
32
124
|
export default GpfWfsDescribeTypeTool;
|