📋 Prerequisites
🎯 Affected Service(s)
App Service
🚦 Impact/Severity
Blocker
🐛 Bug Description
When tools are registered using functiontool.New with typed Go structs (e.g., the remote A2A tool, ask_user, save_memory), the Google ADK sets FunctionDeclaration.ParametersJsonSchema to a *jsonschema.Schema value (from github.com/google/jsonschema-go). Both model adapters attempt to read this with a map[string]any type assertion that silently fails:
// openai_adk.go:342, anthropic_adk.go:239
if m, ok := fd.ParametersJsonSchema.(map[string]any); ok {
The actual type is *jsonschema.Schema, not map[string]any. The assertion returns ok=false, so the tool schema sent to the LLM has empty properties and no required fields. The LLM calls every function tool with {}, which then fails ADK input validation.
Tools registered with genai.Schema directly (via fd.Parameters) are unaffected — they use a separate code path that already works.
🔄 Steps To Reproduce
- Create a declarative agent with a
type: Agent tool referencing another agent
- Send a message to the orchestrator agent
- The LLM calls the A2A tool with empty args
{}
- ADK validation fails:
validating root: required: missing properties: ["request"]
🤔 Expected Behavior
The tool schema (including properties and required fields) should be sent to the LLM so it can provide the correct arguments.
📱 Actual Behavior
All function tools created via functiontool.New with typed structs receive empty schemas. Affects remote_a2a_tool (request), ask_user (questions), save_memory (content), and any custom typed tools.
💻 Environment
- kagent v0.9.0-beta4
- Go ADK with
google.golang.org/adk v1.0.0
- Bedrock via OpenAI-compatible adapter
- EKS 1.32
🔍 Additional Context
The fix is to JSON-roundtrip the ParametersJsonSchema value when it's not already map[string]any:
func parametersJsonSchemaToMap(v any) map[string]any {
if v == nil {
return nil
}
if m, ok := v.(map[string]any); ok {
return m
}
b, err := json.Marshal(v)
if err != nil {
return nil
}
var m map[string]any
if err := json.Unmarshal(b, &m); err != nil {
return nil
}
return m
}
Files: go/adk/pkg/models/openai_adk.go (line 342), go/adk/pkg/models/anthropic_adk.go (line 239), new helper in go/adk/pkg/models/base.go.
🙋 Are you willing to contribute?
📋 Prerequisites
🎯 Affected Service(s)
App Service
🚦 Impact/Severity
Blocker
🐛 Bug Description
When tools are registered using
functiontool.Newwith typed Go structs (e.g., the remote A2A tool,ask_user,save_memory), the Google ADK setsFunctionDeclaration.ParametersJsonSchemato a*jsonschema.Schemavalue (fromgithub.com/google/jsonschema-go). Both model adapters attempt to read this with amap[string]anytype assertion that silently fails:The actual type is
*jsonschema.Schema, notmap[string]any. The assertion returnsok=false, so the tool schema sent to the LLM has empty properties and no required fields. The LLM calls every function tool with{}, which then fails ADK input validation.Tools registered with
genai.Schemadirectly (viafd.Parameters) are unaffected — they use a separate code path that already works.🔄 Steps To Reproduce
type: Agenttool referencing another agent{}validating root: required: missing properties: ["request"]🤔 Expected Behavior
The tool schema (including
propertiesandrequiredfields) should be sent to the LLM so it can provide the correct arguments.📱 Actual Behavior
All function tools created via
functiontool.Newwith typed structs receive empty schemas. Affectsremote_a2a_tool(request),ask_user(questions),save_memory(content), and any custom typed tools.💻 Environment
google.golang.org/adkv1.0.0🔍 Additional Context
The fix is to JSON-roundtrip the
ParametersJsonSchemavalue when it's not alreadymap[string]any:Files:
go/adk/pkg/models/openai_adk.go(line 342),go/adk/pkg/models/anthropic_adk.go(line 239), new helper ingo/adk/pkg/models/base.go.🙋 Are you willing to contribute?