GetGameObjectResource: Add a tool call, and some workarounds#87
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Thank you for the PR @CharlieHess
Good suggestion as all the resources need to be converted to Tools. Unfortunately not all MCP clients support resources the same way, and tools are generally accepted.
A more indepth refactoring needs to happen but this is a good start
get_gameobjectas a resource in Cursor fails. Instead, we need a tool, which can be invoked with URI template parameters.gameObjectthat relies on certain native C++ libraries (A* Pathfinding, FMOD) will hard crash Unity. This change looks ugly but does makeget_gameobjectwork for codebases using these common Unity dependencies.get_gameobjectwill stack overflow Unity for any self-referential serialization chain, which is also surprisingly common. So this adds depth limits toSerializeValue.In my testing this took
get_gameobjectfrom "only works on the simplest objects" to "can handle everything I throw at it," but, every repo is different: ymmv.