Major revision based on first principles thinking: - Simplified format: plain Markdown, human readable - Focus on capabilities (Can/Cannot) not API schemas - MCP gateway pointer for structured tool access - Clear positioning vs robots.txt and llms.txt The agents.md file is the handshake. The MCP gateway is where real work happens. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
107 lines
2.2 KiB
Markdown
107 lines
2.2 KiB
Markdown
# Example: Weather Service
|
|
|
|
A simple weather API demonstrating minimal and practical agent.md usage.
|
|
|
|
## agent.md
|
|
|
|
```yaml
|
|
---
|
|
protocol_version: "0.1"
|
|
name: "Weather Service"
|
|
description: "Current weather and forecasts for any location"
|
|
|
|
tools:
|
|
- name: get_current
|
|
description: "Get current weather conditions for a location"
|
|
endpoint: "GET /api/weather/current"
|
|
parameters:
|
|
type: object
|
|
properties:
|
|
location:
|
|
type: string
|
|
description: "City name, address, or coordinates (lat,lon)"
|
|
units:
|
|
type: string
|
|
enum: ["metric", "imperial"]
|
|
default: "metric"
|
|
required:
|
|
- location
|
|
response:
|
|
type: json
|
|
schema:
|
|
type: object
|
|
properties:
|
|
temperature:
|
|
type: number
|
|
feels_like:
|
|
type: number
|
|
humidity:
|
|
type: integer
|
|
conditions:
|
|
type: string
|
|
wind_speed:
|
|
type: number
|
|
auth: none
|
|
rate_limit: "60/minute"
|
|
|
|
- name: get_forecast
|
|
description: "Get weather forecast for upcoming days"
|
|
endpoint: "GET /api/weather/forecast"
|
|
parameters:
|
|
type: object
|
|
properties:
|
|
location:
|
|
type: string
|
|
days:
|
|
type: integer
|
|
minimum: 1
|
|
maximum: 14
|
|
default: 7
|
|
units:
|
|
type: string
|
|
enum: ["metric", "imperial"]
|
|
default: "metric"
|
|
required:
|
|
- location
|
|
auth: api_key
|
|
rate_limit: "30/minute"
|
|
|
|
- name: get_alerts
|
|
description: "Get active weather alerts for a location"
|
|
endpoint: "GET /api/weather/alerts"
|
|
parameters:
|
|
type: object
|
|
properties:
|
|
location:
|
|
type: string
|
|
required:
|
|
- location
|
|
auth: none
|
|
|
|
auth:
|
|
api_key:
|
|
header: "X-Weather-Key"
|
|
obtain: "https://weather.example/api-keys"
|
|
description: "Free tier: 1000 requests/day"
|
|
|
|
rate_limits:
|
|
global: "1000/day"
|
|
|
|
contact:
|
|
url: "https://weather.example/api/docs"
|
|
---
|
|
|
|
# Weather API for Agents
|
|
|
|
Simple, reliable weather data.
|
|
|
|
## Free Tools
|
|
- Current conditions (no key needed)
|
|
- Weather alerts (no key needed)
|
|
|
|
## API Key Required
|
|
- Extended forecasts (up to 14 days)
|
|
|
|
Get your free API key at weather.example/api-keys
|
|
```
|