fix(schema): use []string for QueryDatalogInput.Inputs to satisfy Gemini API#3
Merged
skridlevsky merged 1 commit intoMar 10, 2026
Conversation
…ini API When using graphthulhu with Google Gemini-based AI clients, tool registration fails with HTTP 400: tools[N].function_declarations[0].parameters.properties[inputs].items: missing field The root cause: []any generates a JSON Schema array without an 'items' field. Anthropic's API accepts this silently; Google's API rejects it. Fix: change Inputs to []string. DataScript bindings are scalar values that can be represented as strings. A conversion loop in QueryDatalog bridges []string back to []any for the internal DatascriptQuery call.
Owner
|
Clean fix. Thanks for catching this. |
Contributor
Author
|
Thanks, helps me a lot with Antigravity |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
When using graphthulhu with Google Gemini-based AI clients, MCP tool registration fails with HTTP 400:
The root cause is
QueryDatalogInput.Inputs []any— Go's[]anygenerates a JSON Schema array without anitemsfield, which violates the JSON Schema spec. Anthropic's API accepts this silently; Google's API rejects it with a 400 error, making graphthulhu unusable with Gemini-based clients.Fix
Change
Inputsfrom[]anyto[]string. DataScript query bindings are scalar values (strings, numbers) that can be represented as strings in practice. A small conversion loop inQueryDatalogbridges[]stringback to[]anyfor the internalDatascriptQuerycall.Changes:
types/tools.go:[]any→[]stringtools/search.go: convert[]stringto[]anybefore passing toDatascriptQueryTesting
Verified that DataScript queries work correctly after the change:
Returns matching page names as expected.