microsoft/autogen · error · ValueError

Function call ID is required

Error message

Function call ID is required

What it means

Thrown by SKChatCompletionAdapter while converting a Semantic Kernel result into autogen FunctionCall objects: a FunctionCallContent item arrived from the underlying SK model without an id. autogen's FunctionCall requires an id to later match tool executions to calls, so an id-less function call content is rejected.

Source

Thrown at python/packages/autogen-ext/src/autogen_ext/models/semantic_kernel/_sk_chat_completion_adapter.py:419

                self._tools_plugin.functions[tool.get("name")] = kernel_function  # type: ignore

        kernel.add_plugin(self._tools_plugin)

    def _process_tool_calls(self, result: ChatMessageContent) -> list[FunctionCall]:
        """Process tool calls from SK ChatMessageContent"""
        function_calls: list[FunctionCall] = []
        for item in result.items:
            if isinstance(item, FunctionCallContent):
                # Extract plugin name and function name
                plugin_name = item.plugin_name or ""
                function_name = item.function_name
                if plugin_name:
                    full_name = f"{plugin_name}-{function_name}"
                else:
                    full_name = function_name

                if item.id is None:
                    raise ValueError("Function call ID is required")

                if isinstance(item.arguments, Mapping):
                    arguments = json.dumps(item.arguments)
                else:
                    arguments = item.arguments or "{}"

                function_calls.append(FunctionCall(id=item.id, name=full_name, arguments=arguments))
        return function_calls

    def _get_kernel(self, extra_create_args: Mapping[str, Any]) -> Kernel:
        kernel = extra_create_args.get("kernel", self._kernel)
        if not kernel:
            raise ValueError("kernel must be provided either in constructor or extra_create_args")
        if not isinstance(kernel, Kernel):
            raise ValueError("kernel must be an instance of semantic_kernel.kernel.Kernel")
        return kernel

    def _get_prompt_settings(self, extra_create_args: Mapping[str, Any]) -> Optional[PromptExecutionSettings]:

View on GitHub (pinned to 027ecf0a37)

Solutions

  1. Upgrade the semantic-kernel connector to a version that returns tool call ids
  2. Use a model/endpoint that emits call IDs (OpenAI, Azure OpenAI tool calling)
  3. If IDs are genuinely absent from the provider, disable function calling for that model so no FunctionCallContent is produced

Example fix

# before: local connector omits ids
adapter = SKChatCompletionAdapter(kernel=kernel, model_id="local-model")
result = await adapter.create([msg], tools=[tool])  # ValueError when tool is called

# after: use a connector/model that provides call ids
adapter = SKChatCompletionAdapter(kernel=kernel, model_id="gpt-4o")
Defensive patterns

Strategy: try-catch

Try / catch

try:
    result = await adapter.create(messages, tools=tools)
except ValueError as e:
    if "Function call ID is required" in str(e):
        raise RuntimeError(
            "SK connector returned tool calls without ids; upgrade the connector or use a model that emits ids"
        ) from e
    raise

Prevention

When it happens

Trigger: The Semantic Kernel connector returns FunctionCallContent with item.id=None (some connectors/local models omit call IDs), and the adapter iterates result.items in _extract_function_calls. Any single item missing an id aborts the whole conversion.

Common situations: Using local/open models via SK connectors that don't populate function call IDs; older semantic-kernel connector versions with incomplete tool-call metadata; custom SK filters/middleware stripping metadata.

Related errors


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