microsoft/autogen · error · ValueError

Model does not support function calling

Error message

Model does not support function calling

What it means

Raised by AzureAIChatCompletionClient._validate_model_info when self.model_info['function_calling'] is False and the tools sequence passed to create()/create_stream() is non-empty. The client prevents sending tool definitions to a model declared without tool-calling support.

Source

Thrown at python/packages/autogen-ext/src/autogen_ext/models/azure/_azure_ai_client.py:357

                if isinstance(message, UserMessage):
                    if isinstance(message.content, list) and any(isinstance(x, Image) for x in message.content):
                        raise ValueError("Model does not support vision and image was provided")

        if json_output is not None:
            if self.model_info["json_output"] is False and json_output is True:
                raise ValueError("Model does not support JSON output")

            if isinstance(json_output, type):
                # TODO: we should support this in the future.
                raise ValueError("Structured output is not currently supported for AzureAIChatCompletionClient")

            if json_output is True and "response_format" not in create_args:
                create_args["response_format"] = "json_object"

        if self.model_info["json_output"] is False and json_output is True:
            raise ValueError("Model does not support JSON output")
        if self.model_info["function_calling"] is False and len(tools) > 0:
            raise ValueError("Model does not support function calling")

    async def create(
        self,
        messages: Sequence[LLMMessage],
        *,
        tools: Sequence[Tool | ToolSchema] = [],
        tool_choice: Tool | Literal["auto", "required", "none"] = "auto",
        json_output: Optional[bool | type[BaseModel]] = None,
        extra_create_args: Mapping[str, Any] = {},
        cancellation_token: Optional[CancellationToken] = None,
    ) -> CreateResult:
        extra_create_args_keys = set(extra_create_args.keys())
        if not create_kwargs.issuperset(extra_create_args_keys):
            raise ValueError(f"Extra create args are invalid: {extra_create_args_keys - create_kwargs}")

        # Copy the create args and overwrite anything in extra_create_args
        create_args = self._create_args.copy()
        create_args.update(extra_create_args)

View on GitHub (pinned to 027ecf0a37)

Solutions

  1. Set function_calling=True in model_info if the deployment supports tool calling
  2. Remove tools / unregister tool handlers for models without function calling
  3. Verify against the model's Foundry model card that tool use is supported before declaring it

Example fix

# before
model_info = ModelInfo(family="gpt-4o", vision=True, function_calling=False,
                      json_output=True, structured_output=False)
await client.create(msgs, tools=[my_tool])

# after
model_info = ModelInfo(family="gpt-4o", vision=True, function_calling=True,
                      json_output=True, structured_output=False)
await client.create(msgs, tools=[my_tool])
Defensive patterns

Strategy: validation

Validate before calling

if tools and client.model_info["function_calling"] is False:
    tools = []  # or raise: model declared without tool support

Prevention

When it happens

Trigger: Passing tools=[Tool(...)] or tool schemas to a model whose model_info has function_calling=False; registering tools on a RoundRobinGroupChat/agent that uses such a client.

Common situations: model_info copied from a template default with function_calling=False (e.g. embedding or small text models) while the code registers tools; older open models on Foundry that lack function calling; capability dict hand-written and the flag forgotten.

Related errors


AI-assisted analysis of microsoft/autogen@027ecf0a37 (2026-08-15). Data as JSON: /api/errors/001dcfad8c731e2b. Report an issue: GitHub.