Skip to content

gpf_wfs_get_feature_by_id#52

Merged
esgn merged 2 commits intomasterfrom
48-get-feature-by-id
Apr 21, 2026
Merged

gpf_wfs_get_feature_by_id#52
esgn merged 2 commits intomasterfrom
48-get-feature-by-id

Conversation

@esgn
Copy link
Copy Markdown
Member

@esgn esgn commented Apr 20, 2026

closes #48

Summary

This PR introduces a new MCP tool, gpf_wfs_get_feature_by_id, to reliably fetch a single WFS feature by its exact identifier and avoid ambiguous same-layer spatial intersections.

What changed

  • Added gpf_wfs_get_feature_by_id:
    • Input: typename, feature_id, optional select, result_type: results | request (hits intentionally not supported).
    • Strict cardinality checks:
      • 0 result => explicit error
      • >1 result => explicit error
      • returned ID mismatch => explicit error
  • Added WFS request builder for by-id calls in wfs_internal/request.ts.
  • Refactored shared response handling:
    • introduced attachFeatureRefs(...) in wfs_internal/response.ts.
  • Reused existing property validation logic by exporting compileSelectProperty(...) from wfs_internal/compile.ts.
  • Updated gpf_wfs_get_features:
    • rejects intersects_feature when typename === intersects_feature_typename
    • returns a guided error pointing to gpf_wfs_get_feature_by_id.
  • Updated tool descriptions (adminexpress, cadastre, urbanisme, assiette_sup, gpf_wfs_get_features) to strongly direct exact feature_ref reuse to gpf_wfs_get_feature_by_id.
  • Updated README documentation for the new workflow.

Tests

  • Added dedicated test suite for gpf_wfs_get_feature_by_id.
  • Extended strict input tests to include the new tool.
  • Updated gpf_wfs_get_features tests to cover the new same-layer intersection guard and guidance behavior.

Validation

  • npm run build passes (tool definitions validated).
  • npm test passes (all suites green).

@esgn esgn requested a review from mborne April 20, 2026 19:40
@esgn esgn merged commit ad27c3a into master Apr 21, 2026
2 checks passed
@esgn esgn deleted the 48-get-feature-by-id branch April 21, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

adminexpress - get commune boundaries : path not ideal

1 participant