Method TryGet
TryGet(string, out ITool)
Attempts to retrieve a registered tool by its Name.
public bool TryGet(string name, out ITool tool)Parameters
- namestring
- The exact tool name to look up (compared with Ordinal). 
- toolITool
- When this method returns, contains the tool associated with - name, if found; otherwise- null.
Returns
- bool
- trueif a tool with the specified- nameexists; 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.