FunctionTool(strict=True) loses strict across dump_component / load_component
Author: michaelkillgtaCreated Sep 25, 2026Updated Sep 28, 2026
Describe the bug
Docs require strict=True for tools used with structured output / output_content_type. FunctionTool.dump_component / load_component omit strict from the config, so a tool saved with strict=True comes back as strict=False after an apparently lossless round-trip.
To Reproduce
from autogen_core.tools import FunctionTool
def add(a: int, b: int) -> int:
"""Add two integers."""
return a + b
tool = FunctionTool(add, description="Add two integers", strict=True)
assert tool.schema.get("strict") is True
cfg = tool.dump_component()
print(sorted(cfg.config.keys()))
# ['description', 'global_imports', 'has_cancellation_support', 'name', 'source_code']
# no 'strict'
restored = FunctionTool.load_component(cfg)
print(restored.schema.get("strict")) # False — BUGExpected behavior
Config persists strict; restored tool has schema[\"strict\"] is True.
Actual behavior
strict is absent from config; restored tool defaults to False.
Environment
autogen-core0.7.5- Python 3.13
Additional context
Likely fix: include strict in the FunctionTool component config _to_config / _from_config path in autogen_core.tools.
Source: microsoft/autogen