@@ -143,22 +143,6 @@ def _create_input_model(self) -> Type[BaseModel]:
143143 # Handle case with no parameters
144144 return create_model (model_name )
145145
146- def _is_special_parameter (self , param_name : str ) -> bool :
147- """Check if a parameter should be automatically injected by the framework.
148-
149- Special parameters include:
150- - Standard Python parameters: self, cls
151- - Framework-provided context parameters: agent, strands_context
152-
153- Args:
154- param_name: The name of the parameter to check.
155-
156- Returns:
157- True if the parameter should be excluded from input validation and
158- automatically injected during tool execution.
159- """
160- return param_name in {"self" , "cls" , "agent" , "strands_context" }
161-
162146 def extract_metadata (self ) -> ToolSpec :
163147 """Extract metadata from the function to create a tool specification.
164148
@@ -293,6 +277,22 @@ def inject_special_parameters(
293277 if "agent" in self .signature .parameters and "agent" in invocation_state :
294278 validated_input ["agent" ] = invocation_state ["agent" ]
295279
280+ def _is_special_parameter (self , param_name : str ) -> bool :
281+ """Check if a parameter should be automatically injected by the framework.
282+
283+ Special parameters include:
284+ - Standard Python parameters: self, cls
285+ - Framework-provided context parameters: agent, strands_context
286+
287+ Args:
288+ param_name: The name of the parameter to check.
289+
290+ Returns:
291+ True if the parameter should be excluded from input validation and
292+ automatically injected during tool execution.
293+ """
294+ return param_name in {"self" , "cls" , "agent" , "strands_context" }
295+
296296
297297P = ParamSpec ("P" ) # Captures all parameters
298298R = TypeVar ("R" ) # Return type
0 commit comments