📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials AI Agents and Automation API Integration Agents

API Integration Agents

5 min read
Agents that orchestrate multiple third-party APIs — GitHub, Slack, Jira, Salesforce — in one workflow.

API Integration Automation

import anthropic, httpx

client = anthropic.Anthropic()

# Agent that calls third-party APIs
tools = [
    {
        "name": "github_api",
        "description": "Call the GitHub REST API",
        "input_schema": {
            "type": "object",
            "properties": {
                "endpoint": {"type":"string","description":"API path e.g. /repos/user/repo"},
                "method":   {"type":"string","enum":["GET","POST","PATCH","DELETE"]},
                "body":     {"type":"object","description":"Request body for POST/PATCH"}
            },
            "required": ["endpoint","method"]
        }
    },
    {
        "name": "slack_send",
        "description": "Send a message to a Slack channel",
        "input_schema": {
            "type": "object",
            "properties": {
                "channel": {"type":"string"},
                "message": {"type":"string"}
            },
            "required": ["channel","message"]
        }
    }
]

def execute_api_tool(name: str, inp: dict) -> str:
    if name == "github_api":
        url = f"https://api.github.com{inp["endpoint"]}"
        resp = httpx.request(inp["method"], url,
            headers={"Authorization":f"token {GITHUB_TOKEN}"},
            json=inp.get("body"))
        return resp.text[:3000]
    if name == "slack_send":
        return send_slack(inp["channel"], inp["message"])