Overview
The LangChain integration has two practical paths:- Python adapter — use
CoboAgentWalletToolkitand get CAW tools asStructuredToolinstances - TypeScript custom tools — wrap the CAW TypeScript SDK in LangChain tools and expose only the narrow subset your runtime needs
Quick Start
Tool Selection
If you do not want the full CAW runtime surface in the agent context, passinclude_tools or exclude_tools when constructing the toolkit:
TypeScript Path
When using LangChain in TypeScript, the CAW repo does not currently ship a dedicated JS adapter equivalent toCoboAgentWalletToolkit. The recommended approach is:
- use
@cobo/agentic-walletfor API access - wrap CAW calls in LangChain
tool(...)definitions withzodschemas - keep the model-facing surface limited to Pact Drafting, Execution, and Observer tools
- preserve policy denials as normal tool results so the agent can adapt
Tools
The toolkit exposesStructuredTool instances, each with a Pydantic args_schema auto-generated from the canonical JSON Schema. The current surface includes 20 tools across four categories:
- Wallet context: wallet discovery, wallet metadata, wallet addresses, balances
- Scoped authority: pact submission and inspection, plus direct delegation provisioning
- Onchain and payment actions: transfers, contract calls, message signing, payments, and fee estimation
- Tracking and audit: transaction listings, durable transaction records, request-id lookup, recent addresses, and audit logs
Denial Behavior
When a transfer is denied by policy, the tool returns formatted text instead of raising an exception:Error Contract
- Policy denials — returned as formatted text (tool succeeds)
- Other API errors — raised as
ToolException(tool fails, agent can retry)
Advanced: Custom error handling
Advanced: Custom error handling
You can override how denials are surfaced by subclassing
AgentWalletToolkit
and overriding the _format_denial static method, then passing the custom toolkit
to CoboAgentWalletToolkit.Source Code
src/cobo_agentic_wallet/integrations/langchain/toolkit.py