@ignfab/geocontext 0.9.3 → 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.
Files changed (75) hide show
  1. package/README.md +46 -28
  2. package/dist/gpf/adminexpress.js +7 -27
  3. package/dist/gpf/adminexpress.js.map +1 -1
  4. package/dist/gpf/parcellaire-express.js +13 -33
  5. package/dist/gpf/parcellaire-express.js.map +1 -1
  6. package/dist/gpf/urbanisme.d.ts +4 -2
  7. package/dist/gpf/urbanisme.js +20 -61
  8. package/dist/gpf/urbanisme.js.map +1 -1
  9. package/dist/gpf/wfs.d.ts +2 -2
  10. package/dist/gpf/wfs.js +17 -71
  11. package/dist/gpf/wfs.js.map +1 -1
  12. package/dist/helpers/distance.d.ts +4 -2
  13. package/dist/helpers/distance.js +20 -5
  14. package/dist/helpers/distance.js.map +1 -1
  15. package/dist/helpers/http.d.ts +4 -0
  16. package/dist/helpers/http.js +103 -1
  17. package/dist/helpers/http.js.map +1 -1
  18. package/dist/helpers/jsonSchema.d.ts +3 -0
  19. package/dist/helpers/jsonSchema.js +8 -0
  20. package/dist/helpers/jsonSchema.js.map +1 -0
  21. package/dist/helpers/schemas.d.ts +13 -0
  22. package/dist/helpers/schemas.js +18 -0
  23. package/dist/helpers/schemas.js.map +1 -0
  24. package/dist/helpers/wfs.d.ts +27 -0
  25. package/dist/helpers/wfs.js +55 -0
  26. package/dist/helpers/wfs.js.map +1 -0
  27. package/dist/helpers/wfs_internal/compile.d.ts +46 -0
  28. package/dist/helpers/wfs_internal/compile.js +595 -0
  29. package/dist/helpers/wfs_internal/compile.js.map +1 -0
  30. package/dist/helpers/wfs_internal/request.d.ts +38 -0
  31. package/dist/helpers/wfs_internal/request.js +92 -0
  32. package/dist/helpers/wfs_internal/request.js.map +1 -0
  33. package/dist/helpers/wfs_internal/response.d.ts +21 -0
  34. package/dist/helpers/wfs_internal/response.js +29 -0
  35. package/dist/helpers/wfs_internal/response.js.map +1 -0
  36. package/dist/helpers/wfs_internal/schema.d.ts +167 -0
  37. package/dist/helpers/wfs_internal/schema.js +81 -0
  38. package/dist/helpers/wfs_internal/schema.js.map +1 -0
  39. package/dist/index.js +47 -25
  40. package/dist/index.js.map +1 -1
  41. package/dist/tools/AdminexpressTool.d.ts +52 -2
  42. package/dist/tools/AdminexpressTool.js +11 -14
  43. package/dist/tools/AdminexpressTool.js.map +1 -1
  44. package/dist/tools/AltitudeTool.d.ts +2 -2
  45. package/dist/tools/AltitudeTool.js +4 -13
  46. package/dist/tools/AltitudeTool.js.map +1 -1
  47. package/dist/tools/AssietteSupTool.d.ts +55 -3
  48. package/dist/tools/AssietteSupTool.js +12 -15
  49. package/dist/tools/AssietteSupTool.js.map +1 -1
  50. package/dist/tools/CadastreTool.d.ts +52 -2
  51. package/dist/tools/CadastreTool.js +13 -15
  52. package/dist/tools/CadastreTool.js.map +1 -1
  53. package/dist/tools/GeocodeTool.d.ts +2 -2
  54. package/dist/tools/GeocodeTool.js +6 -4
  55. package/dist/tools/GeocodeTool.js.map +1 -1
  56. package/dist/tools/GpfWfsDescribeTypeTool.d.ts +16 -16
  57. package/dist/tools/GpfWfsDescribeTypeTool.js +4 -3
  58. package/dist/tools/GpfWfsDescribeTypeTool.js.map +1 -1
  59. package/dist/tools/GpfWfsGetFeaturesTool.d.ts +170 -44
  60. package/dist/tools/GpfWfsGetFeaturesTool.js +161 -114
  61. package/dist/tools/GpfWfsGetFeaturesTool.js.map +1 -1
  62. package/dist/tools/GpfWfsSearchTypesTool.d.ts +8 -2
  63. package/dist/tools/GpfWfsSearchTypesTool.js +12 -9
  64. package/dist/tools/GpfWfsSearchTypesTool.js.map +1 -1
  65. package/dist/tools/UrbanismeTool.d.ts +53 -3
  66. package/dist/tools/UrbanismeTool.js +9 -15
  67. package/dist/tools/UrbanismeTool.js.map +1 -1
  68. package/package.json +8 -7
  69. package/dist/resources/WfsCqlFilterResource.d.ts +0 -10
  70. package/dist/resources/WfsCqlFilterResource.js +0 -23
  71. package/dist/resources/WfsCqlFilterResource.js.map +0 -1
  72. package/dist/resources/content/wfs-cql-filter.md +0 -215
  73. package/dist/tools/GpfWfsListTypesTool.d.ts +0 -22
  74. package/dist/tools/GpfWfsListTypesTool.js +0 -26
  75. package/dist/tools/GpfWfsListTypesTool.js.map +0 -1
@@ -3,7 +3,7 @@ import { z } from "zod";
3
3
  declare const gpfWfsSearchTypesInputSchema: z.ZodObject<{
4
4
  query: z.ZodString;
5
5
  max_results: z.ZodOptional<z.ZodNumber>;
6
- }, "strip", z.ZodTypeAny, {
6
+ }, "strict", z.ZodTypeAny, {
7
7
  query?: string;
8
8
  max_results?: number;
9
9
  }, {
@@ -26,32 +26,37 @@ declare class GpfWfsSearchTypesTool extends MCPTool<GpfWfsSearchTypesInput> {
26
26
  id: z.ZodString;
27
27
  title: z.ZodString;
28
28
  description: z.ZodString;
29
+ score: z.ZodOptional<z.ZodNumber>;
29
30
  }, "strip", z.ZodTypeAny, {
30
31
  id?: string;
31
32
  title?: string;
32
33
  description?: string;
34
+ score?: number;
33
35
  }, {
34
36
  id?: string;
35
37
  title?: string;
36
38
  description?: string;
39
+ score?: number;
37
40
  }>, "many">;
38
41
  }, "strip", z.ZodTypeAny, {
39
42
  results?: {
40
43
  id?: string;
41
44
  title?: string;
42
45
  description?: string;
46
+ score?: number;
43
47
  }[];
44
48
  }, {
45
49
  results?: {
46
50
  id?: string;
47
51
  title?: string;
48
52
  description?: string;
53
+ score?: number;
49
54
  }[];
50
55
  }>;
51
56
  schema: z.ZodObject<{
52
57
  query: z.ZodString;
53
58
  max_results: z.ZodOptional<z.ZodNumber>;
54
- }, "strip", z.ZodTypeAny, {
59
+ }, "strict", z.ZodTypeAny, {
55
60
  query?: string;
56
61
  max_results?: number;
57
62
  }, {
@@ -60,6 +65,7 @@ declare class GpfWfsSearchTypesTool extends MCPTool<GpfWfsSearchTypesInput> {
60
65
  }>;
61
66
  execute(input: GpfWfsSearchTypesInput): Promise<{
62
67
  results: {
68
+ score?: number;
63
69
  id: string;
64
70
  title: string;
65
71
  description: string;
@@ -15,11 +15,12 @@ const gpfWfsSearchTypesInputSchema = z.object({
15
15
  .max(50)
16
16
  .optional()
17
17
  .describe("Le nombre maximum de résultats à retourner (entre 1 et 50). Défaut : 10."),
18
- });
18
+ }).strict();
19
19
  const gpfWfsSearchTypeResultSchema = z.object({
20
20
  id: z.string().describe("L'identifiant complet du type WFS."),
21
21
  title: z.string().describe("Le titre lisible du type WFS."),
22
22
  description: z.string().describe("La description du type WFS."),
23
+ score: z.number().describe("Le score de pertinence de la recherche.").optional(),
23
24
  });
24
25
  const gpfWfsSearchTypesOutputSchema = z.object({
25
26
  results: z.array(gpfWfsSearchTypeResultSchema).describe("La liste ordonnée des types WFS trouvés."),
@@ -30,20 +31,22 @@ class GpfWfsSearchTypesTool extends MCPTool {
30
31
  annotations = READ_ONLY_OPEN_WORLD_TOOL_ANNOTATIONS;
31
32
  description = [
32
33
  "Recherche des types WFS de la Géoplateforme (GPF) à partir de mots-clés afin de trouver un identifiant de type (`typename`) valide.",
33
- "Utiliser ce tool avant `gpf_wfs_describe_type` ou `gpf_wfs_get_features` lorsque le nom exact du type n'est pas connu.",
34
- "La recherche est textuelle (mini-search) et retourne une liste ordonnée de candidats avec leur identifiant, leur titre et leur description.",
34
+ "La recherche est textuelle (mini-search) et retourne une liste ordonnée de candidats avec leur identifiant, leur titre, leur description et un score de pertinence éventuel.",
35
35
  "Le paramètre `max_results` permet d'élargir le nombre de candidats retournés (10 par défaut).",
36
- ].join("\r\n");
36
+ "**Important** : Utiliser ce tool avant `gpf_wfs_describe_type` ou `gpf_wfs_get_features` lorsque le nom exact du type n'est pas connu.",
37
+ "**Important** : Privilégier des termes métier en français pour la recherche."
38
+ ].join("\n");
37
39
  outputSchemaShape = gpfWfsSearchTypesOutputSchema;
38
40
  schema = gpfWfsSearchTypesInputSchema;
39
41
  async execute(input) {
40
42
  const maxResults = input.max_results || 10;
41
- const featureTypes = await wfsClient.searchFeatureTypes(input.query, maxResults);
43
+ const featureTypes = await wfsClient.searchFeatureTypesWithScores(input.query, maxResults);
42
44
  return {
43
- results: featureTypes.map((featureType) => ({
44
- id: featureType.id,
45
- title: featureType.title,
46
- description: featureType.description,
45
+ results: featureTypes.map(({ collection, score }) => ({
46
+ id: collection.id,
47
+ title: collection.title,
48
+ description: collection.description,
49
+ ...(score !== undefined ? { score } : {}),
47
50
  })),
48
51
  };
49
52
  }
@@ -1 +1 @@
1
- {"version":3,"file":"GpfWfsSearchTypesTool.js","sourceRoot":"","sources":["../../src/tools/GpfWfsSearchTypesTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,qCAAqC,EAAE,MAAM,+BAA+B,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,IAAI,EAAE;SACN,GAAG,CAAC,CAAC,EAAE,+CAA+C,CAAC;SACvD,QAAQ,CAAC,yBAAyB,CAAC;IACtC,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,EAAE,CAAC;SACP,QAAQ,EAAE;SACV,QAAQ,CAAC,0EAA0E,CAAC;CACxF,CAAC,CAAC;AAIH,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;IAC7D,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;IAC3D,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;C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,IAAI,CAAC,CAAC;IACH,iBAAiB,GAAG,6BAA6B,CAAC;IAE5D,MAAM,GAAG,4BAA4B,CAAC;IAEtC,KAAK,CAAC,OAAO,CAAC,KAA6B;QACzC,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,IAAI,EAAE,CAAC;QAC3C,MAAM,YAAY,GAAG,MAAM,SAAS,CAAC,4BAA4B,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;QAC3F,OAAO;YACL,OAAO,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;gBACpD,EAAE,EAAE,UAAU,CAAC,EAAE;gBACjB,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,WAAW,EAAE,UAAU,CAAC,WAAW;gBACnC,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC1C,CAAC,CAAC;SACJ,CAAC;IACJ,CAAC;CACF;AAED,eAAe,qBAAqB,CAAC"}
@@ -3,7 +3,7 @@ import { z } from "zod";
3
3
  declare const urbanismeInputSchema: z.ZodObject<{
4
4
  lon: z.ZodNumber;
5
5
  lat: z.ZodNumber;
6
- }, "strip", z.ZodTypeAny, {
6
+ }, "strict", z.ZodTypeAny, {
7
7
  lon?: number;
8
8
  lat?: number;
9
9
  }, {
@@ -26,16 +26,46 @@ declare class UrbanismeTool extends MCPTool<UrbanismeInput> {
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 UrbanismeTool extends MCPTool<UrbanismeInput> {
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 UrbanismeTool extends MCPTool<UrbanismeInput> {
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
- }, "strip", z.ZodTypeAny, {
109
+ }, "strict", z.ZodTypeAny, {
60
110
  lon?: number;
61
111
  lat?: number;
62
112
  }, {
@@ -64,7 +114,7 @@ declare class UrbanismeTool extends MCPTool<UrbanismeInput> {
64
114
  lat?: number;
65
115
  }>;
66
116
  execute(input: UrbanismeInput): Promise<{
67
- results: any;
117
+ results: {}[];
68
118
  }>;
69
119
  }
70
120
  export default UrbanismeTool;
@@ -1,34 +1,29 @@
1
1
  import { MCPTool } from "mcp-framework";
2
2
  import { z } from "zod";
3
3
  import { getUrbanisme, URBANISME_SOURCE } from "../gpf/urbanisme.js";
4
- import logger from "../logger.js";
5
4
  import { READ_ONLY_OPEN_WORLD_TOOL_ANNOTATIONS } from "../helpers/toolAnnotations.js";
5
+ import { featureRefSchema, lonSchema, latSchema } from "../helpers/schemas.js";
6
6
  const urbanismeInputSchema = 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
- });
7
+ lon: lonSchema,
8
+ lat: latSchema,
9
+ }).strict();
18
10
  const urbanismeResultSchema = z
19
11
  .object({
20
12
  type: z.string().describe("Le type d'objet d'urbanisme renvoyé."),
21
13
  id: z.string().describe("L'identifiant de l'objet d'urbanisme."),
22
14
  bbox: z.array(z.number()).describe("La boîte englobante de l'objet d'urbanisme.").optional(),
23
- distance: z.number().describe("La distance entre le point demandé et l'objet d'urbanisme retenu."),
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'objet d'urbanisme retenu."),
24
17
  })
25
18
  .catchall(z.unknown());
26
19
  const urbanismeOutputSchema = z.object({
27
20
  results: z.array(urbanismeResultSchema).describe("La liste des objets d'urbanisme pertinents pour le point demandé."),
28
21
  });
29
22
  const URBANISME_TOOL_DESCRIPTION = [
30
- `Renvoie, pour un point donné par sa longitude et sa latitude, la liste des objets d'urbanisme pertinents du Géoportail de l'Urbanisme (document, zones, prescriptions, informations, etc.), avec leurs propriétés associées. (source : ${URBANISME_SOURCE}).`,
23
+ `Renvoie, pour un point donné par sa \`longitude\` et sa \`latitude\`, la liste des objets d'urbanisme pertinents du Géoportail de l'Urbanisme (document, zones, prescriptions, informations, etc.), avec leurs propriétés associées. (source : ${URBANISME_SOURCE}).`,
31
24
  "Les résultats peuvent notamment inclure le document d'urbanisme applicable ainsi que des éléments réglementaires associés à proximité du point.",
25
+ "Quand un objet correspond à une couche WFS réutilisable, il expose aussi un `feature_ref` compatible avec `gpf_wfs_get_features` et `spatial_operator=\"intersects_feature\"`.",
26
+ "Le zonage PLU (zone U, AU, A, N...) est inclus dans les zones retournées et constitue souvent l'information principale recherchée.",
32
27
  "Modèles d'URL Géoportail de l'Urbanisme :",
33
28
  "- fiche document: https://www.geoportail-urbanisme.gouv.fr/document/by-id/{gpu_doc_id}",
34
29
  "- carte: https://www.geoportail-urbanisme.gouv.fr/map/?documentId={gpu_doc_id}",
@@ -42,7 +37,6 @@ class UrbanismeTool extends MCPTool {
42
37
  outputSchemaShape = urbanismeOutputSchema;
43
38
  schema = urbanismeInputSchema;
44
39
  async execute(input) {
45
- logger.info(`urbanisme(${input.lon},${input.lat})...`);
46
40
  return {
47
41
  results: await getUrbanisme(input.lon, input.lat),
48
42
  };
@@ -1 +1 @@
1
- {"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;YACL,OAAO,EAAE,MAAM,YAAY,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC;SAClD,CAAC;IACJ,CAAC;CACF;AAED,eAAe,aAAa,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ignfab/geocontext",
3
- "version": "0.9.3",
3
+ "version": "0.9.5",
4
4
  "description": "An experimental MCP server providing access to the services and data of the french Geoplateform",
5
5
  "type": "module",
6
6
  "bin": {
@@ -27,9 +27,8 @@
27
27
  },
28
28
  "homepage": "https://github.com/ignfab/geocontext#readme",
29
29
  "scripts": {
30
- "clean:dist": "rm -rf dist",
31
- "copy:resources": "mkdir -p dist/resources/content && cp -R src/resources/content/. dist/resources/content/",
32
- "build": "npm run clean:dist && tsc && npx mcp-build && npm run copy:resources",
30
+ "clean:dist": "node scripts/dist-clean.js",
31
+ "build": "npm run clean:dist && tsc && npx mcp-build",
33
32
  "watch": "tsc --watch",
34
33
  "start": "node dist/index.js",
35
34
  "test": "node --no-warnings --experimental-vm-modules ./node_modules/jest/bin/jest.js",
@@ -38,12 +37,14 @@
38
37
  "fresh": "npm run reset && npm cache verify && npm install && npm run build && npm test"
39
38
  },
40
39
  "dependencies": {
41
- "@camptocamp/ogc-client": "^1.3.0",
42
- "@ignfab/gpf-schema-store": "^0.1.1",
40
+ "@ignfab/gpf-schema-store": "^0.1.5",
41
+ "@rgrove/parse-xml": "^4.2.0",
42
+ "@turf/distance": "^7.3.4",
43
+ "@turf/helpers": "^7.3.4",
43
44
  "https-proxy-agent": "^7.0.6",
44
45
  "jsts": "^2.12.1",
45
46
  "lodash": "^4.17.21",
46
- "mcp-framework": "^0.2.21",
47
+ "mcp-framework": "^0.2.22",
47
48
  "node-fetch": "^3.3.2",
48
49
  "winston": "^3.18.3",
49
50
  "zod": "^3.25.76"
@@ -1,10 +0,0 @@
1
- import { MCPResource, ResourceContent } from "mcp-framework";
2
- declare class WfsCqlFilterResource extends MCPResource {
3
- uri: string;
4
- name: string;
5
- description: string;
6
- mimeType: string;
7
- protected title: string;
8
- read(): Promise<ResourceContent[]>;
9
- }
10
- export default WfsCqlFilterResource;
@@ -1,23 +0,0 @@
1
- import { MCPResource } from "mcp-framework";
2
- import { readFile } from "fs/promises";
3
- import { dirname, join } from "path";
4
- import { fileURLToPath } from "url";
5
- class WfsCqlFilterResource extends MCPResource {
6
- uri = "geocontext://wfs-cql-filter";
7
- name = "geocontext-wfs-cql-filter";
8
- description = "Aide-mémoire pour construire des cql_filter GeoServer utilisables avec les tools WFS.";
9
- mimeType = "text/markdown";
10
- title = "Cheatsheet cql_filter";
11
- async read() {
12
- const text = await readFile(join(dirname(fileURLToPath(import.meta.url)), "content", "wfs-cql-filter.md"), "utf-8");
13
- return [
14
- {
15
- uri: this.uri,
16
- mimeType: this.mimeType,
17
- text,
18
- },
19
- ];
20
- }
21
- }
22
- export default WfsCqlFilterResource;
23
- //# sourceMappingURL=WfsCqlFilterResource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WfsCqlFilterResource.js","sourceRoot":"","sources":["../../src/resources/WfsCqlFilterResource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAmB,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,oBAAqB,SAAQ,WAAW;IAC5C,GAAG,GAAG,6BAA6B,CAAC;IACpC,IAAI,GAAG,2BAA2B,CAAC;IACnC,WAAW,GAAG,uFAAuF,CAAC;IACtG,QAAQ,GAAG,eAAe,CAAC;IACjB,KAAK,GAAG,uBAAuB,CAAC;IAE1C,KAAK,CAAC,IAAI;QACR,MAAM,IAAI,GAAG,MAAM,QAAQ,CACzB,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,mBAAmB,CAAC,EAC7E,OAAO,CACR,CAAC;QAEF,OAAO;YACL;gBACE,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,IAAI;aACL;SACF,CAAC;IACJ,CAAC;CACF;AAED,eAAe,oBAAoB,CAAC"}
@@ -1,215 +0,0 @@
1
- # cql_filter GeoServer
2
-
3
- Utiliser `cql_filter` avec `gpf_wfs_get_features` pour restreindre les objets renvoyés.
4
-
5
- ## Checklist
6
-
7
- Avant d'écrire un `cql_filter` :
8
-
9
- 1. Appeler `gpf_wfs_describe_type`.
10
- 2. Identifier le champ géométrique.
11
- 3. Lire son `defaultCrs`.
12
- 4. Si `defaultCrs = EPSG:4326`, écrire les coordonnées en `lat lon`.
13
- 5. Si `defaultCrs = EPSG:2154`, écrire les coordonnées en `x y`.
14
- 6. Fournir `cql_filter` en texte brut, sans URL encoding manuel.
15
- 7. Utiliser `cql_filter` pour choisir quels objets sont renvoyés, et `property_names` pour choisir quelles propriétés de ces objets sont renvoyées.
16
-
17
- ## Champ géométrique
18
-
19
- Règles pratiques :
20
-
21
- - Un type WFS expose en pratique au plus un seul champ géométrique.
22
- - Le repère le plus fiable est la présence de `defaultCrs`.
23
- - Utiliser le nom exact du champ renvoyé par `gpf_wfs_describe_type`, par exemple `geom`, `geometrie` ou `the_geom`.
24
- - Le `type` du champ géométrique peut être `geometry`, `point`, `linestring`, `polygon`, `multipolygon`, etc.
25
-
26
- Exemple :
27
-
28
- ```json
29
- {
30
- "name": "geom",
31
- "type": "multipolygon",
32
- "defaultCrs": "EPSG:4326"
33
- }
34
- ```
35
-
36
- ## Ordre des coordonnées
37
-
38
- ### `EPSG:4326`
39
-
40
- Utiliser `lat lon`.
41
-
42
- Exemples :
43
-
44
- - `POINT(48.8566 2.3522)`
45
- - `POLYGON((48.85 2.34,48.86 2.34,48.86 2.36,48.85 2.36,48.85 2.34))`
46
-
47
- ### `EPSG:2154`
48
-
49
- Utiliser `x y`, c'est-à-dire `easting northing`.
50
-
51
- Exemples :
52
-
53
- - `POINT(700000 6600000)`
54
- - `POLYGON((700000 6600000,700500 6600000,700500 6600500,700000 6600500,700000 6600000))`
55
-
56
- ## URL encoding
57
-
58
- Ne pas encoder manuellement `cql_filter`.
59
-
60
- Le tool `gpf_wfs_get_features` encode déjà les paramètres d'URL avec `URLSearchParams`.
61
-
62
- Conséquences :
63
-
64
- - écrire `cql_filter` sous forme lisible
65
- - ne pas remplacer les espaces par `%20`
66
- - ne pas encoder `(`, `)`, `,`, `'`
67
- - si `result_type = "url"`, l'URL renvoyée sera déjà encodée
68
-
69
- Correct :
70
-
71
- ```text
72
- INTERSECTS(geom,POINT(48.8566 2.3522))
73
- ```
74
-
75
- À éviter :
76
-
77
- ```text
78
- INTERSECTS%28geom%2CPOINT%2848.8566%202.3522%29%29
79
- ```
80
-
81
- ## Templates
82
-
83
- ### Égalité
84
-
85
- ```text
86
- code_insee = '75056'
87
- ```
88
-
89
- ### Comparaison numérique
90
-
91
- ```text
92
- population > 100000
93
- ```
94
-
95
- ### Liste de valeurs
96
-
97
- ```text
98
- nature IN ('route', 'chemin', 'sentier')
99
- ```
100
-
101
- ### Intervalle
102
-
103
- ```text
104
- surface BETWEEN 1000 AND 5000
105
- ```
106
-
107
- ### LIKE
108
-
109
- ```text
110
- nom LIKE 'Saint-%'
111
- ```
112
-
113
- ### INTERSECTS avec point en `EPSG:4326`
114
-
115
- ```text
116
- INTERSECTS(geom,POINT(48.8566 2.3522))
117
- ```
118
-
119
- ### INTERSECTS avec point en `EPSG:2154`
120
-
121
- ```text
122
- INTERSECTS(geom,POINT(700000 6600000))
123
- ```
124
-
125
- ### BBOX recommandé en `EPSG:4326`
126
-
127
- ```text
128
- BBOX(geom, 48.80, 2.20, 48.90, 2.45)
129
- ```
130
-
131
- ### BBOX recommandé en `EPSG:2154`
132
-
133
- ```text
134
- BBOX(geom, 699000, 6599000, 701000, 6601000)
135
- ```
136
-
137
- ### POLYGON en `EPSG:4326`
138
-
139
- ```text
140
- INTERSECTS(geom,POLYGON((48.85 2.34,48.86 2.34,48.86 2.36,48.85 2.36,48.85 2.34)))
141
- ```
142
-
143
- ### POLYGON en `EPSG:2154`
144
-
145
- ```text
146
- INTERSECTS(geom,POLYGON((700000 6600000,700500 6600000,700500 6600500,700000 6600500,700000 6600000)))
147
- ```
148
-
149
- ### Distance
150
-
151
- ```text
152
- DWITHIN(geom,POINT(48.8566 2.3522),100,meters)
153
- ```
154
-
155
- ### Attributaire + spatial
156
-
157
- ```text
158
- type = 'hopital' AND BBOX(geom, 48.80, 2.20, 48.90, 2.45)
159
- ```
160
-
161
- ## Filtres attributaires
162
-
163
- Exemples fréquents :
164
-
165
- - `statut = 'actif'`
166
- - `population >= 100000`
167
- - `surface < 5000`
168
- - `etat <> 'supprime'`
169
- - `code_insee IN ('75056', '69123', '31555')`
170
- - `population BETWEEN 100000 AND 500000`
171
- - `nom LIKE '%Paris%'`
172
- - `nature = 'route' AND importance >= 3`
173
-
174
- ## Filtres spatiaux
175
-
176
- Bon premier choix pour un LLM :
177
-
178
- - préférer `BBOX(...)` quand un rectangle suffit
179
- - utiliser `INTERSECTS(...)` pour un point ou un polygone explicite
180
- - utiliser `DWITHIN(...)` pour une recherche par distance
181
-
182
- Exemples :
183
-
184
- - `BBOX(geom, 48.80, 2.20, 48.90, 2.45)`
185
- - `INTERSECTS(geom,POINT(48.8566 2.3522))`
186
- - `INTERSECTS(geom,POLYGON((48.85 2.34,48.86 2.34,48.86 2.36,48.85 2.36,48.85 2.34)))`
187
- - `DWITHIN(geom,POINT(48.8566 2.3522),100,meters)`
188
-
189
- ## Erreurs à éviter
190
-
191
- - Inventer un nom de propriété.
192
- - Oublier d'appeler `gpf_wfs_describe_type`.
193
- - Confondre `lat lon` et `lon lat` en `EPSG:4326`.
194
- - Utiliser `x y` sur un type en `EPSG:4326`.
195
- - Pré-encoder `cql_filter`.
196
- - Utiliser `cql_filter` pour limiter les champs au lieu de `property_names`.
197
- - Construire un `POLYGON` non fermé.
198
-
199
- ## Bonnes pratiques pour un LLM
200
-
201
- - Commencer par un filtre simple.
202
- - Préférer `BBOX(...)` si la zone de recherche est rectangulaire.
203
- - Vérifier systématiquement `defaultCrs` avant toute géométrie.
204
- - Utiliser des apostrophes pour les chaînes.
205
- - Garder le filtre lisible et minimal.
206
- - Ajouter ensuite les conditions supplémentaires si nécessaire.
207
-
208
- ## Procédure recommandée
209
-
210
- 1. Trouver le type avec `gpf_wfs_search_types`.
211
- 2. Lire les propriétés avec `gpf_wfs_describe_type`.
212
- 3. Identifier le champ géométrique via `defaultCrs`.
213
- 4. Choisir l'ordre des coordonnées selon le CRS.
214
- 5. Écrire un premier filtre simple.
215
- 6. Ajouter ensuite les contraintes attributaires ou spatiales.
@@ -1,22 +0,0 @@
1
- import { MCPTool } from "mcp-framework";
2
- import { z } from "zod";
3
- declare const gpfWfsListTypesInputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
4
- type GpfWfsListTypesInput = z.infer<typeof gpfWfsListTypesInputSchema>;
5
- declare class GpfWfsListTypesTool extends MCPTool<GpfWfsListTypesInput> {
6
- name: string;
7
- title: string;
8
- annotations: {
9
- readOnlyHint: boolean;
10
- destructiveHint: boolean;
11
- idempotentHint: boolean;
12
- openWorldHint: boolean;
13
- };
14
- description: string;
15
- schema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
16
- execute(input: GpfWfsListTypesInput): Promise<{
17
- id: string;
18
- title: string;
19
- description: string;
20
- }[]>;
21
- }
22
- export default GpfWfsListTypesTool;
@@ -1,26 +0,0 @@
1
- import { MCPTool } from "mcp-framework";
2
- import { z } from "zod";
3
- import { READ_ONLY_OPEN_WORLD_TOOL_ANNOTATIONS } from "../helpers/toolAnnotations.js";
4
- import { wfsClient } from "../gpf/wfs.js";
5
- const gpfWfsListTypesInputSchema = z.object({});
6
- class GpfWfsListTypesTool extends MCPTool {
7
- name = "gpf_wfs_list_types";
8
- title = "Liste complète des types WFS";
9
- annotations = READ_ONLY_OPEN_WORLD_TOOL_ANNOTATIONS;
10
- description = [
11
- "Renvoie la liste complète des types WFS de la Géoplateforme (GPF).",
12
- "Utiliser ce tool pour un inventaire exhaustif ou une exploration globale du catalogue.",
13
- "Pour trouver rapidement un type pertinent à partir de mots-clés, utiliser de préférence gpf_wfs_search_types.",
14
- ].join("\r\n");
15
- schema = gpfWfsListTypesInputSchema;
16
- async execute(input) {
17
- const featureTypes = await wfsClient.getFeatureTypes();
18
- return featureTypes.map((featureType) => ({
19
- id: featureType.id,
20
- title: featureType.title,
21
- description: featureType.description,
22
- }));
23
- }
24
- }
25
- export default GpfWfsListTypesTool;
26
- //# sourceMappingURL=GpfWfsListTypesTool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GpfWfsListTypesTool.js","sourceRoot":"","sources":["../../src/tools/GpfWfsListTypesTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,qCAAqC,EAAE,MAAM,+BAA+B,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAIhD,MAAM,mBAAoB,SAAQ,OAA6B;IAC7D,IAAI,GAAG,oBAAoB,CAAC;IAC5B,KAAK,GAAG,8BAA8B,CAAC;IACvC,WAAW,GAAG,qCAAqC,CAAC;IACpD,WAAW,GAAG;QACZ,oEAAoE;QACpE,wFAAwF;QACxF,+GAA+G;KAChH,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACf,MAAM,GAAG,0BAA0B,CAAC;IAEpC,KAAK,CAAC,OAAO,CAAC,KAA2B;QACvC,MAAM,YAAY,GAAG,MAAM,SAAS,CAAC,eAAe,EAAE,CAAC;QACvD,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;YACxC,EAAE,EAAE,WAAW,CAAC,EAAE;YAClB,KAAK,EAAE,WAAW,CAAC,KAAK;YACxB,WAAW,EAAE,WAAW,CAAC,WAAW;SACrC,CAAC,CAAC,CAAC;IACN,CAAC;CACF;AAED,eAAe,mBAAmB,CAAC"}