Skip to content

GetGameObjectResource: Add a tool call, and some workarounds#87

Merged
CoderGamester merged 1 commit intoCoderGamester:mainfrom
CharlieHess:get-gameobject-tool
Dec 9, 2025
Merged

GetGameObjectResource: Add a tool call, and some workarounds#87
CoderGamester merged 1 commit intoCoderGamester:mainfrom
CharlieHess:get-gameobject-tool

Conversation

@CharlieHess
Copy link
Copy Markdown
Contributor

  1. Cursor barfs on URIs with parameters, which means attempting to use get_gameobject as a resource in Cursor fails. Instead, we need a tool, which can be invoked with URI template parameters.
  2. We probably need a better architecture for this long-term, but attempting to access any gameObject that relies on certain native C++ libraries (A* Pathfinding, FMOD) will hard crash Unity. This change looks ugly but does make get_gameobject work for codebases using these common Unity dependencies.
  3. In addition get_gameobject will stack overflow Unity for any self-referential serialization chain, which is also surprisingly common. So this adds depth limits to SerializeValue.

In my testing this took get_gameobject from "only works on the simplest objects" to "can handle everything I throw at it," but, every repo is different: ymmv.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 8, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Owner

@CoderGamester CoderGamester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@CoderGamester CoderGamester merged commit bd2d9f3 into CoderGamester:main Dec 9, 2025
1 check passed
@CharlieHess CharlieHess deleted the get-gameobject-tool branch December 12, 2025 23:17
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.

2 participants