Class ClipboardWriteTool
Writes text content to the system clipboard.
Uses platform-native commands: PowerShell on Windows, pbcopy on macOS, and xclip on Linux.
public sealed class ClipboardWriteTool : IBuiltInTool, ITool, IToolMetadata
- Inheritance
-
ClipboardWriteTool
- Implements
- Inherited Members
Examples
Letting an agent place a generated snippet on the clipboard:
using LMKit.Agents;
using LMKit.Agents.Tools.BuiltIn.IO;
var agent = Agent.CreateBuilder(model)
.WithTools(t => t.Register(new ClipboardWriteTool()))
.Build();
var result = await agent.RunAsync("Generate a regex for an IPv4 address and copy it to my clipboard.");
Constructors
- ClipboardWriteTool()
Initializes a new instance with default options.
- ClipboardWriteTool(ClipboardToolOptions)
Initializes a new instance with the specified 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.