threehymns
threehymns4w ago

Gemini Search Grounding with Convex Agents

When passing google.tools.googleSearch({}) from @ai-sdk/google as a tool for the Convex agent component, I get this error:
[CONVEX A(chat:createThread)] Server Error
Uncaught Error: Field name $schema starts with a '$', which is reserved.
at validateObjectField (../node_modules/.pnpm/convex@1.27.5_@clerk+clerk-react@5.42.1_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1/node_modules/convex/src/values/value.ts:163:11)
at convexToJsonInternal (../node_modules/.pnpm/convex@1.27.5_@clerk+clerk-react@5.42.1_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1/node_modules/convex/src/values/value.ts:353:8)
at convexToJsonInternal (../node_modules/.pnpm/convex@1.27.5_@clerk+clerk-react@5.42.1_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1/node_modules/convex/src/values/value.ts:353:8)
at convexToJsonInternal (../node_modules/.pnpm/convex@1.27.5_@clerk+clerk-react@5.42.1_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1/node_modules/convex/src/values/value.ts:353:8)
at <anonymous> (../node_modules/.pnpm/convex@1.27.5_@clerk+clerk-react@5.42.1_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1/node_modules/convex/src/values/value.ts:322:4)
at map [as map] (<anonymous>)
at convexToJsonInternal (../node_modules/.pnpm/convex@1.27.5_@clerk+clerk-react@5.42.1_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1/node_modules/convex/src/values/value.ts:320:29)
at convexToJsonInternal (../node_modules/.pnpm/convex@1.27.5_@clerk+clerk-react@5.42.1_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1/node_modules/convex/src/values/value.ts:353:8)
at <anonymous> (../node_modules/.pnpm/convex@1.27.5_@clerk+clerk-react@5.42.1_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1/node_modules/convex/src/values/value.ts:322:4)
at map [as map] (<anonymous>)
[CONVEX A(chat:createThread)] Server Error
Uncaught Error: Field name $schema starts with a '$', which is reserved.
at validateObjectField (../node_modules/.pnpm/convex@1.27.5_@clerk+clerk-react@5.42.1_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1/node_modules/convex/src/values/value.ts:163:11)
at convexToJsonInternal (../node_modules/.pnpm/convex@1.27.5_@clerk+clerk-react@5.42.1_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1/node_modules/convex/src/values/value.ts:353:8)
at convexToJsonInternal (../node_modules/.pnpm/convex@1.27.5_@clerk+clerk-react@5.42.1_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1/node_modules/convex/src/values/value.ts:353:8)
at convexToJsonInternal (../node_modules/.pnpm/convex@1.27.5_@clerk+clerk-react@5.42.1_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1/node_modules/convex/src/values/value.ts:353:8)
at <anonymous> (../node_modules/.pnpm/convex@1.27.5_@clerk+clerk-react@5.42.1_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1/node_modules/convex/src/values/value.ts:322:4)
at map [as map] (<anonymous>)
at convexToJsonInternal (../node_modules/.pnpm/convex@1.27.5_@clerk+clerk-react@5.42.1_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1/node_modules/convex/src/values/value.ts:320:29)
at convexToJsonInternal (../node_modules/.pnpm/convex@1.27.5_@clerk+clerk-react@5.42.1_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1/node_modules/convex/src/values/value.ts:353:8)
at <anonymous> (../node_modules/.pnpm/convex@1.27.5_@clerk+clerk-react@5.42.1_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1/node_modules/convex/src/values/value.ts:322:4)
at map [as map] (<anonymous>)
Other custom tools created with Convex's createTool work fine. I'm on Vite and Tanstack start.
1 Reply
Convex Bot
Convex Bot4w ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!

Did you find this page helpful?