Method TryGet
TryGet(string, out ITool)
Attempts to retrieve a registered tool by its Name.
public bool TryGet(string name, out ITool tool)
Parameters
name
stringThe exact tool name to look up (compared with Ordinal).
tool
IToolWhen this method returns, contains the tool associated with
name
, if found; otherwisenull
.
Returns
- bool
true
if a tool with the specifiedname
exists; otherwise,false
.
Remarks
Use this method when the tool name originates from the model (e.g., a tool call). The comparison is case- and culture-insensitive only in the sense of Ordinal (case-sensitive, ordinal). If the name may vary in casing, normalize it before passing to this method.