Class FileSystemTool
A built-in tool for file system operations.
Enables agents to read, write, list, and manage files and directories.
public sealed class FileSystemTool : ITool
- Inheritance
-
FileSystemTool
- Implements
- Inherited Members
Examples
var tool = new FileSystemTool(new FileSystemToolOptions
{
AllowedPaths = new[] { "/data", "/output" },
AllowWrite = true
});
registry.Register(tool);
Remarks
This tool provides real file system access that LLMs cannot perform on their own. Use FileSystemToolOptions to restrict access to specific directories.
Constructors
- FileSystemTool()
Initializes a new instance with default settings.
- FileSystemTool(FileSystemToolOptions)
Initializes a new instance with custom options.
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.