Class ClipboardReadTool
Reads text content from the system clipboard.
Uses platform-native commands: PowerShell on Windows, pbpaste on macOS, and xclip on Linux.
public sealed class ClipboardReadTool : IBuiltInTool, ITool, IToolMetadata
- Inheritance
-
ClipboardReadTool
- Implements
- Inherited Members
Examples
Pulling text from the OS clipboard for an agent to act on:
using LMKit.Agents;
using LMKit.Agents.Tools.BuiltIn.IO;
var agent = Agent.CreateBuilder(model)
.WithTools(t => t.Register(new ClipboardReadTool()))
.Build();
var result = await agent.RunAsync("Summarize the contents currently on my clipboard.");
Constructors
- ClipboardReadTool()
Initializes a new instance with default options.
- ClipboardReadTool(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.