Description
The AI Agent tool LookupCampuses (SystemUtilitySkill) returns incorrect data in the location object of every campus. There are two distinct bugs in Rock.AI.Agent/Skills/SystemUtilitySkill.LookupCampuses.cs:
1. geographyPoint.longitude is a copy of the latitude. Line 79 (at tag 19.4.4) passes Latitude twice to the GeographyPoint constructor:
GeographyPoint = ( c.Location.Latitude.HasValue && c.Location.Longitude.HasValue )
? new GeographyPoint( c.Location.Latitude.Value, c.Location.Latitude.Value )
: null
2. Every campus location serializes the same idKey. The LocationResult initializer (lines 71–80) never assigns Id, which is [JsonIgnore]'d on EntityResultBase and exposed only as IdKey => Id.AsIdKey(). Since Id stays 0, every campus's location emits the IdKey of zero (e.g. 3qrvpWB8LM), which an agent could mistake for a real, shared location reference.
Both bugs are present in 19.4.4 (latest release) and on current develop (checked 2026-08-27). The v20.0.x -pre tags predate this skill, so no released or pre-released version has a fix.
Actual Behavior
Calling the LookupCampuses MCP/agent tool returns, for each campus, e.g.:
"location": {
"geographyPoint": { "latitude": 32.73431, "longitude": 32.73431 },
"idKey": "3qrvpWB8LM"
}
The longitude 32.73431 places a Fort Worth, TX campus in the Mediterranean Sea (actual longitude is roughly -97.4), and all campuses share the identical location idKey.
Expected Behavior
geographyPoint.longitude should be the location's actual longitude:
new GeographyPoint( c.Location.Latitude.Value, c.Location.Longitude.Value )
and the location's idKey should either be the real Location IdKey (set Id from the campus's LocationId in the initializer) or be omitted when no Id is available, rather than emitting the IdKey of 0.
Steps to Reproduce
- On a Rock 19.4+ instance with AI Agents configured, create an agent (MCP or chat) with the System Utility skill enabled, on an instance whose campuses have geocoded locations
- Invoke the
LookupCampuses tool from the agent/MCP client
- Inspect the
location object of any returned campus
- Observe
longitude equals latitude, and every campus's location has the same idKey
Issue Confirmation
Rock Version
19.4.4 (also present on develop as of 2026-08-27)
Client Culture Setting
en-US
Description
The AI Agent tool
LookupCampuses(SystemUtilitySkill) returns incorrect data in thelocationobject of every campus. There are two distinct bugs inRock.AI.Agent/Skills/SystemUtilitySkill.LookupCampuses.cs:1.
geographyPoint.longitudeis a copy of the latitude. Line 79 (at tag19.4.4) passesLatitudetwice to theGeographyPointconstructor:2. Every campus location serializes the same
idKey. TheLocationResultinitializer (lines 71–80) never assignsId, which is[JsonIgnore]'d onEntityResultBaseand exposed only asIdKey => Id.AsIdKey(). SinceIdstays0, every campus's location emits the IdKey of zero (e.g.3qrvpWB8LM), which an agent could mistake for a real, shared location reference.Both bugs are present in
19.4.4(latest release) and on currentdevelop(checked 2026-08-27). The v20.0.x-pretags predate this skill, so no released or pre-released version has a fix.Actual Behavior
Calling the
LookupCampusesMCP/agent tool returns, for each campus, e.g.:The longitude
32.73431places a Fort Worth, TX campus in the Mediterranean Sea (actual longitude is roughly-97.4), and all campuses share the identical locationidKey.Expected Behavior
geographyPoint.longitudeshould be the location's actual longitude:and the location's
idKeyshould either be the real Location IdKey (setIdfrom the campus'sLocationIdin the initializer) or be omitted when no Id is available, rather than emitting the IdKey of0.Steps to Reproduce
LookupCampusestool from the agent/MCP clientlocationobject of any returned campuslongitudeequalslatitude, and every campus's location has the sameidKeyIssue Confirmation
Rock Version
19.4.4 (also present on
developas of 2026-08-27)Client Culture Setting
en-US