@ignfab/geocontext 0.9.0 → 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 +34 -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 +5 -3
- package/dist/gpf/wfs.js +59 -19
- 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 +115 -12
- package/dist/tools/GpfWfsDescribeTypeTool.js +39 -13
- 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,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,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,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,qCAAqC,EAAE,MAAM,sBAAsB,CAAC;AAE7E,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,GAAG,EAAE,CAAC;SACH,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,GAAG,CAAC;SACT,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,CAAC,wBAAwB,CAAC;IACrC,GAAG,EAAE,CAAC;SACH,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,EAAE,CAAC;SACR,GAAG,CAAC,EAAE,CAAC;SACP,QAAQ,CAAC,uBAAuB,CAAC;CACrC,CAAC,CAAC;AAIH,MAAM,oBAAoB,GAAG,CAAC;KAC3B,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,yBAAyB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IACjG,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IAC9D,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC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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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AAC,CAAC,QAAQ,EAAE;IAC/D,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC,CAAC,QAAQ,EAAE;CACvE,CAAC,CAAC;AAEH,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,QAAQ,CAAC,2CAA2C,CAAC;CAC5F,CAAC,CAAC;AAEH,MAAM,WAAY,SAAQ,OAAqB;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,21 +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
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
+
}>;
|
|
120
|
+
execute(input: GpfWfsDescribeTypeInput): Promise<{
|
|
121
|
+
result: Collection;
|
|
19
122
|
}>;
|
|
20
123
|
}
|
|
21
124
|
export default GpfWfsDescribeTypeTool;
|
|
@@ -1,28 +1,54 @@
|
|
|
1
1
|
import { MCPTool } from "mcp-framework";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { wfsClient } from "../gpf/wfs.js";
|
|
4
|
+
import { READ_ONLY_OPEN_WORLD_TOOL_ANNOTATIONS } from "./toolAnnotations.js";
|
|
5
|
+
const gpfWfsDescribeTypeInputSchema = z.object({
|
|
6
|
+
typename: z
|
|
7
|
+
.string()
|
|
8
|
+
.trim()
|
|
9
|
+
.min(1, "le nom du type ne doit pas être vide")
|
|
10
|
+
.describe("Le nom du type (ex : BDTOPO_V3:batiment)"),
|
|
11
|
+
});
|
|
12
|
+
const gpfWfsPropertySchema = z.object({
|
|
13
|
+
name: z.string().describe("Le nom de la propriété."),
|
|
14
|
+
type: z.string().describe("Le type de la propriété."),
|
|
15
|
+
title: z.string().describe("Le titre lisible de la propriété.").optional(),
|
|
16
|
+
description: z.string().describe("La description de la propriété.").optional(),
|
|
17
|
+
enum: z.array(z.string()).describe("Les valeurs possibles de la propriété.").optional(),
|
|
18
|
+
defaultCrs: z.string().describe("Le système de coordonnées par défaut si la propriété est géométrique.").optional(),
|
|
19
|
+
});
|
|
20
|
+
const gpfWfsDescribeTypeOutputSchema = z.object({
|
|
21
|
+
result: z.object({
|
|
22
|
+
id: z.string().describe("L'identifiant complet du type WFS."),
|
|
23
|
+
namespace: z.string().describe("L'espace de nommage du type WFS."),
|
|
24
|
+
name: z.string().describe("Le nom court du type WFS."),
|
|
25
|
+
title: z.string().describe("Le titre lisible du type WFS."),
|
|
26
|
+
description: z.string().describe("La description du type WFS."),
|
|
27
|
+
properties: z.array(gpfWfsPropertySchema).describe("La liste des propriétés du type WFS."),
|
|
28
|
+
}).describe("La description détaillée du type WFS."),
|
|
29
|
+
});
|
|
4
30
|
class GpfWfsDescribeTypeTool extends MCPTool {
|
|
5
31
|
name = "gpf_wfs_describe_type";
|
|
32
|
+
title = "Description d’un type WFS";
|
|
33
|
+
annotations = READ_ONLY_OPEN_WORLD_TOOL_ANNOTATIONS;
|
|
6
34
|
description = [
|
|
7
|
-
"Renvoie
|
|
35
|
+
"Renvoie le schéma détaillé d'un type WFS à partir de son identifiant (`typename`) : identifiants, description et liste des propriétés.",
|
|
36
|
+
"Utiliser ce tool après `gpf_wfs_search_types` pour inspecter les propriétés disponibles avant d'appeler `gpf_wfs_get_features`.",
|
|
37
|
+
"La sortie inclut notamment le type des propriétés, leur description, et leurs valeurs possibles (`enum`) lorsqu'elles existent.",
|
|
8
38
|
].join("\r\n");
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
type: z.string(),
|
|
12
|
-
description: "Le nom du type (ex : BDTOPO_V3:batiment)",
|
|
13
|
-
},
|
|
14
|
-
};
|
|
39
|
+
outputSchemaShape = gpfWfsDescribeTypeOutputSchema;
|
|
40
|
+
schema = gpfWfsDescribeTypeInputSchema;
|
|
15
41
|
async execute(input) {
|
|
16
42
|
try {
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
catch (e) {
|
|
43
|
+
const featureType = await wfsClient.getFeatureType(input.typename);
|
|
20
44
|
return {
|
|
21
|
-
|
|
22
|
-
message: e.message,
|
|
23
|
-
help: `Utiliser gpf_get_feature_types pour trouver les types disponibles`
|
|
45
|
+
result: featureType,
|
|
24
46
|
};
|
|
25
47
|
}
|
|
48
|
+
catch (e) {
|
|
49
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
50
|
+
throw new Error(`${message}. Utiliser gpf_wfs_search_types pour trouver un type valide.`);
|
|
51
|
+
}
|
|
26
52
|
}
|
|
27
53
|
}
|
|
28
54
|
export default GpfWfsDescribeTypeTool;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GpfWfsDescribeTypeTool.js","sourceRoot":"","sources":["../../src/tools/GpfWfsDescribeTypeTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"GpfWfsDescribeTypeTool.js","sourceRoot":"","sources":["../../src/tools/GpfWfsDescribeTypeTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,qCAAqC,EAAE,MAAM,sBAAsB,CAAC;AAE7E,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,IAAI,EAAE;SACN,GAAG,CAAC,CAAC,EAAE,sCAAsC,CAAC;SAC9C,QAAQ,CAAC,0CAA0C,CAAC;CACxD,CAAC,CAAC;AAIH,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;IACpD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;IACrD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC,CAAC,QAAQ,EAAE;IAC1E,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC,CAAC,QAAQ,EAAE;IAC9E,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,wCAAwC,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L,MAAM,EAAE,WAAW;aACpB,CAAC;QACJ,CAAC;QAAC,OAAO,CAAU,EAAE,CAAC;YACpB,MAAM,OAAO,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAC3D,MAAM,IAAI,KAAK,CAAC,GAAG,OAAO,8DAA8D,CAAC,CAAC;QAC5F,CAAC;IACH,CAAC;CACF;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -1,40 +1,77 @@
|
|
|
1
1
|
import { MCPTool } from "mcp-framework";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
typename:
|
|
3
|
+
declare const gpfWfsGetFeaturesInputSchema: z.ZodObject<{
|
|
4
|
+
typename: z.ZodString;
|
|
5
|
+
property_names: z.ZodOptional<z.ZodString>;
|
|
6
|
+
sort_by: z.ZodOptional<z.ZodString>;
|
|
7
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
cql_filter: z.ZodOptional<z.ZodString>;
|
|
9
|
+
result_type: z.ZodOptional<z.ZodEnum<["results", "hits", "url"]>>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
cql_filter?: string;
|
|
12
|
+
typename?: string;
|
|
5
13
|
property_names?: string;
|
|
6
|
-
count?: number;
|
|
7
14
|
sort_by?: string;
|
|
15
|
+
count?: number;
|
|
16
|
+
result_type?: "results" | "hits" | "url";
|
|
17
|
+
}, {
|
|
8
18
|
cql_filter?: string;
|
|
9
|
-
|
|
10
|
-
|
|
19
|
+
typename?: string;
|
|
20
|
+
property_names?: string;
|
|
21
|
+
sort_by?: string;
|
|
22
|
+
count?: number;
|
|
23
|
+
result_type?: "results" | "hits" | "url";
|
|
24
|
+
}>;
|
|
25
|
+
type GpfWfsGetFeaturesInput = z.infer<typeof gpfWfsGetFeaturesInputSchema>;
|
|
11
26
|
declare class GpfWfsGetFeaturesTool extends MCPTool<GpfWfsGetFeaturesInput> {
|
|
12
27
|
name: string;
|
|
28
|
+
title: string;
|
|
29
|
+
annotations: {
|
|
30
|
+
readonly readOnlyHint: true;
|
|
31
|
+
readonly destructiveHint: false;
|
|
32
|
+
readonly idempotentHint: true;
|
|
33
|
+
readonly openWorldHint: true;
|
|
34
|
+
};
|
|
13
35
|
description: string;
|
|
14
|
-
schema: {
|
|
15
|
-
typename:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
schema: z.ZodObject<{
|
|
37
|
+
typename: z.ZodString;
|
|
38
|
+
property_names: z.ZodOptional<z.ZodString>;
|
|
39
|
+
sort_by: z.ZodOptional<z.ZodString>;
|
|
40
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
cql_filter: z.ZodOptional<z.ZodString>;
|
|
42
|
+
result_type: z.ZodOptional<z.ZodEnum<["results", "hits", "url"]>>;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
cql_filter?: string;
|
|
45
|
+
typename?: string;
|
|
46
|
+
property_names?: string;
|
|
47
|
+
sort_by?: string;
|
|
48
|
+
count?: number;
|
|
49
|
+
result_type?: "results" | "hits" | "url";
|
|
50
|
+
}, {
|
|
51
|
+
cql_filter?: string;
|
|
52
|
+
typename?: string;
|
|
53
|
+
property_names?: string;
|
|
54
|
+
sort_by?: string;
|
|
55
|
+
count?: number;
|
|
56
|
+
result_type?: "results" | "hits" | "url";
|
|
57
|
+
}>;
|
|
58
|
+
protected createSuccessResponse(data: unknown): import("mcp-framework").ToolResponse | {
|
|
59
|
+
content: {
|
|
60
|
+
type: "text";
|
|
61
|
+
text: string;
|
|
62
|
+
}[];
|
|
63
|
+
structuredContent: {
|
|
64
|
+
result_type?: "hits";
|
|
65
|
+
totalFeatures?: number;
|
|
34
66
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
67
|
+
} | {
|
|
68
|
+
content: {
|
|
69
|
+
type: "text";
|
|
70
|
+
text: string;
|
|
71
|
+
}[];
|
|
72
|
+
structuredContent: {
|
|
73
|
+
url?: string;
|
|
74
|
+
result_type?: "url";
|
|
38
75
|
};
|
|
39
76
|
};
|
|
40
77
|
execute(input: GpfWfsGetFeaturesInput): Promise<any>;
|