Class HttpGetTool
Makes an HTTP GET request to fetch content from a URL.
This is a read-only tool that retrieves web content, API responses, and other resources accessible via HTTP GET.
public sealed class HttpGetTool : IBuiltInTool, ITool, IToolMetadata, IDisposable
- Inheritance
-
HttpGetTool
- Implements
- Inherited Members
Examples
Letting an agent fetch JSON from a public API:
using LMKit.Agents;
using LMKit.Agents.Tools.BuiltIn.Net;
var agent = Agent.CreateBuilder(model)
.WithTools(t => t.Register(new HttpGetTool()))
.Build();
var result = await agent.RunAsync(
"Fetch https://api.github.com/repos/dotnet/runtime and tell me the latest release tag.");
Constructors
- HttpGetTool()
Initializes a new instance with default settings.
- HttpGetTool(HttpToolOptions)
Initializes a new instance with custom options.
- HttpGetTool(HttpClient, HttpToolOptions)
Initializes a new instance with an existing HttpClient.
Properties
- Description
Gets a concise description of what the tool does.
- InputSchema
Gets the JSON Schema defining the expected input arguments.
- Name
Gets the stable, unique identifier for this tool.
Methods
- InvokeAsync(string, CancellationToken)
Executes the tool with the specified JSON arguments.