Basic tools of kantan-agents
Project description
kantan-agents-tools
A ready-to-use basic tool pack for kantan-agents (Web/Browser/FS/Exec).
All tool usage is controlled through tool_rules for consistent safety and reproducibility.
What problems it solves
- You need a ready-to-use set of basic tools for kantan-agents to start fast.
- Tool interfaces and configs vary across providers, increasing learning cost.
- Agents can accidentally touch unexpected paths, domains, or commands.
- It is hard to trace what ran and which limits were applied.
kantan-agents-tools bundles basic tools and centralizes allow/deny, input validation, and policy/limits under tool_rules
so you can safely repeat "research -> fetch -> operate -> edit -> execute".
Tool list
Web
kantan_web_search: return candidate URLs from searchkantan_web_fetch: fetch HTML/text from a URLkantan_web_extract: extract main text from HTML
Browser
kantan_browser_open: open dynamic pages and return apage_idkantan_browser_act: run actions like click/input/waitkantan_browser_extract: extract text/links/tables from DOM
FileSystem
kantan_fs_list: list directory entrieskantan_fs_search: search file contentskantan_fs_read: read a file safelykantan_fs_write: create/overwrite/append a filekantan_fs_apply_patch: apply a unified diff
Exec
kantan_shell_run: run a command
About the kantan stack
The kantan stack separates the LLM, agent runtime, tools, and your app into thin layers:
kantan-llm: minimal interface for LLM callskantan-agents: agent runtime andtool_rulesgovernancekantan-agents-tools: this basic tool pack- your app: workflow and domain logic
This separation keeps safety and reproducibility while allowing clean replacement and extension.
Install
# 基本ツールを追加 / Add core tools.
uv add kantan-agents kantan-agents-tools
# ブラウザ系ツールを使う場合 / When using browser tools.
uv add playwright
python -m playwright install chromium
Quick Start (Agent)
kantan-agents discovers tool providers via entry points.
Use tool_rules to allow tools and to configure validation + tool settings.
from kantan_agents import Agent, ToolRulesMode, get_context_with_tool_rules
agent = Agent(
name="tools-agent",
instructions="Use kantan_web_search to find references.",
model="gpt-5-mini", # モデルを明示 / Explicit model.
)
context = get_context_with_tool_rules(ToolRulesMode.RECOMMENDED) # 推奨ルールを作成 / Build recommended rules.
context["tool_rules"]["allow"] = ["kantan_web_search"] # 検索のみ許可 / Allow search only.
context["tool_rules"]["params"] = {
"kantan_web_search": {
"max_results": {"type": "integer", "minimum": 1, "maximum": 5}, # 入力バリデーション / Input validation.
"policy": {"allowed_domains": ["example.com"], "search_provider": "auto"}, # 許可ドメイン / Allowed domains.
"limits": {"max_fetch_bytes": 512000, "max_output_chars": 20000, "max_matches": 200}, # 出力上限 / Output limits.
"request_id": "req-001", # 追跡ID / Request ID.
}
}
result = agent.run("Search for kantan-agents.", context=context)
print(result["result"].final_output) # 結果を表示 / Print the result.
Notes:
tool_rules.paramsis used for both input validation and tool settings.- Reserved keys for tool settings:
policy/limits/tracer/request_id.
Direct Call (Non-agent)
from kantan_agents_tools import default_toolset
toolset = default_toolset()
print(toolset.fs_list("."))
Testing
uv run pytest
Docs
docs/tool_usage.mddocs/spec.mddocs/architecture.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kantan_agents_tools-0.1.2.tar.gz.
File metadata
- Download URL: kantan_agents_tools-0.1.2.tar.gz
- Upload date:
- Size: 26.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3b511a53d0d0f16cea0e0251dfa4a4d0ccf2e9922b6b22b226eec8bf60a1a25
|
|
| MD5 |
fadfb4c1f6b44e975d8b0122d639a1de
|
|
| BLAKE2b-256 |
66795cf47c9840b904db56f76cbfb89d26b2bc43bd0a434242311d47650393bc
|
File details
Details for the file kantan_agents_tools-0.1.2-py3-none-any.whl.
File metadata
- Download URL: kantan_agents_tools-0.1.2-py3-none-any.whl
- Upload date:
- Size: 26.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f32f0b09e096f351c343cac5a3c750c05aba9b07a73aec49ccbb0ac2d8f5039
|
|
| MD5 |
768db5cc5ec8d365c545c220e146fc5c
|
|
| BLAKE2b-256 |
de1e036e64754bfb00e747b92c01e645332bb24b1a8f3b6525ef893d3caa581c
|