Skip to content

McpToolset schema converter fails with array properties in Oracle SQLcl MC #4363

@paulparkinson

Description

@paulparkinson

🔴 Required Information

Please ensure all items in this section are completed to allow for efficient
triaging. Requests without complete information may be rejected / deprioritized.
If an item is not applicable to you - please mark it as N/A

Describe the Bug:
When using McpToolset with Oracle SQLcl MCP server, ADK's schema converter fails because it cannot handle array-type properties in MCP tool schemas. The converter assumes all schema values are dictionaries and calls .items() on them, but Oracle MCP tools have arrays (like required: ['sql']) which causes the crash.

The root cause is that Oracle SQLcl MCP tool schemas include array properties:

{
  "name": "run-sql",
  "inputSchema": {
    "properties": {
      "sql": {"type": "string"},
      "model": {"type": "string"}
    },
    "required": ["sql"]  ← This is an array, not a dict!
  }
}

Steps to Reproduce:
Please provide a numbered list of steps to reproduce the behavior:

  1. Install 'Python 3.12+, google-adk>=1.22.1, mcp>=0.9.0, Oracle SQLcl with MCP support (/opt/sqlcl/bin/sql -mcp)'
  2. Run 'python adk_mcp_bug_reproducer.py'
  3. Open '....'
  4. Provide error or stacktrace
File ".../google/adk/tools/_gemini_schema_util.py", line 206, in _to_gemini_schema
  sanitized_schema = _sanitize_schema_formats_for_gemini(dereferenced_schema)
File ".../google/adk/tools/_gemini_schema_util.py", line 176, in _sanitize_schema_formats_for_gemini
  key: _sanitize_schema_formats_for_gemini(value)
File ".../google/adk/tools/_gemini_schema_util.py", line 160, in _sanitize_schema_formats_for_gemini
  for field_name, field_value in schema.items():
AttributeError: 'list' object has no attribute 'items'

Expected Behavior:
A clear and concise description of what you expected to happen.

Observed Behavior:
What actually happened? Include error messages or crash stack traces here.

Environment Details:

  • ADK Library Version (pip show google-adk):
  • Linux (Ubuntu)
  • 3.12+

Model Information:

  • Are you using LiteLLM: Yes/No
  • Which model is being used: (e.g., gemini-2.5-pro)

🟡 Optional Information

Providing this information greatly speeds up the resolution process.

Regression:
Did this work in a previous version of ADK? No

Logs:
(See stack above)

Screenshots / Video:
{none}

Additional Context:
See root cause above.

Minimal Reproduction Code:
https://github.com/paulparkinson/oracle-ai-for-sustainable-dev/blob/main/oracle-ai-database-gcp-vertex-ai/archived-scripts/adk_mcp_bug_reproducer.py

How often has this issue occurred?:

  • Always (100%)

Metadata

Metadata

Assignees

No one assigned

    Labels

    mcp[Component] Issues about MCP supporttools[Component] This issue is related to tools

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions