{"record":{"id":"7b9c6707ea14a48b","repo":"PrefectHQ/fastmcp","slug":"unknown-arguments-in-transform-args-join-so","errorCode":null,"errorMessage":"Unknown arguments in transform_args: {', '.join(sorted(unknown_args))}. Parent tool `{tool.name}` has: {', '.join(sorted(parent_params))}","messagePattern":"Unknown arguments in transform_args: (.+?)\\. Parent tool `(.+?)` has: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"fastmcp_slim/fastmcp/tools/tool_transform.py","lineNumber":497,"sourceCode":"                    content=[TextContent(text=\"Summary\")],\n                    structured_content={\"processed\": True}\n                )\n            ```\n        \"\"\"\n        tool = Tool._ensure_tool(tool)\n\n        transform_args = transform_args or {}\n\n        if transform_fn is not None:\n            parsed_fn = ParsedFunction.from_function(transform_fn, validate=False)\n        else:\n            parsed_fn = None\n\n        # Validate transform_args\n        parent_params = set(tool.parameters.get(\"properties\", {}).keys())\n        unknown_args = set(transform_args.keys()) - parent_params\n        if unknown_args:\n            raise ValueError(\n                f\"Unknown arguments in transform_args: {', '.join(sorted(unknown_args))}. \"\n                f\"Parent tool `{tool.name}` has: {', '.join(sorted(parent_params))}\"\n            )\n\n        # Always create the forwarding transform\n        schema, forwarding_fn = cls._create_forwarding_transform(tool, transform_args)\n\n        # Handle output schema\n        if output_schema is NotSet:\n            # Use smart fallback: try custom function, then parent\n            if transform_fn is not None:\n                # parsed fn is not none here\n                final_output_schema = cast(ParsedFunction, parsed_fn).output_schema\n                if final_output_schema is None:\n                    # Check if function returns ToolResult (or subclass) - if so, don't fall back to parent.\n                    # Use parsed_fn.return_type (resolved via get_type_hints) instead of\n                    # inspect.signature, which returns strings under `from __future__ import annotations`.\n                    return_type = cast(ParsedFunction, parsed_fn).return_type","sourceCodeStart":479,"sourceCodeEnd":515,"githubUrl":"https://github.com/PrefectHQ/fastmcp/blob/1f021142978e0861cd910c8df4e8074bc7cf3978/fastmcp_slim/fastmcp/tools/tool_transform.py#L479-L515","documentation":"from_tool() validates that every key in transform_args corresponds to an actual parameter of the parent tool. Unknown keys would silently do nothing, so it raises ValueError listing the unknown arguments and the parent tool's actual parameter names.","triggerScenarios":"Passing transform_args={\"typo_param\": ArgTransform(...)} where the parent tool's schema properties don't include that name; transforming a tool whose parameter names changed between library versions; renaming a parent parameter without updating transform_args.","commonSituations":"Typos in parameter names; building transforms against an old parent tool signature; parent tool updated upstream (version change) and transform_args no longer matches.","solutions":["Check the error's 'Parent tool has:' list and rename transform_args keys to match exactly.","Print tool.parameters[\"properties\"] for the parent to confirm parameter names.","Remove transform_args entries that no longer exist after a parent tool upgrade."],"exampleFix":"// before\nParentTool.from_tool(tool, transform_args={\"query_str\": ArgTransform(name=\"q\")})\n\n// after (parent param is 'query')\nParentTool.from_tool(tool, transform_args={\"query\": ArgTransform(name=\"q\")})","handlingStrategy":"validation","validationCode":"def check_transform_args(tool, transform_args: dict) -> None:\n    parent_params = set(tool.parameters.get(\"properties\", {}).keys())\n    unknown = set(transform_args) - parent_params\n    if unknown:\n        raise ValueError(f\"Unknown transform_args keys: {sorted(unknown)}; parent has {sorted(parent_params)}\")","typeGuard":null,"tryCatchPattern":"try:\n    t = ParentTool.from_tool(tool, transform_args=ta)\nexcept ValueError as e:\n    if \"Unknown arguments\" in str(e):\n        log.error(\"Fix transform_args keys against parent schema: %s\", e)\n    raise","preventionTips":["Copy parameter names directly from tool.parameters['properties'] rather than typing them.","Re-validate transform_args after any parent tool signature/version change.","Keep transform definitions adjacent to the parent tool definition so renames stay in sync."],"tags":["python","tool-transform","validation"],"backgroundTag":"unknown-parameter-name","analyzedSha":"1f021142978e0861cd910c8df4e8074bc7cf3978","analyzedAt":"2026-08-29T14:31:16.082Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}