The add_field tool in server.py directly accesses app._entities (a private attribute) to look up the schema path for an entity type. This couples the MCP tool to the internal representation of UpjackApp.
What to do:
- Add a public method to
UpjackApp for retrieving entity definitions (e.g., get_entity_def(entity_type)) or expose the schema path specifically
- Update
_register_add_field_tool to use the public API instead of app._entities
Why:
If UpjackApp internals change (e.g., _entities gets restructured), add_field breaks silently. A public accessor makes the contract explicit.
Found during QA review of feat/schema-evolution.
The
add_fieldtool inserver.pydirectly accessesapp._entities(a private attribute) to look up the schema path for an entity type. This couples the MCP tool to the internal representation ofUpjackApp.What to do:
UpjackAppfor retrieving entity definitions (e.g.,get_entity_def(entity_type)) or expose the schema path specifically_register_add_field_toolto use the public API instead ofapp._entitiesWhy:
If
UpjackAppinternals change (e.g.,_entitiesgets restructured),add_fieldbreaks silently. A public accessor makes the contract explicit.Found during QA review of
feat/schema-evolution.