Is there some sort of dedicated tool for this type of setup, or did you hand-craft it ?
Somewhat hand rolled, somewhat claude coded.
Back in 2023 I started my own C# LLM library for doing tool calls and structured output, and over the years it has morphed bigger and bigger, and that is the backbone of almost all of my LLM-based projects.
I've never released it, but its easy to understand, and simple to add your own tools:
[AIDescription("Get current weather for a location")]
static string GetWeather(
[AIDescription("The city name")] string city,
[AIDescription("The country name")] string country,
[AIDescription("Temperature unit", ["C", "F"])] string unit = "C")
{
// make some API call to a weather API and return a string to the LLM
return $"The weather in {city}, {country} is 22°{unit} and sunny";
}
var chat = client.StartConversation("You are a helpful assistant with access to weather data.");
var response = await chat.SendAsync<string>("What's the weather in London?", GetWeather);
I'm sure plenty of better libraries exist for this now, but in 2023, I don't think any existed in the dotnet ecosystem. I've never released it though, because I've never "finished" it.It looks like you’re describing something like an MCP server and a client model.
If you’re in the C# ecosystem you could consider converting your APIs to MCP format tools using the MCP SDK.
https://devblogs.microsoft.com/dotnet/build-a-model-context-...
And then leveraging Microsoft Agent Framework for the client and orchestration side of things:
Not parent, but I use Goose for my non-handcrafted Qwen use cases, I’m also working on handcrafting as well. Goose was the only harness that didnt bloat context too much with system prompts (like openclaw) and I could get reasonable web search working with Qwen.