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★ 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):
- Discover — Fetch and parse an OpenAPI/Swagger spec (or define a manual tool template).
- Match — Map the user's intent to the right API endpoint semantically.
- Construct — Build the HTTP request with proper method, path, params, headers, body, and auth.
- Execute — Call the API via Bash (curl) or WebFetch and capture the response.
- 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
- NEVER hardcode API keys, tokens, or secrets in requests, curl commands, or source files — always use environment variables (
$ENV_VAR) or a secrets manager. - ALWAYS discover the API spec (OpenAPI/Swagger) before writing any integration code — guessing endpoint shapes without spec evidence produces broken integrations.
- NEVER skip pagination handling when the API returns list responses — assuming single-page results silently drops data for any dataset above the page limit.
- 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.
- 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.jsonhttps://api.example.com/swagger.jsonhttps://api.example.com/v3/api-docshttps://api.example.com/.well-known/openapi.jsonhttps://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
Установить dynamic-api-integration в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditBashWebFetchWebSearchВложенные файлы
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 запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic