API

API Catalog

Integration

Search, identify, and suggest APIs from a curated catalog with documentation fetching, implementation code generation, and API comparison capabilities.

Core Capabilities

When to Use

OpenAPI/Swagger Support

OpenAPI specifications are machine-readable YAML/JSON files that define:

Workflow: Parsing OpenAPI from URL

  1. Fetch the spec - Use WebFetch to retrieve the OpenAPI YAML/JSON from the URL
  2. Parse key sections - Extract info, servers, paths, components/schemas, securitySchemes
  3. Extract endpoint details - HTTP method, path parameters, query parameters, request body, responses
  4. Generate documentation summary - Present overview, endpoints, authentication, data models

Code Generation Example

When generating implementation code from an OpenAPI spec:

interface PolicyCreate {
  policyNumber: string;
  holderName: string;
  coverageType: 'basic' | 'premium' | 'comprehensive';
  startDate: string;
}

async function createPolicy(
  data: PolicyCreate,
  token: string
): Promise<Policy> {
  const response = await fetch('https://api.example.io/api/v1/policies', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${token}`
    },
    body: JSON.stringify(data)
  });

  if (!response.ok) {
    throw new Error(`API error: ${response.status}`);
  }

  return response.json();
}

API Types Supported

Key Principles