Tools
Built-in tools
Section titled “Built-in tools”BuiltInTools.Safe is the default safe set. BuiltInTools.All includes the larger built-in inventory.
The built-in catalog covers file operations, shell execution, web fetch and search, memory, base64 helpers, task management, and interactive prompts.
Attribute-based tools
Section titled “Attribute-based tools”Use [Tool] and [ToolParam] for strongly typed registration:
[Tool("add", "Add two numbers")]public static ToolResult Add( IToolContext context, [ToolParam("First number")] double a, [ToolParam("Second number")] double b){ return ToolResult.Success($"{a} + {b} = {a + b}");}Register tools with:
Tool.FromType<T>()Tool.FromMethod<T>(...)Tool.FromInstance(...)
Fluent tool builder
Section titled “Fluent tool builder”For dynamic tool definitions, use Tool.Create(...):
var tool = Tool.Create("custom_tool") .WithDescription("A custom tool created with the builder pattern") .WithParameter<string>("input", "Input text to process") .WithHandler(async (parameters, context) => { var input = parameters["input"]?.ToString() ?? ""; return ToolResult.Success(input.ToUpperInvariant()); }) .Build();MCP integration
Section titled “MCP integration”Document MCP using the verified APIs:
Agent.McpServersMcpToolLoader.LoadAsync(...)McpToolLoader.DiscoverAsync(...)
Avoid older sample text that implies BuiltInTools.FromMcpServerAsync(...) is the supported path.