@ignfab/geocontext 0.9.2 → 0.9.5
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 +46 -28
- package/dist/gpf/adminexpress.js +7 -27
- package/dist/gpf/adminexpress.js.map +1 -1
- package/dist/gpf/parcellaire-express.js +13 -33
- package/dist/gpf/parcellaire-express.js.map +1 -1
- package/dist/gpf/urbanisme.d.ts +4 -2
- package/dist/gpf/urbanisme.js +20 -61
- package/dist/gpf/urbanisme.js.map +1 -1
- package/dist/gpf/wfs.d.ts +2 -2
- package/dist/gpf/wfs.js +17 -71
- package/dist/gpf/wfs.js.map +1 -1
- package/dist/helpers/distance.d.ts +4 -2
- package/dist/helpers/distance.js +20 -5
- package/dist/helpers/distance.js.map +1 -1
- package/dist/helpers/http.d.ts +4 -0
- package/dist/helpers/http.js +103 -1
- package/dist/helpers/http.js.map +1 -1
- package/dist/helpers/jsonSchema.d.ts +3 -0
- package/dist/helpers/jsonSchema.js +8 -0
- package/dist/helpers/jsonSchema.js.map +1 -0
- package/dist/helpers/schemas.d.ts +13 -0
- package/dist/helpers/schemas.js +18 -0
- package/dist/helpers/schemas.js.map +1 -0
- package/dist/helpers/toolAnnotations.d.ts +6 -0
- package/dist/helpers/toolAnnotations.js.map +1 -0
- package/dist/helpers/wfs.d.ts +27 -0
- package/dist/helpers/wfs.js +55 -0
- package/dist/helpers/wfs.js.map +1 -0
- package/dist/helpers/wfs_internal/compile.d.ts +46 -0
- package/dist/helpers/wfs_internal/compile.js +595 -0
- package/dist/helpers/wfs_internal/compile.js.map +1 -0
- package/dist/helpers/wfs_internal/request.d.ts +38 -0
- package/dist/helpers/wfs_internal/request.js +92 -0
- package/dist/helpers/wfs_internal/request.js.map +1 -0
- package/dist/helpers/wfs_internal/response.d.ts +21 -0
- package/dist/helpers/wfs_internal/response.js +29 -0
- package/dist/helpers/wfs_internal/response.js.map +1 -0
- package/dist/helpers/wfs_internal/schema.d.ts +167 -0
- package/dist/helpers/wfs_internal/schema.js +81 -0
- package/dist/helpers/wfs_internal/schema.js.map +1 -0
- package/dist/index.js +47 -25
- package/dist/index.js.map +1 -1
- package/dist/tools/AdminexpressTool.d.ts +56 -6
- package/dist/tools/AdminexpressTool.js +12 -15
- package/dist/tools/AdminexpressTool.js.map +1 -1
- package/dist/tools/AltitudeTool.d.ts +6 -6
- package/dist/tools/AltitudeTool.js +5 -14
- package/dist/tools/AltitudeTool.js.map +1 -1
- package/dist/tools/AssietteSupTool.d.ts +59 -7
- package/dist/tools/AssietteSupTool.js +13 -16
- package/dist/tools/AssietteSupTool.js.map +1 -1
- package/dist/tools/CadastreTool.d.ts +56 -6
- package/dist/tools/CadastreTool.js +14 -16
- package/dist/tools/CadastreTool.js.map +1 -1
- package/dist/tools/GeocodeTool.d.ts +6 -6
- package/dist/tools/GeocodeTool.js +7 -5
- package/dist/tools/GeocodeTool.js.map +1 -1
- package/dist/tools/GpfWfsDescribeTypeTool.d.ts +20 -20
- package/dist/tools/GpfWfsDescribeTypeTool.js +5 -4
- package/dist/tools/GpfWfsDescribeTypeTool.js.map +1 -1
- package/dist/tools/GpfWfsGetFeaturesTool.d.ts +174 -48
- package/dist/tools/GpfWfsGetFeaturesTool.js +162 -115
- package/dist/tools/GpfWfsGetFeaturesTool.js.map +1 -1
- package/dist/tools/GpfWfsSearchTypesTool.d.ts +12 -6
- package/dist/tools/GpfWfsSearchTypesTool.js +13 -10
- package/dist/tools/GpfWfsSearchTypesTool.js.map +1 -1
- package/dist/tools/UrbanismeTool.d.ts +57 -7
- package/dist/tools/UrbanismeTool.js +10 -16
- package/dist/tools/UrbanismeTool.js.map +1 -1
- package/package.json +11 -6
- package/dist/resources/WfsCqlFilterResource.d.ts +0 -10
- package/dist/resources/WfsCqlFilterResource.js +0 -21
- package/dist/resources/WfsCqlFilterResource.js.map +0 -1
- package/dist/resources/readMarkdownResource.d.ts +0 -1
- package/dist/resources/readMarkdownResource.js +0 -21
- package/dist/resources/readMarkdownResource.js.map +0 -1
- package/dist/tools/GpfWfsListTypesTool.d.ts +0 -22
- package/dist/tools/GpfWfsListTypesTool.js +0 -26
- package/dist/tools/GpfWfsListTypesTool.js.map +0 -1
- package/dist/tools/toolAnnotations.d.ts +0 -6
- package/dist/tools/toolAnnotations.js.map +0 -1
- /package/dist/{tools → helpers}/toolAnnotations.js +0 -0
|
@@ -1,25 +1,18 @@
|
|
|
1
1
|
import { MCPTool } from "mcp-framework";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { getAdminUnits, ADMINEXPRESS_TYPES, ADMINEXPRESS_SOURCE } from "../gpf/adminexpress.js";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import { READ_ONLY_OPEN_WORLD_TOOL_ANNOTATIONS } from "../helpers/toolAnnotations.js";
|
|
5
|
+
import { featureRefSchema, lonSchema, latSchema } from "../helpers/schemas.js";
|
|
6
6
|
const adminexpressInputSchema = z.object({
|
|
7
|
-
lon:
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
});
|
|
7
|
+
lon: lonSchema,
|
|
8
|
+
lat: latSchema,
|
|
9
|
+
}).strict();
|
|
18
10
|
const adminexpressResultSchema = z
|
|
19
11
|
.object({
|
|
20
12
|
type: z.string().describe(`Le type d'unité administrative (${ADMINEXPRESS_TYPES.join(", ")}).`),
|
|
21
13
|
id: z.string().describe("L'identifiant de l'unité administrative."),
|
|
22
14
|
bbox: z.array(z.number()).describe("La boîte englobante de l'unité administrative.").optional(),
|
|
15
|
+
feature_ref: featureRefSchema.describe("Référence WFS réutilisable, notamment avec `gpf_wfs_get_features` et `spatial_operator = \"intersects_feature\"`."),
|
|
23
16
|
})
|
|
24
17
|
.catchall(z.unknown());
|
|
25
18
|
const adminexpressOutputSchema = z.object({
|
|
@@ -29,11 +22,15 @@ class AdminexpressTool extends MCPTool {
|
|
|
29
22
|
name = "adminexpress";
|
|
30
23
|
title = "Unités administratives";
|
|
31
24
|
annotations = READ_ONLY_OPEN_WORLD_TOOL_ANNOTATIONS;
|
|
32
|
-
description =
|
|
25
|
+
description = [
|
|
26
|
+
`Renvoie, pour un point donné par sa \`longitude\` et sa \`latitude\`, la liste des unités administratives (${ADMINEXPRESS_TYPES.join(", ")}) qui le couvrent, sous forme d'objets typés contenant leurs propriétés administratives.`,
|
|
27
|
+
"Les résultats incluent un `feature_ref` WFS réutilisable. Les propriétés incluent notamment le code INSEE.",
|
|
28
|
+
"Le `feature_ref` de chaque unité administrative est directement réutilisable dans `gpf_wfs_get_features` avec `spatial_operator=\"intersects_feature\"` pour interroger des données sur cette emprise.",
|
|
29
|
+
`(source : ${ADMINEXPRESS_SOURCE}).`
|
|
30
|
+
].join("\n");
|
|
33
31
|
outputSchemaShape = adminexpressOutputSchema;
|
|
34
32
|
schema = adminexpressInputSchema;
|
|
35
33
|
async execute(input) {
|
|
36
|
-
logger.info(`adminexpress(${input.lon},${input.lat})...`);
|
|
37
34
|
return {
|
|
38
35
|
results: await getAdminUnits(input.lon, input.lat),
|
|
39
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminexpressTool.js","sourceRoot":"","sources":["../../src/tools/AdminexpressTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAChG,OAAO,
|
|
1
|
+
{"version":3,"file":"AdminexpressTool.js","sourceRoot":"","sources":["../../src/tools/AdminexpressTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,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AAI,CAAC,0FAA0F;QACrO,4GAA4G;QAC5G,wMAAwM;QACxM,aAAa,mBAAmB,IAAI;KACrC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACH,iBAAiB,GAAG,wBAAwB,CAAC;IAEvD,MAAM,GAAG,uBAAuB,CAAC;IAEjC,KAAK,CAAC,OAAO,CAAC,KAAwB;QACpC,OAAO;YACL,OAAO,EAAE,MAAM,aAAa,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC;SACnD,CAAC;IACJ,CAAC;CACF;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { z } from "zod";
|
|
|
3
3
|
declare const altitudeInputSchema: z.ZodObject<{
|
|
4
4
|
lon: z.ZodNumber;
|
|
5
5
|
lat: z.ZodNumber;
|
|
6
|
-
}, "
|
|
6
|
+
}, "strict", z.ZodTypeAny, {
|
|
7
7
|
lon?: number;
|
|
8
8
|
lat?: number;
|
|
9
9
|
}, {
|
|
@@ -15,10 +15,10 @@ declare class AltitudeTool extends MCPTool<AltitudeInput> {
|
|
|
15
15
|
name: string;
|
|
16
16
|
title: string;
|
|
17
17
|
annotations: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
readOnlyHint: boolean;
|
|
19
|
+
destructiveHint: boolean;
|
|
20
|
+
idempotentHint: boolean;
|
|
21
|
+
openWorldHint: boolean;
|
|
22
22
|
};
|
|
23
23
|
description: string;
|
|
24
24
|
protected outputSchemaShape: z.ZodObject<{
|
|
@@ -56,7 +56,7 @@ declare class AltitudeTool extends MCPTool<AltitudeInput> {
|
|
|
56
56
|
schema: z.ZodObject<{
|
|
57
57
|
lon: z.ZodNumber;
|
|
58
58
|
lat: z.ZodNumber;
|
|
59
|
-
}, "
|
|
59
|
+
}, "strict", z.ZodTypeAny, {
|
|
60
60
|
lon?: number;
|
|
61
61
|
lat?: number;
|
|
62
62
|
}, {
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
import { MCPTool } from "mcp-framework";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { ALTITUDE_SOURCE, getAltitudeByLocation } from "../gpf/altitude.js";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import { READ_ONLY_OPEN_WORLD_TOOL_ANNOTATIONS } from "../helpers/toolAnnotations.js";
|
|
5
|
+
import { lonSchema, latSchema } from "../helpers/schemas.js";
|
|
6
6
|
const altitudeInputSchema = z.object({
|
|
7
|
-
lon:
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
});
|
|
7
|
+
lon: lonSchema,
|
|
8
|
+
lat: latSchema,
|
|
9
|
+
}).strict();
|
|
18
10
|
const altitudeResultSchema = z.object({
|
|
19
11
|
lon: z.number().describe("La longitude du point."),
|
|
20
12
|
lat: z.number().describe("La latitude du point."),
|
|
@@ -32,7 +24,6 @@ class AltitudeTool extends MCPTool {
|
|
|
32
24
|
outputSchemaShape = altitudeOutputSchema;
|
|
33
25
|
schema = altitudeInputSchema;
|
|
34
26
|
async execute(input) {
|
|
35
|
-
logger.info(`altitude(${input.lon},${input.lat})...`);
|
|
36
27
|
return {
|
|
37
28
|
result: await getAltitudeByLocation(input.lon, input.lat),
|
|
38
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AltitudeTool.js","sourceRoot":"","sources":["../../src/tools/AltitudeTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,
|
|
1
|
+
{"version":3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E7B,KAAK,CAAC,OAAO,CAAC,KAAoB;QAChC,OAAO;YACL,MAAM,EAAE,MAAM,qBAAqB,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC;SAC1D,CAAC;IACJ,CAAC;CACF;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { z } from "zod";
|
|
|
3
3
|
declare const assietteSupInputSchema: z.ZodObject<{
|
|
4
4
|
lon: z.ZodNumber;
|
|
5
5
|
lat: z.ZodNumber;
|
|
6
|
-
}, "
|
|
6
|
+
}, "strict", z.ZodTypeAny, {
|
|
7
7
|
lon?: number;
|
|
8
8
|
lat?: number;
|
|
9
9
|
}, {
|
|
@@ -15,10 +15,10 @@ declare class AssietteSupTool extends MCPTool<AssietteSupInput> {
|
|
|
15
15
|
name: string;
|
|
16
16
|
title: string;
|
|
17
17
|
annotations: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
readOnlyHint: boolean;
|
|
19
|
+
destructiveHint: boolean;
|
|
20
|
+
idempotentHint: boolean;
|
|
21
|
+
openWorldHint: boolean;
|
|
22
22
|
};
|
|
23
23
|
description: string;
|
|
24
24
|
protected outputSchemaShape: z.ZodObject<{
|
|
@@ -26,16 +26,46 @@ declare class AssietteSupTool extends MCPTool<AssietteSupInput> {
|
|
|
26
26
|
type: z.ZodString;
|
|
27
27
|
id: z.ZodString;
|
|
28
28
|
bbox: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
29
|
+
feature_ref: z.ZodOptional<z.ZodObject<{
|
|
30
|
+
typename: z.ZodString;
|
|
31
|
+
feature_id: z.ZodString;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
typename?: string;
|
|
34
|
+
feature_id?: string;
|
|
35
|
+
}, {
|
|
36
|
+
typename?: string;
|
|
37
|
+
feature_id?: string;
|
|
38
|
+
}>>;
|
|
29
39
|
distance: z.ZodNumber;
|
|
30
40
|
}, "strip", z.ZodUnknown, z.objectOutputType<{
|
|
31
41
|
type: z.ZodString;
|
|
32
42
|
id: z.ZodString;
|
|
33
43
|
bbox: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
44
|
+
feature_ref: z.ZodOptional<z.ZodObject<{
|
|
45
|
+
typename: z.ZodString;
|
|
46
|
+
feature_id: z.ZodString;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
typename?: string;
|
|
49
|
+
feature_id?: string;
|
|
50
|
+
}, {
|
|
51
|
+
typename?: string;
|
|
52
|
+
feature_id?: string;
|
|
53
|
+
}>>;
|
|
34
54
|
distance: z.ZodNumber;
|
|
35
55
|
}, z.ZodUnknown, "strip">, z.objectInputType<{
|
|
36
56
|
type: z.ZodString;
|
|
37
57
|
id: z.ZodString;
|
|
38
58
|
bbox: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
59
|
+
feature_ref: z.ZodOptional<z.ZodObject<{
|
|
60
|
+
typename: z.ZodString;
|
|
61
|
+
feature_id: z.ZodString;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
typename?: string;
|
|
64
|
+
feature_id?: string;
|
|
65
|
+
}, {
|
|
66
|
+
typename?: string;
|
|
67
|
+
feature_id?: string;
|
|
68
|
+
}>>;
|
|
39
69
|
distance: z.ZodNumber;
|
|
40
70
|
}, z.ZodUnknown, "strip">>, "many">;
|
|
41
71
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -43,6 +73,16 @@ declare class AssietteSupTool extends MCPTool<AssietteSupInput> {
|
|
|
43
73
|
type: z.ZodString;
|
|
44
74
|
id: z.ZodString;
|
|
45
75
|
bbox: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
76
|
+
feature_ref: z.ZodOptional<z.ZodObject<{
|
|
77
|
+
typename: z.ZodString;
|
|
78
|
+
feature_id: z.ZodString;
|
|
79
|
+
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
typename?: string;
|
|
81
|
+
feature_id?: string;
|
|
82
|
+
}, {
|
|
83
|
+
typename?: string;
|
|
84
|
+
feature_id?: string;
|
|
85
|
+
}>>;
|
|
46
86
|
distance: z.ZodNumber;
|
|
47
87
|
}, z.ZodUnknown, "strip">[];
|
|
48
88
|
}, {
|
|
@@ -50,13 +90,23 @@ declare class AssietteSupTool extends MCPTool<AssietteSupInput> {
|
|
|
50
90
|
type: z.ZodString;
|
|
51
91
|
id: z.ZodString;
|
|
52
92
|
bbox: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
93
|
+
feature_ref: z.ZodOptional<z.ZodObject<{
|
|
94
|
+
typename: z.ZodString;
|
|
95
|
+
feature_id: z.ZodString;
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
typename?: string;
|
|
98
|
+
feature_id?: string;
|
|
99
|
+
}, {
|
|
100
|
+
typename?: string;
|
|
101
|
+
feature_id?: string;
|
|
102
|
+
}>>;
|
|
53
103
|
distance: z.ZodNumber;
|
|
54
104
|
}, z.ZodUnknown, "strip">[];
|
|
55
105
|
}>;
|
|
56
106
|
schema: z.ZodObject<{
|
|
57
107
|
lon: z.ZodNumber;
|
|
58
108
|
lat: z.ZodNumber;
|
|
59
|
-
}, "
|
|
109
|
+
}, "strict", z.ZodTypeAny, {
|
|
60
110
|
lon?: number;
|
|
61
111
|
lat?: number;
|
|
62
112
|
}, {
|
|
@@ -64,7 +114,9 @@ declare class AssietteSupTool extends MCPTool<AssietteSupInput> {
|
|
|
64
114
|
lat?: number;
|
|
65
115
|
}>;
|
|
66
116
|
execute(input: AssietteSupInput): Promise<{
|
|
67
|
-
results:
|
|
117
|
+
results: {
|
|
118
|
+
distance: number;
|
|
119
|
+
}[];
|
|
68
120
|
}>;
|
|
69
121
|
}
|
|
70
122
|
export default AssietteSupTool;
|
|
@@ -1,26 +1,19 @@
|
|
|
1
1
|
import { MCPTool } from "mcp-framework";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { getAssiettesServitudes, URBANISME_SOURCE } from "../gpf/urbanisme.js";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import { READ_ONLY_OPEN_WORLD_TOOL_ANNOTATIONS } from "../helpers/toolAnnotations.js";
|
|
5
|
+
import { featureRefSchema, lonSchema, latSchema } from "../helpers/schemas.js";
|
|
6
6
|
const assietteSupInputSchema = z.object({
|
|
7
|
-
lon:
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
});
|
|
7
|
+
lon: lonSchema,
|
|
8
|
+
lat: latSchema,
|
|
9
|
+
}).strict();
|
|
18
10
|
const assietteSupResultSchema = z
|
|
19
11
|
.object({
|
|
20
12
|
type: z.string().describe("Le type d'assiette de servitude d'utilité publique renvoyé."),
|
|
21
13
|
id: z.string().describe("L'identifiant de l'assiette."),
|
|
22
14
|
bbox: z.array(z.number()).describe("La boîte englobante de l'assiette.").optional(),
|
|
23
|
-
|
|
15
|
+
feature_ref: featureRefSchema.describe("Référence WFS réutilisable, notamment avec `gpf_wfs_get_features` et `spatial_operator = \"intersects_feature\"`.").optional(),
|
|
16
|
+
distance: z.number().describe("La distance en mètres entre le point demandé et l'assiette retenue."),
|
|
24
17
|
})
|
|
25
18
|
.catchall(z.unknown());
|
|
26
19
|
const assietteSupOutputSchema = z.object({
|
|
@@ -30,11 +23,15 @@ class AssietteSupTool extends MCPTool {
|
|
|
30
23
|
name = "assiette_sup";
|
|
31
24
|
title = "Servitudes d’utilité publique";
|
|
32
25
|
annotations = READ_ONLY_OPEN_WORLD_TOOL_ANNOTATIONS;
|
|
33
|
-
description =
|
|
26
|
+
description = [
|
|
27
|
+
"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.",
|
|
28
|
+
"Une SUP est une contrainte légale sur l'usage du sol liée à un équipement ou une infrastructure publique (ex : AC pour patrimoine, EL pour voirie, PT pour télécoms, I pour installations classées...).",
|
|
29
|
+
"Les résultats peuvent inclure des assiettes ponctuelles, linéaires ou surfaciques et exposent un `feature_ref` WFS réutilisable quand il est disponible.",
|
|
30
|
+
`(source : ${URBANISME_SOURCE}).`
|
|
31
|
+
].join("\n");
|
|
34
32
|
outputSchemaShape = assietteSupOutputSchema;
|
|
35
33
|
schema = assietteSupInputSchema;
|
|
36
34
|
async execute(input) {
|
|
37
|
-
logger.info(`assiette_sup(${input.lon},${input.lat})...`);
|
|
38
35
|
return {
|
|
39
36
|
results: await getAssiettesServitudes(input.lon, input.lat),
|
|
40
37
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssietteSupTool.js","sourceRoot":"","sources":["../../src/tools/AssietteSupTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,
|
|
1
|
+
{"version":3,"file":"AssietteSupTool.js","sourceRoot":"","sources":["../../src/tools/AssietteSupTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,qCAAqC,EAAE,MAAM,+BAA+B,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAE/E,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,GAAG,EAAE,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,CAAC;SAC5D,CAAC;IACJ,CAAC;CACF;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { z } from "zod";
|
|
|
3
3
|
declare const cadastreInputSchema: z.ZodObject<{
|
|
4
4
|
lon: z.ZodNumber;
|
|
5
5
|
lat: z.ZodNumber;
|
|
6
|
-
}, "
|
|
6
|
+
}, "strict", z.ZodTypeAny, {
|
|
7
7
|
lon?: number;
|
|
8
8
|
lat?: number;
|
|
9
9
|
}, {
|
|
@@ -15,10 +15,10 @@ declare class CadastreTool extends MCPTool<CadastreInput> {
|
|
|
15
15
|
name: string;
|
|
16
16
|
title: string;
|
|
17
17
|
annotations: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
readOnlyHint: boolean;
|
|
19
|
+
destructiveHint: boolean;
|
|
20
|
+
idempotentHint: boolean;
|
|
21
|
+
openWorldHint: boolean;
|
|
22
22
|
};
|
|
23
23
|
description: string;
|
|
24
24
|
protected outputSchemaShape: z.ZodObject<{
|
|
@@ -26,18 +26,48 @@ declare class CadastreTool extends MCPTool<CadastreInput> {
|
|
|
26
26
|
type: z.ZodString;
|
|
27
27
|
id: z.ZodString;
|
|
28
28
|
bbox: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
29
|
+
feature_ref: z.ZodObject<{
|
|
30
|
+
typename: z.ZodString;
|
|
31
|
+
feature_id: z.ZodString;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
typename?: string;
|
|
34
|
+
feature_id?: string;
|
|
35
|
+
}, {
|
|
36
|
+
typename?: string;
|
|
37
|
+
feature_id?: string;
|
|
38
|
+
}>;
|
|
29
39
|
distance: z.ZodNumber;
|
|
30
40
|
source: z.ZodString;
|
|
31
41
|
}, "strip", z.ZodUnknown, z.objectOutputType<{
|
|
32
42
|
type: z.ZodString;
|
|
33
43
|
id: z.ZodString;
|
|
34
44
|
bbox: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
45
|
+
feature_ref: z.ZodObject<{
|
|
46
|
+
typename: z.ZodString;
|
|
47
|
+
feature_id: z.ZodString;
|
|
48
|
+
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
typename?: string;
|
|
50
|
+
feature_id?: string;
|
|
51
|
+
}, {
|
|
52
|
+
typename?: string;
|
|
53
|
+
feature_id?: string;
|
|
54
|
+
}>;
|
|
35
55
|
distance: z.ZodNumber;
|
|
36
56
|
source: z.ZodString;
|
|
37
57
|
}, z.ZodUnknown, "strip">, z.objectInputType<{
|
|
38
58
|
type: z.ZodString;
|
|
39
59
|
id: z.ZodString;
|
|
40
60
|
bbox: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
61
|
+
feature_ref: z.ZodObject<{
|
|
62
|
+
typename: z.ZodString;
|
|
63
|
+
feature_id: z.ZodString;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
typename?: string;
|
|
66
|
+
feature_id?: string;
|
|
67
|
+
}, {
|
|
68
|
+
typename?: string;
|
|
69
|
+
feature_id?: string;
|
|
70
|
+
}>;
|
|
41
71
|
distance: z.ZodNumber;
|
|
42
72
|
source: z.ZodString;
|
|
43
73
|
}, z.ZodUnknown, "strip">>, "many">;
|
|
@@ -46,6 +76,16 @@ declare class CadastreTool extends MCPTool<CadastreInput> {
|
|
|
46
76
|
type: z.ZodString;
|
|
47
77
|
id: z.ZodString;
|
|
48
78
|
bbox: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
79
|
+
feature_ref: z.ZodObject<{
|
|
80
|
+
typename: z.ZodString;
|
|
81
|
+
feature_id: z.ZodString;
|
|
82
|
+
}, "strip", z.ZodTypeAny, {
|
|
83
|
+
typename?: string;
|
|
84
|
+
feature_id?: string;
|
|
85
|
+
}, {
|
|
86
|
+
typename?: string;
|
|
87
|
+
feature_id?: string;
|
|
88
|
+
}>;
|
|
49
89
|
distance: z.ZodNumber;
|
|
50
90
|
source: z.ZodString;
|
|
51
91
|
}, z.ZodUnknown, "strip">[];
|
|
@@ -54,6 +94,16 @@ declare class CadastreTool extends MCPTool<CadastreInput> {
|
|
|
54
94
|
type: z.ZodString;
|
|
55
95
|
id: z.ZodString;
|
|
56
96
|
bbox: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
97
|
+
feature_ref: z.ZodObject<{
|
|
98
|
+
typename: z.ZodString;
|
|
99
|
+
feature_id: z.ZodString;
|
|
100
|
+
}, "strip", z.ZodTypeAny, {
|
|
101
|
+
typename?: string;
|
|
102
|
+
feature_id?: string;
|
|
103
|
+
}, {
|
|
104
|
+
typename?: string;
|
|
105
|
+
feature_id?: string;
|
|
106
|
+
}>;
|
|
57
107
|
distance: z.ZodNumber;
|
|
58
108
|
source: z.ZodString;
|
|
59
109
|
}, z.ZodUnknown, "strip">[];
|
|
@@ -61,7 +111,7 @@ declare class CadastreTool extends MCPTool<CadastreInput> {
|
|
|
61
111
|
schema: z.ZodObject<{
|
|
62
112
|
lon: z.ZodNumber;
|
|
63
113
|
lat: z.ZodNumber;
|
|
64
|
-
}, "
|
|
114
|
+
}, "strict", z.ZodTypeAny, {
|
|
65
115
|
lon?: number;
|
|
66
116
|
lat?: number;
|
|
67
117
|
}, {
|
|
@@ -1,26 +1,19 @@
|
|
|
1
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
|
|
5
|
-
import {
|
|
4
|
+
import { READ_ONLY_OPEN_WORLD_TOOL_ANNOTATIONS } from "../helpers/toolAnnotations.js";
|
|
5
|
+
import { featureRefSchema, lonSchema, latSchema } from "../helpers/schemas.js";
|
|
6
6
|
const cadastreInputSchema = z.object({
|
|
7
|
-
lon:
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
});
|
|
7
|
+
lon: lonSchema,
|
|
8
|
+
lat: latSchema,
|
|
9
|
+
}).strict();
|
|
18
10
|
const cadastreResultSchema = z
|
|
19
11
|
.object({
|
|
20
12
|
type: z.string().describe(`Le type d'objet cadastral (${PARCELLAIRE_EXPRESS_TYPES.join(", ")}).`),
|
|
21
13
|
id: z.string().describe("L'identifiant de l'objet cadastral."),
|
|
22
14
|
bbox: z.array(z.number()).describe("La boîte englobante de l'objet cadastral.").optional(),
|
|
23
|
-
|
|
15
|
+
feature_ref: featureRefSchema.describe("Référence WFS réutilisable, notamment avec `gpf_wfs_get_features` et `spatial_operator = \"intersects_feature\"`."),
|
|
16
|
+
distance: z.number().describe("La distance en mètres entre le point demandé et l'objet cadastral retenu."),
|
|
24
17
|
source: z.string().describe("La source des données cadastrales."),
|
|
25
18
|
})
|
|
26
19
|
.catchall(z.unknown());
|
|
@@ -31,11 +24,16 @@ class CadastreTool extends MCPTool {
|
|
|
31
24
|
name = "cadastre";
|
|
32
25
|
title = "Informations cadastrales";
|
|
33
26
|
annotations = READ_ONLY_OPEN_WORLD_TOOL_ANNOTATIONS;
|
|
34
|
-
description =
|
|
27
|
+
description = [
|
|
28
|
+
`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.`,
|
|
29
|
+
"Les résultats sont retournés au plus une fois par type lorsqu'ils sont disponibles et incluent un `feature_ref` WFS réutilisable.",
|
|
30
|
+
"Le `feature_ref` est directement réutilisable dans `gpf_wfs_get_features` avec `spatial_operator=\"intersects_feature\"`.",
|
|
31
|
+
"La distance de recherche est fixée à 10 mètres. Si aucun objet n'est trouvé dans les 10 mètres, le résultat est vide.",
|
|
32
|
+
`(source : ${PARCELLAIRE_EXPRESS_SOURCE}).`
|
|
33
|
+
].join("\n");
|
|
35
34
|
outputSchemaShape = cadastreOutputSchema;
|
|
36
35
|
schema = cadastreInputSchema;
|
|
37
36
|
async execute(input) {
|
|
38
|
-
logger.info(`cadastre(${input.lon},${input.lat})...`);
|
|
39
37
|
return {
|
|
40
38
|
results: await getParcellaireExpress(input.lon, input.lat),
|
|
41
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CadastreTool.js","sourceRoot":"","sources":["../../src/tools/CadastreTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC7H,OAAO,
|
|
1
|
+
{"version":3,"file":"CadastreTool.js","sourceRoot":"","sources":["../../src/tools/CadastreTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC7H,OAAO,EAAE,qCAAqC,EAAE,MAAM,+BAA+B,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAE/E,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;CACf,CAAC,CAAC,MAAM,EAAE,CAAC;AAIZ,MAAM,oBAAoB,GAAG,CAAC;KAC3B,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,yBAAyB,CAAC,IAAI,CAAC,I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e,YAAY,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { z } from "zod";
|
|
|
3
3
|
declare const geocodeInputSchema: z.ZodObject<{
|
|
4
4
|
text: z.ZodString;
|
|
5
5
|
maximumResponses: z.ZodOptional<z.ZodNumber>;
|
|
6
|
-
}, "
|
|
6
|
+
}, "strict", z.ZodTypeAny, {
|
|
7
7
|
text?: string;
|
|
8
8
|
maximumResponses?: number;
|
|
9
9
|
}, {
|
|
@@ -15,10 +15,10 @@ declare class GeocodeTool extends MCPTool<GeocodeInput> {
|
|
|
15
15
|
name: string;
|
|
16
16
|
title: string;
|
|
17
17
|
annotations: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
readOnlyHint: boolean;
|
|
19
|
+
destructiveHint: boolean;
|
|
20
|
+
idempotentHint: boolean;
|
|
21
|
+
openWorldHint: boolean;
|
|
22
22
|
};
|
|
23
23
|
description: string;
|
|
24
24
|
protected outputSchemaShape: z.ZodObject<{
|
|
@@ -66,7 +66,7 @@ declare class GeocodeTool extends MCPTool<GeocodeInput> {
|
|
|
66
66
|
schema: z.ZodObject<{
|
|
67
67
|
text: z.ZodString;
|
|
68
68
|
maximumResponses: z.ZodOptional<z.ZodNumber>;
|
|
69
|
-
}, "
|
|
69
|
+
}, "strict", z.ZodTypeAny, {
|
|
70
70
|
text?: string;
|
|
71
71
|
maximumResponses?: number;
|
|
72
72
|
}, {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { MCPTool } from "mcp-framework";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { geocode, GEOCODE_SOURCE } from "../gpf/geocode.js";
|
|
4
|
-
import
|
|
5
|
-
import { READ_ONLY_OPEN_WORLD_TOOL_ANNOTATIONS } from "./toolAnnotations.js";
|
|
4
|
+
import { READ_ONLY_OPEN_WORLD_TOOL_ANNOTATIONS } from "../helpers/toolAnnotations.js";
|
|
6
5
|
const geocodeInputSchema = z.object({
|
|
7
6
|
text: z
|
|
8
7
|
.string()
|
|
@@ -16,7 +15,7 @@ const geocodeInputSchema = z.object({
|
|
|
16
15
|
.max(10)
|
|
17
16
|
.optional()
|
|
18
17
|
.describe("Le nombre maximum de résultats à retourner (entre 1 et 10). Défaut : 3."),
|
|
19
|
-
});
|
|
18
|
+
}).strict();
|
|
20
19
|
const geocodeResultSchema = z.object({
|
|
21
20
|
lon: z.number().describe("La longitude du résultat."),
|
|
22
21
|
lat: z.number().describe("La latitude du résultat."),
|
|
@@ -32,11 +31,14 @@ class GeocodeTool extends MCPTool {
|
|
|
32
31
|
name = "geocode";
|
|
33
32
|
title = "Géocodage de lieux et d’adresses";
|
|
34
33
|
annotations = READ_ONLY_OPEN_WORLD_TOOL_ANNOTATIONS;
|
|
35
|
-
description =
|
|
34
|
+
description = [
|
|
35
|
+
"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`).",
|
|
36
|
+
"Les coordonnées `lon/lat` retournées sont directement réutilisables dans tous les autres tools. Le champ `kind` indique le type de résultat (ex : `monument`, `street`, `city`, `locality`).",
|
|
37
|
+
`(source : ${GEOCODE_SOURCE}).`
|
|
38
|
+
].join("\n");
|
|
36
39
|
outputSchemaShape = geocodeOutputSchema;
|
|
37
40
|
schema = geocodeInputSchema;
|
|
38
41
|
async execute(input) {
|
|
39
|
-
logger.info(`geocode(${input.text}, ${input.maximumResponses ?? 3})...`);
|
|
40
42
|
return {
|
|
41
43
|
results: await geocode(input.text, input.maximumResponses),
|
|
42
44
|
};
|
|
@@ -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;AAExB,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAA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