Method TryGet
TryGet(string, out ITool)
Attempts to retrieve a registered tool by its Name.
public bool TryGet(string name, out ITool tool)
Parameters
namestringThe exact tool name to look up (compared with Ordinal).
toolIToolWhen this method returns, contains the tool associated with
name, if found; otherwisenull.
Returns
- bool
trueif a tool with the specifiednameexists; 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.