Skip to content

LangGraph - Tools

This section documents all tools available to LangGraph agents.

Overview

Tools are decorated with @tool from LangChain and provide specific functionalities to agents. Each tool accepts a config parameter containing authentication and context information.

Available Tools

Tool Configuration

All tools accept a config parameter with the following structure:

{
    "configurable": {
        "user_application_id": "user123",  # Current user ID
        "client_id": "725",  # Client ID
        "data_source": "pwc",  # e.g. pwc, smartmobility
        "environment": "prod",  # Environment
    }
}

Usage Pattern

from src.chatbot.agentic.tools.user_tools import get_user_tool

# Call tool with config
result = await get_user_tool.ainvoke(
    {"user_id": "user456"},
    config={
        "configurable": {
            "user_application_id": "current_user",
            "client_id": "725",
            "data_source": "pwc",
        }
    },
)

Tool Development

When creating new tools:

  1. Use @tool decorator from LangChain
  2. Add Google-style docstrings
  3. Include clear parameter descriptions
  4. Handle errors gracefully
  5. Log important actions
  6. Return structured data