Description

Search tools

Search for available tools by keyword. Returns a JSON list of matching tool names and descriptions. Call with an empty query to list all tools.

Included in Version 8

Dynamically extracted tool implementation.
How to register ToolRegistrycsharp
new AgentTool(            "search_tools",            "Search for available tools by keyword. Returns a JSON list of matching tool names and descriptions. Call with an empty query to list all tools.",            SearchTools,            new            {                type = "object",                properties = new                {                    query = new { type = "string", description = "Keyword to search for in tool names and descriptions. Leave empty to list all tools." }                }            })
Helper classes for ToolRegistrycsharp
    private string SearchTools(string argsJson)    {        string query = string.Empty;        try        {            using var doc = JsonDocument.Parse(argsJson);            if (doc.RootElement.TryGetProperty("query", out var q))                query = q.GetString() ?? string.Empty;        }        catch { }        var matches = _catalog.Values            .Where(t => string.IsNullOrWhiteSpace(query)                        || t.Name.Contains(query, StringComparison.OrdinalIgnoreCase)                        || t.Description.Contains(query, StringComparison.OrdinalIgnoreCase))            .Select(t => new { name = t.Name, description = t.Description })            .ToArray();        return JsonSerializer.Serialize(matches);    }