Hi there!
We noticed this morning, around 7:16 AM (UTC) our gemini requests started failing with a bad request error and this body:
[
{
"error": {
"code": 400,
"message": "FunctionDeclaration 'TOOL NAME' in the request exceeds the maximum allowed nesting depth.",
"status": "INVALID_ARGUMENT"
}
}
]
Here’s a request that reproduces the error:
{
"model": "gemini-2.5-pro",
"messages": [
{
"content": "you are a helpful assistant",
"role": "system"
},
{
"role": "user",
"content": "test tool"
}
],
"temperature": 0.1,
"tools": [
{
"function": {
"description": "",
"name": "TestToolCall",
"parameters": {
"user": {
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"items": {
"type": "object",
"properties": {
"itemName": {
"type": "object",
"properties": {
"actualName": {
"type": "string"
}
},
"required": [
"actualName"
]
}
},
"required": [
"itemName"
]
}
},
"required": [
"items"
]
}
},
"required": [
"data"
]
}
}
},
"type": "function"
}
],
"max_tokens": 500,
"stream": false
}
It seems that the maximum level of nesting is now 4, but was this change intended? We were caught off-guard this weekend with the alerts going off.