Examples Overview
Explore practical examples demonstrating Agent Tool Protocol features and use cases.
Getting Started Examples
Start here if you're new to ATP:
- Simple Server: Create a basic ATP server
- Simple Client: Connect to a server and execute code
- Custom API: Build custom APIs with TypeScript
- OpenAPI Server: Load OpenAPI specifications
Client Features
Learn about client capabilities:
- LLM Integration: Provide LLM services
- Client Tools: Build client-side tools
- Approval Handler: Human-in-the-loop approval
- Embeddings: Semantic search with embeddings
Security Examples
Implement security features:
- Provenance Basic: Basic provenance tracking
- Security Policies: Enforce security policies
- OAuth Integration: OAuth-based authentication
Integration Examples
Integrate with popular frameworks:
- LangChain Agent: Build LangChain agents
- LangGraph Agent: Multi-agent workflows
- Express Server: Integrate with Express.js
- Fastify Server: Integrate with Fastify
Production Examples
Production-ready implementations:
- Full-Stack App: Complete application
- With Redis: Redis caching and scaling
- With Monitoring: OpenTelemetry monitoring
Quick Links
By Difficulty
Beginner:
- Simple Server
- Simple Client
- Custom API
Intermediate:
- LLM Integration
- Client Tools
- LangChain Agent
Advanced:
- Security Policies
- LangGraph Agent
- Full-Stack App
By Feature
Execution:
APIs:
LLM:
Security:
Scaling:
Running Examples
Clone the Repository
git clone https://github.com/mondaycom/agent-tool-protocol.git
cd agent-tool-protocol
Install Dependencies
yarn install
Run an Example
cd examples/quickstart
npx tsx server.ts
In another terminal:
cd examples/quickstart
npx tsx client.ts
Example Structure
Each example includes:
- README.md: Explanation and instructions
- server.ts: Server implementation (if applicable)
- client.ts: Client implementation
- package.json: Dependencies
- env.example: Environment variable template
Common Setup
Most examples use this basic setup:
Server
import { createServer } from '@mondaydotcomorg/atp-server';
const server = createServer({
execution: {
timeout: 30000,
memory: 128 * 1024 * 1024,
},
});
// Register APIs
server.registerAPI('example', {
// API functions
});
server.listen(3333);
Client
import { AgentToolProtocolClient } from '@mondaydotcomorg/atp-client';
const client = new AgentToolProtocolClient({
baseUrl: 'http://localhost:3333',
});
await client.init();
await client.connect();
const result = await client.execute(`
// Your code here
`);
Environment Setup
Most examples require environment variables:
# .env
ANTHROPIC_API_KEY=your-key-here
OPENAI_API_KEY=your-key-here
REDIS_URL=redis://localhost:6379
Copy env.example to .env and fill in your values:
cp env.example .env
Troubleshooting
Port Already in Use
If port 3333 is taken:
// Change port in both server and client
server.listen(3334);
const client = new AgentToolProtocolClient({
baseUrl: 'http://localhost:3334',
});
Missing API Keys
Most LLM examples require API keys:
export ANTHROPIC_API_KEY=your-key
# or
export OPENAI_API_KEY=your-key
TypeScript Errors
Make sure you've built the packages:
yarn build
Contributing Examples
We welcome example contributions! See CONTRIBUTING.md.
Example Template
/**
* Example: [Name]
*
* Description: Brief description of what this example demonstrates
*
* Key Features:
* - Feature 1
* - Feature 2
*
* Prerequisites:
* - Prerequisite 1
* - Prerequisite 2
*/
// Implementation...
Next Steps
- API Reference: Complete API documentation
- Guides: In-depth guides
- GitHub: Source code and more examples
Support
- GitHub Issues: Report bugs or request features
- Discussions: Ask questions and share ideas
- Examples Directory: Browse all examples in the repo