RampartAgent extends the Rampart class and exposes every SDK function as a structured Vercel AI SDK v6 tool. Pass agent.tools directly to generateText, streamText, or any AI SDK function - the agent handles schema validation and execution automatically.
Overview
RampartAgent wraps all Rampart functions using tool() from the Vercel AI SDK v6. Each tool uses inputSchema: (Zod) for input validation and an execute function that delegates to the underlying protocol function. This means any LLM with tool-calling support can query Monad DeFi data autonomously.
Tools are built internally using the Vercel AI SDK tool() helper with inputSchema: (not parameters:, which is the v5 API):
Multi-Step Agent Example
Streaming Example
You can destructure individual tools from agent.tools if you want to compose a custom subset:
Notes
RampartAgent is model-agnostic - any AI SDK v6 compatible provider works (Anthropic, OpenAI, Google, etc.).
- All tools use
inputSchema: (Vercel AI SDK v6 API). Do not use parameters: which is the v5 API and will cause a type error.
- The
execute functions are async and call the same underlying RPC functions as the Rampart class methods - there is no additional latency layer.
maxSteps controls how many sequential tool calls the model may make. For complex multi-protocol queries, set this to at least 5.