Function call tool with 'additionalProperties' in 'parameters_json_schema' fail with MALFORMED_FUNCTION_CALL

when sending request to generate_content using function call tool that has parameters_json_schema that includes ‘additionalProperties‘ in the schema, the API responds with MALFORMED_FUNCTION_CALL error.

When omitting the ‘additionalProperties‘ field from the schema, the model accepts the function call definition and responds with the function call when needed.

Sending a schema with ‘additionalProperties‘ worked until yesterday (!!!).

Here is a sample function call that fail the API call:

types.FunctionDeclaration(
    name="lookup",
    description="lookup a person record",
    parameters_json_schema={
        "type": "object",
        "properties": {
            "first_name": {"type": "string","description": "the person first name"},
            "last_name": {"type": "string", "description": "the person last name"},
            "children": {
                "type": "object",
                "description": "each key is the child name and the value is the child age",
                "additionalProperties": {"type": "integer"},
            },
        },
        "required": [],
    }
) 

I’m using gemini-3-flash-preview using python SDK.

2 Likes

I am also experiencing the same issue. The ability of models to call tools is reduced drastically.

Hi Raanan,

Thanks getting in touch.

I attempted to reproduce this by taking your code sample & wrapping it in an API call. In my test it worked fine (no MALFORMED_FUNCTION_CALL). I did this using the latest version of the Python SDK.

If you’re still experiencing this issue, could you:

  1. Tell me what version of the SDK you’re using
  2. Tell me what model you’re calling
  3. If possible, provide a full code sample which reproduces the failure.

Thanks,
Jon

This now works again - the exact same setup kept failing 2 days ago and it was VERY frustrating …

Thanks for checking this Jon.