Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

dynamic-api-integration

БесплатноЗапускает вложенные скриптыНе проверен

Discover, parse, and call external HTTP APIs at runtime using OpenAPI specs, tool templates, and iterative chaining. Adapted from UTCP (Universal Tool Calling…

oimiragieoот oimiragieo★ 48 звёзд на GitHub

Об этом скилле

Mode: Cognitive/Prompt-Driven — No standalone utility script; use via agent context.

Dynamic API Integration

Overview

This skill teaches agents how to dynamically discover, parse, and call external HTTP APIs at runtime. It is adapted from the Universal Tool Calling Protocol (UTCP) patterns, translated into Node.js / Claude Code tool patterns.

Core workflow (5-phase, inspired by UTCP agent state machine):

  1. Discover — Fetch and parse an OpenAPI/Swagger spec (or define a manual tool template).
  2. Match — Map the user's intent to the right API endpoint semantically.
  3. Construct — Build the HTTP request with proper method, path, params, headers, body, and auth.
  4. Execute — Call the API via Bash (curl) or WebFetch and capture the response.
  5. Chain — If the task is not yet complete, re-analyze and execute another call (up to max_iterations).

When to Use

Use this skill when:

  • Agent needs to call an external REST API it has not used before
  • User provides an API URL or OpenAPI spec URL and wants data extracted
  • Agent must discover available endpoints from a spec before choosing which to call
  • Multiple API calls need to be chained iteratively (search -> get details -> filter)
  • Agent needs to construct HTTP requests with authentication and parameters

Do NOT use when:

  • The API is already wrapped as an MCP tool (use the MCP tool directly)
  • The integration is a one-time hardcoded call (just use Bash curl directly)
  • The API requires OAuth 2.0 authorization code flow with user-interactive redirect
  • The API uses WebSocket or streaming-only protocols (not HTTP REST)

Iron Laws

  1. NEVER hardcode API keys, tokens, or secrets in requests, curl commands, or source files — always use environment variables ($ENV_VAR) or a secrets manager.
  2. ALWAYS discover the API spec (OpenAPI/Swagger) before writing any integration code — guessing endpoint shapes without spec evidence produces broken integrations.
  3. NEVER skip pagination handling when the API returns list responses — assuming single-page results silently drops data for any dataset above the page limit.
  4. ALWAYS implement retry logic with exponential backoff for transient failures (429, 503) — dynamic APIs are unreliable by nature and integrations without retries fail under normal production conditions.
  5. NEVER trust API responses without validating the schema of each response before use — dynamic API shapes change without notice; unvalidated responses cause runtime crashes in callers.

Phase 1: Discover — Fetch and Parse the API Spec

Option A: OpenAPI/Swagger Spec Discovery

When the API provides an OpenAPI spec (most modern APIs do):

# Step 1: Fetch the OpenAPI spec
WebFetch({
  url: "https://api.example.com/openapi.json",
  prompt: "Extract all API endpoints. For each endpoint, list: HTTP method, path, description, required parameters, optional parameters, authentication requirement. Return as a structured list."
})

What to extract from the spec:

Field Location in Spec Purpose
Base URL servers[0].url API root for all requests
Endpoints paths.* Available operations
Methods paths.*.get/post/put/delete HTTP verbs per endpoint
Parameters paths.*.*.parameters[] Query, path, header params
Request body paths.*.*.requestBody POST/PUT payload schema
Auth components.securitySchemes API key, Bearer, OAuth
Response schema paths.*.*.responses.200 Expected response format

Common OpenAPI spec locations:

  • https://api.example.com/openapi.json
  • https://api.example.com/swagger.json
  • https://api.example.com/v3/api-docs
  • https://api.example.com/.well-known/openapi.json
  • https://api.example.com/docs (HTML page may link to spec)

Option B: Manual Tool Template (No Spec Available)

When no OpenAPI spec exists, define a tool template manually:

{
  "name": "search_books",
  "description": "Search Open Library for books by query",
  "base_url": "https://openlibrary.org/search.json",
  "method": "GET",
  "auth": null,
  "parameters": {
    "q": {
      "type": "string",
      "required": true,
      "in": "query",
      "description": "Search query (title, author, ISBN)"
    },
    "limit": {
      "type": "integer",
      "required": false,
      "in": "query",
      "description": "Max results to return (default 10)"
    },
    "page": {
      "type": "integer",
      "required": false,
      "in": "query",
      "description": "Page number for pagination"
    }
  },
  "response_hint": "Returns { numFound, docs: [{ title, author_name, first_publish_year }] }"
}

Tool Template JSON Schema

The tool template f

Полный SKILL.md на GitHub

Установить dynamic-api-integration в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Write
Edit
Bash
WebFetch
WebSearch

Вложенные файлы

commands/dynamic-api-integration.mdhooks/post-execute.cjshooks/pre-execute.cjsreferences/research-requirements.mdrules/dynamic-api-integration.mdschemas/input.schema.jsonschemas/output.schema.jsonscripts/main.cjstemplates/implementation-template.md

FAQ

Что делает скилл dynamic-api-integration?

Discover, parse, and call external HTTP APIs at runtime using OpenAPI specs, tool templates, and iterative chaining. Adapted from UTCP (Universal Tool Calling Protocol) patterns for Node.js and Claude Code agents.

Как установить скилл dynamic-api-integration?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл dynamic-api-integration запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить dynamic-api-integration с