flutter_agentic_tools โ Device Tools for Flutter AI Agents
Ready-made, safety-guarded tools your AI agent can call. Clipboard access, sandboxed file storage, host-restricted HTTP, and system info โ all as flutter_agentic AgenticTools that plug straight into any agent.
๐ View on pub.dev ยท API docs ยท GitHub
Part of the flutter_agentic family: flutter_agentic (core SDK) ยท flutter_agentic_graph ยท flutter_agentic_ui ยท flutter_agentic_memory
Installation
dependencies:
flutter_agentic_tools: ^0.1.1
Quick start
import 'package:flutter_agentic/flutter_agentic.dart';
import 'package:flutter_agentic_tools/flutter_agentic_tools.dart';
import 'package:path_provider/path_provider.dart';
final docsDir = await getApplicationDocumentsDirectory();
final agent = AgenticAgent(
provider: GeminiProvider(apiKey: 'YOUR_KEY'),
tools: [
...ClipboardTools.all, // read/write clipboard
...FileTools(docsDir.path).all, // sandboxed files
...HttpTools(allowedHosts: ['api.github.com']).all, // guarded web access
...SystemTools.all, // platform/locale info
],
);
await agent.chat('Save my shopping list to a file and copy it to the clipboard');
// โ the agent calls file_write and clipboard_write on its own
The tools
| Tool | What the agent can do | Safety guard |
|---|---|---|
clipboard_read / clipboard_write |
read what the user copied, copy results back | โ |
file_write / file_read / file_list / file_delete |
persist notes, exports, lists | sandboxed to the directory you pass; .. and absolute paths rejected; size limits |
http_get / http_post_json |
call web APIs | optional host allow-list, response truncation, timeout |
system_info |
adapt answers to platform, locale, time zone | read-only |
Safety by construction
Every tool returns structured errors to the model instead of throwing, so the agent can recover gracefully:
// Sandbox: agent cannot escape the folder you give it.
FileTools(docsDir.path) // file_read("../../etc/passwd") โ error
// Allow-list: agent can only reach hosts you name.
HttpTools(allowedHosts: ['api.weather.com']) // anything else โ error
// Context-window protection: long responses truncated.
HttpTools(maxResponseChars: 20000)
All constructors accept injectable dependencies (http.Client, base directory, limits) so your own tests stay hermetic.
License
MIT โ see LICENSE.
Libraries
- flutter_agentic_tools
- flutter_agentic_tools โ ready-made device tools for Flutter AI agents.