You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mitigation to #82: this PR proposes hiding the geometric property from the output of GpfDescribeType. This way, the LLM should not believe it can query the geometry as part of the select.
The error messages dedicated to the case where the LLM does ask for the geometry in the select are still kept, just in case the LLM somewhat guesses the underlying provider is WFS and that it should be able to obtain the geometry by asking for it.
The change itself is correct and well-targeted: the LLM never actually needs the geometry column name or its CRS (spatial filters are compiled internally from getGeometryProperty, and derived geometry goes through spatial_extras), and hard validation of select already exists in properties.ts. Three remarks:
Information loss to consider: the geometry type disappears entirely. The output previously let the LLM know whether a type carries points, lines or polygons : useful to answer user questions or to judge whether centroid/bbox spatial extras make sense. I also worry about non geometric table like wfs_scot:doc_urba : how will the LLM make a difference between geometric table and non geometric table.
defaultCrs is still in the published output schema.gpfPropertySchema (GpfDescribeTypeTool.ts:33) still advertises a field described as "the default CRS if the property is geometric", but geometric properties can no longer appear in the output. The published contract now contradicts the behavior and wastes tokens on every tool listing. defaultCrs should be removed from the schema and docs/mcp-tools.md regenerated (npm run docs:mcp).
(minor) The "non-geometric" predicate now lives in three places. The filter(p => ! p.defaultCrs) in the tool duplicates buildSelectList (properties.ts:153-155), whose inverse is getGeometryProperties. Since properties.ts is meant to centralize geometry lookup, exporting a small getNonGeometryProperties(featureType) helper and using it in both places would keep the definition of "geometric = has defaultCrs" in a single module.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mitigation to #82: this PR proposes hiding the geometric property from the output of GpfDescribeType. This way, the LLM should not believe it can query the geometry as part of the
select.The error messages dedicated to the case where the LLM does ask for the geometry in the
selectare still kept, just in case the LLM somewhat guesses the underlying provider is WFS and that it should be able to obtain the geometry by asking for it.