{"record":{"id":"07087ddadab59629","repo":"huggingface/smolagents","slug":"parameter-structured-output-was-not-specified-c-07087d","errorCode":null,"errorMessage":"Parameter 'structured_output' was not specified. Currently it defaults to False, but in version 1.25, the default will change to True. To suppress this warning, explicitly set structured_output=True (new behavior) or structured_output=False (legacy behavior). See documentation at https://huggingface.co/docs/smolagents/tutorials/tools#structured-output-and-output-schema-support for more details.","messagePattern":"Parameter 'structured_output' was not specified\\. Currently it defaults to False, but in version 1\\.25, the default will change to True\\. To suppress this warning, explicitly set structured_output=True \\(new behavior\\) or structured_output=False \\(legacy behavior\\)\\. See documentation at https://huggingface\\.co/docs/smolagents/tutorials/tools#structured-output-and-output-schema-support for more details\\.","errorType":"console","errorClass":"FutureWarning","httpStatus":null,"severity":"warning","filePath":"src/smolagents/tools.py","lineNumber":1026,"sourceCode":"        ```\n\n        Example with structured output enabled:\n        ```py\n        >>> with ToolCollection.from_mcp(server_parameters, trust_remote_code=True, structured_output=True) as tool_collection:\n        >>>     agent = CodeAgent(tools=[*tool_collection.tools], add_base_tools=True, model=model)\n        >>>     agent.run(\"Please find a remedy for hangover.\")\n        ```\n\n        Example with a Streamable HTTP MCP server:\n        ```py\n        >>> with ToolCollection.from_mcp({\"url\": \"http://127.0.0.1:8000/mcp\", \"transport\": \"streamable-http\"}, trust_remote_code=True) as tool_collection:\n        >>>     agent = CodeAgent(tools=[*tool_collection.tools], add_base_tools=True, model=model)\n        >>>     agent.run(\"Please find a remedy for hangover.\")\n        ```\n        \"\"\"\n        # Handle future warning for structured_output default value change\n        if structured_output is None:\n            warnings.warn(\n                \"Parameter 'structured_output' was not specified. \"\n                \"Currently it defaults to False, but in version 1.25, the default will change to True. \"\n                \"To suppress this warning, explicitly set structured_output=True (new behavior) or structured_output=False (legacy behavior). \"\n                \"See documentation at https://huggingface.co/docs/smolagents/tutorials/tools#structured-output-and-output-schema-support for more details.\",\n                FutureWarning,\n                stacklevel=2,\n            )\n            structured_output = False\n\n        try:\n            from mcpadapt.core import MCPAdapt\n            from mcpadapt.smolagents_adapter import SmolAgentsAdapter\n        except ImportError:\n            raise ImportError(\n                \"\"\"Please install 'mcp' extra to use ToolCollection.from_mcp: `pip install 'smolagents[mcp]'`.\"\"\"\n            )\n        if isinstance(server_parameters, dict):\n            transport = server_parameters.get(\"transport\")","sourceCodeStart":1008,"sourceCodeEnd":1044,"githubUrl":"https://github.com/huggingface/smolagents/blob/30bb1161095dbae2271e6bc3cc4c219cc3897a57/src/smolagents/tools.py#L1008-L1044","documentation":"`ToolCollection.from_mcp(...)` (and `from_mcp` generally) is transitioning its `structured_output` parameter from defaulting to False to defaulting to True in smolagents 1.25. Structured output changes how tool results are returned (typed/schema-validated vs raw strings), so the default flip can break existing agents. The FutureWarning tells you to pin the behavior explicitly now.","triggerScenarios":"Calling `ToolCollection.from_mcp({...})` or `Tool.from_mcp(...)` without passing `structured_output`; the signature default is the sentinel `None`, which triggers the warning before falling back to legacy False behavior.","commonSituations":"Migrating to smolagents versions near 1.25; MCP-based agents whose tool-call parsing or answer formatting breaks after the default changes; CI logs filling with FutureWarnings from MCP integration tests.","solutions":["Set `structured_output=False` now to keep current (legacy) behavior and silence the warning","Or set `structured_output=True` to opt into the new behavior early and update downstream result handling before 1.25","Pin your smolagents version (<1.25) if you cannot change code yet, then migrate deliberately"],"exampleFix":"# before\ntools = ToolCollection.from_mcp({\"url\": \"http://127.0.0.1:8000/mcp\"})\n\n# after\ntools = ToolCollection.from_mcp({\"url\": \"http://127.0.0.1:8000/mcp\"}, structured_output=True)","handlingStrategy":"validation","validationCode":"# before constructing, decide the behavior explicitly\nEXPECTED_STRUCTURED = True  # flip to False for legacy behavior\ntools = ToolCollection.from_mcp(server_params, structured_output=EXPECTED_STRUCTURED)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass structured_output explicitly to from_mcp","Pin smolagents version in requirements to control when the 1.25 default change lands","Run your MCP tool tests with warnings-as-errors to catch un-pinned defaults early"],"tags":["mcp","futurewarning","deprecation","smolagents","structured-output"],"backgroundTag":"default-value-deprecation-warning","analyzedSha":"30bb1161095dbae2271e6bc3cc4c219cc3897a57","analyzedAt":"2026-08-28T18:52:54.169Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}