Skip to content

fix(mcp): drop invoke_agent's top-level oneOf so Gemini accepts it - #3534

Merged
EItanya merged 1 commit into
kagent-dev:mainfrom
jotacamou:fix/invoke-agent-schema-gemini
Nov 5, 2026
Merged

EItanya merged 1 commit into
kagent-dev:mainfrom
jotacamou:fix/invoke-agent-schema-gemini

Conversation

@jotacamou

Copy link
Copy Markdown
Contributor

Fixes #3533

Removes the top-level oneOf from invoke_agent's input schema. Gemini rejects it, so every request from an agent that binds the tool fails. The schema is now inferred from InvokeAgentInput like the other tools. The handler already rejects calls with neither or both of session_id and agent.

Tests:

  • TestToolSchemasHaveNoTopLevelCombinators: no core MCP tool schema has a top-level oneOf, anyOf or allOf. Fails on main, passes here.
  • TestInvokeAgentRejectsInvalidTargets still passes.
  • make lint LINT_ARGS=./core/internal/mcp/...: 0 issues.

Signed-off-by: JR Camou <3706614+jotacamou@users.noreply.github.com>
@jotacamou
jotacamou requested a review from a team as a code owner November 5, 2026 14:27
@github-actions github-actions Bot added the bug Something isn't working label Nov 5, 2026
@EItanya
EItanya enabled auto-merge November 5, 2026 15:13
@EItanya
EItanya added this pull request to the merge queue Nov 5, 2026
Merged via the queue into kagent-dev:main with commit 6db12e8 Nov 5, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] invoke_agent's top-level oneOf schema makes Gemini reject every request from agents that bind it

2 participants

⌂ 换网址