MotteTF - Tool Forge

Universal API integration platform

MotteTF automatically generates tool schemas from OpenAPI specifications and handles authentication, rate limiting, and error handling for seamless external service integration.

Core Components

Schema Generation

Automatically parse OpenAPI/Swagger specifications to generate tool schemas for AI agents.

  • • OpenAPI 3.0+ support
  • • Automatic parameter validation
  • • Response type inference
  • • Error handling generation

Authentication

Support for multiple authentication methods with secure credential management.

  • • API Key authentication
  • • OAuth 2.0 flows
  • • Bearer token support
  • • Custom header authentication

Rate Limiting

Intelligent rate limiting with backoff strategies to respect API quotas and prevent service disruption.

Error Handling

Robust error handling with retry logic, circuit breakers, and graceful degradation strategies.

Supported Integrations

Service TypeExamplesAuth MethodRate Limits
CRM SystemsSalesforce, HubSpotOAuth 2.0100/min
CommunicationSlack, Discord, TeamsBearer Token1000/hour
Cloud StorageAWS S3, Google DriveAPI Key5000/day
PaymentStripe, PayPalAPI Key100/sec
AnalyticsGoogle Analytics, MixpanelOAuth 2.010000/day

Tool Schema Format

Generated Tool Schema

{
  "name": "create_ticket",
  "description": "Create a new support ticket in the system",
  "parameters": {
    "type": "object",
    "properties": {
      "title": {
        "type": "string",
        "description": "Ticket title or summary"
      },
      "description": {
        "type": "string",
        "description": "Detailed description of the issue"
      },
      "priority": {
        "type": "string",
        "enum": ["low", "medium", "high", "urgent"],
        "description": "Ticket priority level"
      },
      "assignee": {
        "type": "string",
        "description": "User ID to assign the ticket to"
      }
    },
    "required": ["title", "description"]
  },
  "auth": {
    "type": "api_key",
    "header": "X-API-Key"
  },
  "rate_limit": {
    "requests": 100,
    "window": "1m"
  }
}

Authentication Methods

API Key Authentication

{
  "auth": {
    "type": "api_key",
    "location": "header", // or "query"
    "name": "X-API-Key", // header name or query parameter
    "value": "{{API_KEY}}" // environment variable reference
  }
}

Simple API key authentication via headers or query parameters.

OAuth 2.0 Flow

{
  "auth": {
    "type": "oauth2",
    "flow": "authorization_code",
    "auth_url": "https://api.example.com/oauth/authorize",
    "token_url": "https://api.example.com/oauth/token",
    "scopes": ["read", "write"],
    "client_id": "{{CLIENT_ID}}",
    "client_secret": "{{CLIENT_SECRET}}"
  }
}

Full OAuth 2.0 support with automatic token refresh and scope management.

Bearer Token

{
  "auth": {
    "type": "bearer",
    "token": "{{ACCESS_TOKEN}}"
  }
}

Bearer token authentication for services that provide long-lived tokens.

Rate Limiting Strategies

Token Bucket

Allows bursts of requests up to bucket capacity, refilling at a steady rate. Best for APIs with burst tolerance.

Fixed Window

Fixed number of requests per time window. Simple and predictable, ideal for strict rate limits.

Sliding Window

Smooths out request distribution over time. More complex but provides better rate limit utilization.

Exponential Backoff

Automatically increases delay between retries on rate limit hits. Prevents thundering herd problems.

API Endpoints

Generate Tool Schema

POST /api/tools/generate-schema
Content-Type: application/json

{
  "openapi_url": "https://api.example.com/openapi.json",
  "auth_config": {
    "type": "api_key",
    "header": "X-API-Key"
  },
  "rate_limit": {
    "requests": 100,
    "window": "1m"
  }
}

Generate tool schemas from OpenAPI specifications with custom authentication and rate limiting.

Test Connection

POST /api/tools/test-connection
Content-Type: application/json

{
  "tool_id": "tool_abc123",
  "test_endpoint": "/api/health",
  "expected_status": 200
}

Test connectivity and authentication for configured tools before deployment.

Execute Tool

POST /api/tools/execute
Content-Type: application/json

{
  "tool_id": "tool_abc123",
  "function": "create_ticket",
  "parameters": {
    "title": "Login issue",
    "description": "User cannot access account",
    "priority": "high"
  }
}

Execute tool functions with automatic parameter validation and error handling.

Error Handling

Circuit Breaker Pattern

  • Closed: Normal operation, requests pass through
  • Open: Service unavailable, requests fail fast
  • Half-Open: Testing recovery, limited requests allowed

Prevents cascading failures by temporarily blocking requests to failing services.

Retry Strategies

{
  "retry": {
    "max_attempts": 3,
    "backoff": "exponential",
    "base_delay": 1000, // ms
    "max_delay": 30000, // ms
    "retry_on": [500, 502, 503, 504, 429]
  }
}

Configurable retry logic with exponential backoff for transient failures.