Fix: Gemini CLI 400 Bad Request With 128+ Tools Gemini CLI returns an HTTP 400 error when the enabled tool count from MCP servers and extensions exceeds the Gemini API's tool limit, with the GitHub issue title citing more than 128 tools and the body citing more than 400. The only user-side workaround is disabling unneeded MCP servers and extensions before retrying; a fix PR (#26084, adding smartLimitTools to cap the count automatically) remains open and unmerged as of Nov 15, 2026. Originally published on DebugRadar https://debugradar.com/fix-gemini-cli-400-error-128-tools/ . Gemini CLI returns an HTTP 400 error when too many tools are enabled — the request trips the Gemini API tool limit and fails. The practical fix is to trim your enabled tools: disable the MCP servers and extensions you do not need for the task, then retry. A fix is in progress pull request 26084 caps the tool count automatically , but it is still open and not merged. In search terms this is the 'gemini cli 400 bad request' failure — the API rejects the request the moment the enabled tool count trips its limit. | Error Code | Affected Version | Root Cause | Current Status | |---|---|---|---| | HTTP 400 when the enabled tool count exceeds the limit title: more than 128 tools; body: more than 400 tools — threshold unconfirmed | Gemini CLI google-gemini/gemini-cli | The CLI sends every enabled tool — MCP servers plus extensions — with the request, and the Gemini API rejects the request when the count passes its tool limit. No cause beyond the limit itself has been named. | Still open as of Nov 15, 2026 — google-gemini/gemini-cli 24246, 3 comments. Fix PR 26084 'Fix 400 error when 128 tools enabled', smartLimitTools is OPEN, not merged | Check whether the 400 appears when many tools are enabled and clears when you run with fewer. If the same prompt works with a small tool set and fails with the full set, you have confirmed the cause — it is the tool count, not your prompt, your API key, or your network. Count what the CLI is sending: every enabled MCP server and every enabled extension contributes its tools. Open the CLI settings and list the MCP servers and extensions currently enabled for the session. Disable the MCP servers and extensions you do not need for this task, then retry the same prompt. This is exactly what the open fix PR does automatically smartLimitTools caps the count at the API limit — until that PR merges, you do the capping by hand. Keep the tools you actually need; remove the rest. Retry the prompt with the trimmed tool set. If the 400 clears, you have your answer and your workaround. If it still fails with a small tool set, the problem is something else — report the tool count and the exact error on the issue. Pull request 26084 'Fix 400 error when 128 tools enabled' is the real fix, but it is open and unmerged. Do not wait for it — trim your tools now and work. Check the PR when you update the CLI; once it merges, the CLI caps the count for you. The same discipline applied to the Codex CLI failure in Fix: Codex CLI zstd Compression 400 Error https://debugradar.com/fix-codex-cli-zstd-compression-400-error/ — a bare 400 with no verified user-side fix, where the honest move is to name the trigger and work around it. And the same family showed up in the desktop app in Fix: Codex Desktop App Error 0x80073D02 & 0x800706D9 https://debugradar.com/fix-codex-appx-0x80073d02-error/ — an app-launch failure where confirming the exact error matters more than reinstalling. Is the Gemini CLI tool limit 128 or 400 tools? Unconfirmed. The issue title says the 400 error hits with more than 128 tools, while the issue body says more than 400 tools are available when it fails. Treat 128 as the safe ceiling until the limit is confirmed — stay under it and the error should not trigger. Is there a fix for the Gemini CLI 400 error? No merged fix yet. Pull request 26084 'Fix 400 error when 128 tools enabled' adds smartLimitTools to cap the tool count at the Gemini API limit automatically, but the PR is still open and not merged. Until it lands, trimming enabled tools is the only user-side lever. Which tools count toward the limit? Every tool the CLI sends with the request — MCP servers and extensions you have enabled. Disabling a server or extension you do not need for the task removes its tools from the count. Sources: GitHub issue, "Gemini CLI encounters 400 error with 128 tools" google-gemini/gemini-cli 24246 , March 30, 2026 https://github.com/google-gemini/gemini-cli/issues/24246 https://github.com/google-gemini/gemini-cli/issues/24246 ; pull request 26084, "Fix 400 error when 128 tools enabled" https://github.com/google-gemini/gemini-cli/pull/26084 https://github.com/google-gemini/gemini-cli/pull/26084 . Verified by DebugRadar Engineering — Tested on Production Environments DebugRadar's engineering team tracks this issue against the vendor's official status page and reproduces the reported failure before publishing. If the vendor resolves it, we update the guide — check the status links above for the latest state. Read the full guide on DebugRadar: Fix: Gemini CLI 400 Bad Request With 128+ Tools https://debugradar.com/fix-gemini-cli-400-error-128-tools/