add-tool

add-tool is a command for Claude Code from Codeblockz/langchain-community-plugin. It costs 13 tokens per session (721 once invoked), scanned A, original, Apache-2.0.

A command for adding a tool function to an existing LangGraph agent, a program that connects language-model steps into a workflow. It finds the agent file, inserts the function, and registers it with the agent.

In plain words
What is it for?
Use it to add a new callable operation to a LangGraph agent, such as a function that reads data, performs a task, or calls another service.
Why use it?
It avoids manually locating the right file and updating the separate tool-registration code that makes the new function available.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Part of the langchain-community plugin — 3 skills, 5 commands, 2 agents, 1 MCP server shipped together

Good fit Use it to add a new callable operation to a LangGraph agent, such as a function that reads data, performs a task, or calls another service.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/codeblockz/langchain-community-plugin/add-tool
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/Codeblockz/langchain-community-plugin

Made for: Claude Code.

Or install langchain-community, the plugin that ships this one along with the rest of its 3 skills, 5 commands, 2 agents, 1 MCP server.

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 add-tool

README.md
[![agentmods](https://agentmods.dev/badge/commands/codeblockz/langchain-community-plugin/add-tool/github.svg)](https://agentmods.dev/commands/codeblockz/langchain-community-plugin/add-tool)
Your own site
<a href="https://agentmods.dev/commands/codeblockz/langchain-community-plugin/add-tool"><img src="https://agentmods.dev/badge/commands/codeblockz/langchain-community-plugin/add-tool/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 add-tool

Your own site · 80×15
<a href="https://agentmods.dev/commands/codeblockz/langchain-community-plugin/add-tool"><img src="https://agentmods.dev/badge/commands/codeblockz/langchain-community-plugin/add-tool.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 721 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.00013 $0.00721
Opus 5.5 $0.00005 $0.00288
Sonnet 5.5 $0.00003 $0.00144
Haiku 4.5 $0.00001 $0.00072

Measured 2mo ago against content hash 4a8e0b2c8209, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

add-tool 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 2mo 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.

commands/add-tool.md · 124 lines

How it starts

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

Add Tool Command

Add a new tool function to an existing LangGraph agent file.

Workflow

  1. Parse arguments:

    • First argument: tool name (required)
    • Second argument: file path (optional, will search for agent files)
  2. If no file specified, search for likely agent files:

    • agent.py, graph.py, main.py
    • Files containing StateGraph or create_agent
  3. Read the target file to understand its structure

  4. Ask user what the tool should do (unless obvious from name)

  5. Generate tool code following this pattern:

@tool
def tool_name(param1: str, param2: int = 10) -> str:
    """Brief description of what the tool does.

    Args:
        param1: Description of param1
        param2: Description of param2 (default: 10)
    """
    # Implementation
    return result
  1. Insert the tool in the appropriate location:

    • After existing tool definitions
    • Before the model/graph setup
  2. Update tool registration:

    • For create_agent: Add to tools=[...] list
    • For StateGraph: Add to tools = [...] and tools_by_name = {...}

Tool Template

@tool
def {tool_name}({parameters}) -> {return_type}:
    """{description}

    Args:
        {arg_docs}
    """
    {implementation}
    return {result}

Best Practices to Apply

  1. Always include docstring with Args section - LLMs use this
  2. Use type hints for all parameters and return value
  3. Keep tools focused - one clear purpose
  4. Return strings for simple tools (easier for LLM to process)
  5. Handle errors gracefully - return error messages, don't raise

Example Additions

API Tool

@tool
def fetch_weather(city: str) -> str:
    """Get current weather for a city.

    Args:
        city: City name (e.g., "San Francisco")
    """
    # TODO: Call weather API
    return f"Weather in {city}: Sunny, 72°F"

Database Tool

@tool
def query_database(sql: str) -> str:
    """Execute a read-only SQL query.

    Args:
        sql: SQL SELECT query to execute
    """
    # TODO: Implement with proper connection handling
    return "Query results..."

Read the full file on GitHub · 124 lines

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. 2mo ago First seen · 124 lines · 13 tokens per session scan A 4a8e0b2c8209

Subscribe to this mod's changes

add-tool is a command published in the GitHub repository Codeblockz/langchain-community-plugin (3 stars, last pushed 9mo ago), licensed Apache-2.0. It adds 13 tokens to every session and 721 once invoked, about $0.0001 per session on Opus 5.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-31.

Related

add-tool compared with commands from other repositories

add-tool next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
add-toolCodeblockz/langchain-community-pluginCommand39mo agoApache-2.0A13Claude Code
expectyonatangross/orchestkitCommand299yesterdayMITA51Claude Code, Cursor
design-importyonatangross/orchestkitCommand299yesterdayMITA47Claude Code, Cursor
exploreyonatangross/orchestkitCommand299yesterdayMITA39Claude Code, Cursor
design-shipyonatangross/orchestkitCommand299yesterdayMITA50Claude Code, Cursor
devyonatangross/orchestkitCommand299yesterdayMITA45Claude Code, Cursor
memoryyonatangross/orchestkitCommand299yesterdayMITA36Claude Code, Cursor