Skip to content

Conversation

@jadonamite
Copy link

Summary

Adds a tutorial on extending AgentKit with Custom Tools using LangChain and Viem.

Content

  • Author: @jadonamite
  • Stack: Node.js, Viem, LangChain, Zod.
  • Key Features:
    • Implementation of tokenBalanceTool using @langchain/core/tools.
    • Use of viem createPublicClient and readContract for raw blockchain data.
    • Zod schema definition for strict tool inputs.
    • Integration of custom tools into the createReactAgent tools array.

Motivation

Developers often need to extend the default AgentKit capabilities. This guide provides a canonical example of how to write a typed, safe, and effective custom tool for reading contract state.

Verification

  • Verified tokenBalanceTool correctly fetches decimals and symbols.
  • Verified the tool handles invalid addresses gracefully.
  • Verified integration with the existing agent-cli project.

Added a tutorial for building a custom token balance checker using Viem and LangChain.
@cb-heimdall
Copy link
Collaborator

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants