Class HtmlEncodeTool
A built-in tool for encoding or decoding HTML entities.
Converts special characters to their HTML entity equivalents (encode), or converts HTML entities back to their original characters (decode).
public sealed class HtmlEncodeTool : IBuiltInTool, ITool, IToolMetadata
- Inheritance
-
HtmlEncodeTool
- Implements
- Inherited Members
Examples
var tool = new HtmlEncodeTool();
// Encode: < becomes <
var encoded = await tool.InvokeAsync(@"{""text"":""<div>hello</div>""}");
// Decode: < becomes <
var decoded = await tool.InvokeAsync(@"{""text"":""<div>hello</div>"",""decode"":true}");
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.