Python library offering file handling, text extraction, data conversion, utilities, memory storage, and validation tools for AI agent workflows.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install ai-agent-tools或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install ai-agent-tools⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/ai-agent-tools/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
This library provides ready-to-use Python functions that AI agents can leverage to perform various tasks including file operations, text analysis, data transformation, memory management, and validation.
git clone https://github.com/cerbug45/ai-agent-tools.git
cd ai-agent-tools
wget https://raw.githubusercontent.com/cerbug45/ai-agent-tools/main/ai_agent_tools.py
Simply copy the ai_agent_tools.py file into your project directory.
Operations for reading, writing, and managing files.
Available Methods:
from ai_agent_tools import FileTools
# Read a file
content = FileTools.read_file("path/to/file.txt")
# Write to a file
FileTools.write_file("path/to/file.txt", "Hello World!")
# List files in directory
files = FileTools.list_files(".", extension=".py")
# Check if file exists
exists = FileTools.file_exists("path/to/file.txt")
Use Cases:
---
Extract information and process text data.
Available Methods:
from ai_agent_tools import TextTools
text = "Contact: [email protected], phone: 0532 123 45 67"
# Extract emails
emails = TextTools.extract_emails(text)
# Output: ['[email protected]']
# Extract URLs
urls = TextTools.extract_urls("Visit https://example.com")
# Output: ['https://example.com']
# Extract phone numbers
phones = TextTools.extract_phone_numbers(text)
# Output: ['0532 123 45 67']
# Count words
count = TextTools.word_count("Hello world from AI")
# Output: 4
# Summarize text
summary = TextTools.summarize_text("Long text here...", max_length=50)
# Clean whitespace
clean = TextTools.clean_whitespace("Too many spaces")
# Output: "Too many spaces"
Use Cases:
---
Convert between different data formats.
Available Methods:
from ai_agent_tools import DataTools
# Save data as JSON
data = {"name": "Alice", "age": 30}
DataTools.save_json(data, "output.json")
# Load JSON file
loaded_data = DataTools.load_json("output.json")
# Convert CSV text to dictionary list
csv_text = """name,age,city
Alice,30,New York
Bob,25,London"""
data_list = DataTools.csv_to_dict(csv_text)
# Output: [{'name': 'Alice', 'age': '30', 'city': 'New York'}, ...]
# Convert dictionary list to CSV
data = [
{"name": "Alice", "age": 30},
{"name": "Bob", "age": 25}
]
csv = DataTools.dict_to_csv(data)
Use Cases:
---
Helper functions for common operations.
Available Methods:
from ai_agent_tools import UtilityTools
# Get current timestamp
timestamp = UtilityTools.get_timestamp()
# Output: "2026-02-15 14:30:25"
# Generate unique ID from text
id = UtilityTools.generate_id("user_john_doe")
# Output: "a3f5b2c1"
# Calculate percentage
percent = UtilityTools.calculate_percentage(25, 100)
# Output: 25.0
# Safe division (no divide by zero error)
result = UtilityTools.safe_divide(10, 0, default=0.0)
# Output: 0.0
Use Cases:
---
Store and retrieve data during agent execution.
Available Methods:
from ai_agent_tools import MemoryTools
# Initialize memory
memory = MemoryTools()
# Store a value
memory.store("user_name", "Alice")
memory.store("session_id", "abc123")
# Retrieve a value
name = memory.retrieve("user_name")
# Output: "Alice"
# List all keys
keys = memory.list_keys()
# Output: ["user_name", "session_id"]
# Delete a value
memory.delete("session_id")
# Clear all memory
memory.clear()
Use Cases:
---
Validate different types of data.
Available Methods:
from ai_agent_tools import ValidationTools
# Validate email
is_valid = ValidationTools.is_valid_email("[email protected]")
# Output: True
# Validate URL
is_valid = ValidationTools.is_valid_url("https://example.com")
# Output: True
# Validate phone number (Turkish format)
is_valid = ValidationTools.is_valid_phone("0532 123 45 67")
# Output: True
Use Cases:
---
from ai_agent_tools import (
FileTools, TextTools, DataTools,
UtilityTools, MemoryTools, ValidationTools
)
# Initialize memory for session
memory = MemoryTools()
# Read input file
text = FileTools.read_file("contacts.txt")
# Extract information
emails = TextTools.extract_emails(text)
phones = TextTools.extract_phone_numbers(text)
# Validate extracted data
valid_emails = [e for e in emails if ValidationTools.is_valid_email(e)]
valid_phones = [p for p in phones if ValidationTools.is_valid_phone(p)]
# Create structured data
contacts = []
for i, (email, phone) in enumerate(zip(valid_emails, valid_phones)):
contact = {
"id": UtilityTools.generate_id(f"contact_{i}"),
"email": email,
"phone": phone,
"timestamp": UtilityTools.get_timestamp()
}
contacts.append(contact)
# Save results
DataTools.save_json(contacts, "output/contacts.json")
# Store in memory
memory.store("total_contacts", len(contacts))
memory.store("last_processed", UtilityTools.get_timestamp())
print(f"Processed {len(contacts)} contacts")
print(f"Saved to: output/contacts.json")
Always wrap file operations in try-except blocks:
try:
content = FileTools.read_file("data.txt")
# Process content
except Exception as e:
print(f"Error reading file: {e}")
Clear memory when no longer needed:
memory = MemoryTools()
# ... use memory ...
memory.clear() # Clean up
Always validate data before processing:
if ValidationTools.is_valid_email(email):
# Process email
pass
else:
print(f"Invalid email: {email}")
Use absolute paths or ensure working directory is correct:
import os
base_dir = os.path.dirname(__file__)
filepath = os.path.join(base_dir, "data", "file.txt")
content = FileTools.read_file(filepath)
# Read -> Process -> Validate -> Save pipeline
text = FileTools.read_file("input.txt")
cleaned = TextTools.clean_whitespace(text)
emails = TextTools.extract_emails(cleaned)
valid = [e for e in emails if ValidationTools.is_valid_email(e)]
DataTools.save_json({"emails": valid}, "output.json")
...
安装 Ai Agent Tools 后,可以对 AI 说这些话来触发它
Help me get started with Ai Agent Tools
Explains what Ai Agent Tools does, walks through the setup, and runs a quick demo based on your current project
Use Ai Agent Tools to python library offering file handling, text extraction, data conver...
Invokes Ai Agent Tools with the right parameters and returns the result directly in the conversation
What can I do with Ai Agent Tools in my documents & notes workflow?
Lists the top use cases for Ai Agent Tools, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/ai-agent-tools/ 目录(个人级,所有项目可用),或 .claude/skills/ai-agent-tools/(项目级)。重启 AI 客户端后,用 /ai-agent-tools 主动调用,或让 AI 根据上下文自动发现并使用。
Ai Agent Tools 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Ai Agent Tools 可免费安装使用。请查阅仓库了解许可证信息。
Python library offering file handling, text extraction, data conversion, utilities, memory storage, and validation tools for AI agent workflows.
Ai Agent Tools 属于「Documents & Notes」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my documents & notes tasks using Ai Agent Tools
Identifies repetitive steps in your workflow and sets up Ai Agent Tools to handle them automatically