langchain-tool-builder

langchain-tool-builder is a skill for Claude Code, Codex from simbajigege/book2skills. It costs 140 tokens per session (2,339 once invoked), scanned A, original, MIT.

A coding pattern for building LangChain tools in Python, with each tool keeping its name, input rules, security settings, and execution code together.

In plain words
What is it for?
Use it when defining a new LangChain tool or adding validation and permission checks to one.
Why use it?
It helps prevent tools from accidentally allowing unsafe actions when their security settings are missing. It also keeps input checking, permission checks, and tool execution separate.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code.

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/jigege/ai-base/backend/base/utils/claude_style_tool.py.

Good fit Use it when defining a new LangChain tool or adding validation and permission checks to one.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

There is no command for this one: it runs only inside a plugin, and the catalogue could not identify which plugin ships it. The source is linked below.

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for langchain-tool-builder

README.md
[![agentmods](https://agentmods.dev/badge/skills/simbajigege/book2skills/langchain-tool-builder/github.svg)](https://agentmods.dev/skills/simbajigege/book2skills/langchain-tool-builder)
Your own site
<a href="https://agentmods.dev/skills/simbajigege/book2skills/langchain-tool-builder"><img src="https://agentmods.dev/badge/skills/simbajigege/book2skills/langchain-tool-builder/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for langchain-tool-builder

Your own site · 80×15
<a href="https://agentmods.dev/skills/simbajigege/book2skills/langchain-tool-builder"><img src="https://agentmods.dev/badge/skills/simbajigege/book2skills/langchain-tool-builder.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 140 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,339 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00140 $0.02339
Opus 5 $0.00070 $0.01170
Sonnet 5 $0.00028 $0.00468
Haiku 4.5 $0.00014 $0.00234

Measured 11d ago against content hash ffcec65eddfa, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

langchain-tool-builder scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/langchain-tool-builder/SKILL.md · 228 lines

How it starts

The opening of the file, as written. The whole thing — 228 lines — stays where its author put it; the contents beside it link to each section on GitHub.

LangChain Tool Builder

Helps define LangChain (Python) tools using Claude Code's buildTool() pattern: a unified class that co-locates identity, schema, security properties, and execution logic, with fail-closed defaults so new tools are safe by default.

Why this pattern matters

Claude Code enforces three things that vanilla LangChain tools lack:

  1. Fail-closed defaultsis_read_only, is_destructive, is_concurrency_safe all default to False. A tool that forgets to declare its properties is conservatively treated as write-capable.
  2. Layered executionvalidate_semantics → check_permissions → _call are separate methods, so validation logic doesn't bleed into permission logic or business logic.
  3. Self-contained definition — schema, description, security metadata, and execution all live in one class. No separate permission middleware to wire up.

Workflow

Step 1 — Install the base class

Check if claude_style_tool.py exists in the project's utils directory. The expected location for the ai-base project is: /Users/jigege/ai-base/backend/base/utils/claude_style_tool.py

If it doesn't exist, copy it from references/claude_style_tool.py in this skill directory. Tell the user where it was placed and what it provides.

If working in a different project, ask the user where their utils/tools directory is.

Step 2 — Interview the user

Collect answers to these questions. Defaults are shown — skip questions where the default is clearly fine.

Naming convention: use {service}_{action}_{resource} format with a service prefix so the tool stays unambiguous when multiple tool sets are loaded simultaneously (e.g. stock_get_price, stock_list_symbols, github_create_issue). Start with a verb: get, list, search, create, delete.

Field Question Default
name 工具名(格式:{service}_{action}_{resource},例如 stock_get_price — required
description 给 LLM 看的一句话描述:精确匹配实际功能,不要模糊扩大,否则 agent 会在不该用的场景误调用 — required
Schema fields 工具接受哪些参数?(字段名、类型、说明;在 Field description 里加 example,如 e.g. '2024-01-01' — required
is_read_only 这个工具只读数据,不写入/不产生副作用吗? False
is_destructive 这个工具会做不可逆操作(删除、覆盖)吗? False
is_concurrency_safe 这个工具可以和其他工具同时运行吗? False
response_format 返回数据是给 agent 程序化处理(JSON)还是给用户展示(Markdown)? 视场景,默认 Markdown
是否列表工具 如果返回多条记录,要支持分页吗? 超过 50 条建议加
_validate_input_semantics 有没有需要在执行前拦截的语义问题?(如:参数太短、路径格式不对) 不需要
_check_permissions 有没有需要检查的权限?(如:只允许读特定路径、需要某个 env var) 不需要
_call 工具的核心执行逻辑是什么? — required

Read the full file on GitHub · 228 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 228 lines · 140 tokens per session scan A ffcec65eddfa

Subscribe to this mod's changes

langchain-tool-builder is a skill published in the GitHub repository simbajigege/book2skills (162 stars, last pushed 16d ago), licensed MIT. It adds 140 tokens to every session and 2,339 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

frappe-impl-controllers

Use when building Document Controllers in a custom Frappe app: file creation, lifecycle hooks, validation, autoname, submittable workflows, controller override, child table controllers, flags system, migration from hooks.py and Server Scripts. Keywords: how to implement controller, which hook to use, validate vs…

Impertio-Studio/Frappe_Claude_Skill_Package · 114 tokens

frappe-syntax-controllers

Use when writing Python Document Controllers for ERPNext/Frappe DocTypes. Covers lifecycle hooks (validate, onupdate, onsubmit), controller override, submittable documents, autoname patterns, UUID naming (v16), and the flags system. Keywords: document controller, lifecycle hook, validate, onupdate, onsubmit, autoname…

Impertio-Studio/Frappe_Claude_Skill_Package · 103 tokens

frappe-syntax-serverscripts

Use when writing Python code for ERPNext/Frappe Server Scripts including Document Events, API endpoints, Scheduler Events, and Permission Queries. Prevents the #1 AI mistake: using import statements in Server Scripts (sandbox blocks ALL imports). Covers frappe. methods, event name mapping, and correct v14/v15/v16…

Impertio-Studio/Frappe_Claude_Skill_Package · 116 tokens

pandas-helper

Master pandas operations — DataFrames, Series, groupby, merge, time-series resampling, and memory optimization.

inbharatai/claude-skills · 27 tokens

django-patterns

Django architecture patterns, REST API design with DRF, ORM best practices, caching, signals, middleware, and production-grade Django apps.

affaan-m/ECC · 32 tokens

accelerate

Run PyTorch training across GPUs with minimal changes.

NousResearch/hermes-agent · 13 tokens