Agent tooling
Framework wrappers
Building your own agent? Official packages expose the full Edge tool set as native tools for LangChain, LlamaIndex, CrewAI, and the Vercel AI SDK.
On this page7 sections
How they work#
Both packages expose the full Edge tool set and fetch tool definitions from the MCP endpoint at runtime rather than bundling static copies. When Edge ships a new tool or refines a description, your agent picks it up on the next run without a package update. Arguments are validated against each tool’s JSON Schema before anything is sent.
| Package | Registry | Frameworks |
|---|---|---|
edge-network-agent |
PyPI | LangChain, LlamaIndex, CrewAI (via optional extras) |
@edge-network/ai-tools |
npm | Vercel AI SDK (generateText / streamText) |
Authentication is the same everywhere: pass an agent access code explicitly or set the EDGE_AGENT_CODE environment variable.
LangChain#
pip install "edge-network-agent[langchain]"from edge_network_agent import EdgeAgentTools
from langchain.agents import create_react_agent
edge = EdgeAgentTools(agent_code="ea_live_...") # or EDGE_AGENT_CODE env var
agent = create_react_agent(model, tools=edge.langchain_tools())
agent.invoke({"messages": [
("user", "Deploy ./dist as a static site on Edge and give me the URL")
]})langchain_tools() returns StructuredTool instances with Pydantic argument models built from each tool’s schema. Pass include=["edge_discover", "edge_deploy_static_site"] to expose a subset.
LlamaIndex#
pip install "edge-network-agent[llamaindex]"from edge_network_agent import EdgeAgentTools
from llama_index.core.agent import ReActAgent
edge = EdgeAgentTools() # EDGE_AGENT_CODE env var
agent = ReActAgent.from_tools(edge.llamaindex_tools(), llm=llm)
agent.chat("What projects do I have on Edge, and are they healthy?")llamaindex_tools() returns FunctionTool instances ready for any LlamaIndex agent.
CrewAI#
pip install "edge-network-agent[crewai]"from edge_network_agent import EdgeAgentTools
from crewai import Agent
edge = EdgeAgentTools()
devops = Agent(
role="DevOps engineer",
goal="Deploy and monitor the team's sites on Edge",
tools=edge.crewai_tools(),
)crewai_tools() returns BaseTool instances any crew member can use.
Vercel AI SDK#
npm install @edge-network/ai-tools aiimport { generateText } from 'ai'
import { createEdgeTools, fetchStarterPrompt } from '@edge-network/ai-tools'
const tools = await createEdgeTools({ agentCode: 'ea_live_...' })
const { text } = await generateText({
model,
system: await fetchStarterPrompt(),
tools,
prompt: 'Deploy the ./dist folder as a static site and report the URL',
})createEdgeTools() resolves to a tool map for generateText and streamText; fetchStarterPrompt() returns Edge’s recommended system prompt.
Without a framework#
The Python package also works standalone. Call tools directly and pull the starter prompt:
edge = EdgeAgentTools(agent_code="ea_live_...")
# Call any tool directly, no framework needed
result = edge.call(
"edge_deploy_static_site",
project="my-site",
files=[...],
dry_run=True, # preview first
)
# The recommended system prompt for agents working with Edge
system = edge.starter_prompt()Next steps
Something unclear or out of date? Tell us