LEAP
LEAP builds skills through two pipelines: Branch A distills a skill from raw data, while Branch B combines multiple skills into one. It is called by the main…
Decision protocol for wrapping a REST / GraphQL / RPC API as a tool an LLM agent can call. The load-bearing premise: the *tool surface* is an LM-friendly subset of the *API surface* — one tool per user intent, not one per endpoint. Activates when a coder agent must expose an
$ npx -y skills add agentsope/SkillAlchemy --skill agentsop-http-tool-wrapping --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/agentsop-http-tool-wrappingContext preview
The summary Claude sees to decide when to auto-load this skill.
Decision protocol for wrapping a REST / GraphQL / RPC API as a tool an LLM agent can call. The load-bearing premise: the *tool surface* is an LM-friendly subset of the *API surface* — one tool per user intent, not one per endpoint. Activates when a coder agent must expose an
name: agentsop-http-tool-wrapping version: 0.1.0 description: | Decision protocol for wrapping a REST / GraphQL / RPC API as a tool an LLM agent can call. The load-bearing premise: the *tool surface* is an LM-friendly subset of the *API surface* — one tool per user intent, not one per endpoint. Activates when a coder agent must expose an external HTTP API to a model (function calling, tool_use, MCP, LangChain `@tool`, CrewAI `BaseTool`). Encodes the *what to surface, how to name, how to shape, how to fail* — not any single framework's API. ~80% of agent tools in production are HTTP wrappers; this is the SOP for getting them right. domain: coder-agent / tool-construction audience: engineers wiring external APIs into LLM agents trigger_keywords: - "wrap an API as a tool" - "expose REST endpoint to agent" - "function calling for my API" - "MCP server for existing API" - "tool returns too much JSON" - "agent rate limited / 429" - "GraphQL / RPC as agent tool" when_to_use: - "exposing a third-party or internal HTTP API to an LLM agent" - "deciding which of N endpoints deserve to become tools" - "an existing tool dumps raw JSON and the model hallucinates fields" - "tool calls fail on rate limits, timeouts, or pagination" - "porting the same tool across OpenAI / Anthropic / MCP / LangChain / CrewAI" when_not_to_use: - "the API is already an MCP server you only consume (just connect)" - "no external I/O — pure local computation (write a plain function tool)" - "designing the upstream API itself (that's API design, not tool wrapping)"
> Source posture: every non-trivial claim is cited inline with short tags like > `[oai/fc]`, `[anthropic/tooluse]`, `[lc/tools]`, `[mcp/spec]`, `[apxml/schema]`. > Resolve them against `references/R1-source-evidence.md` for full URLs. Reusable > code shapes live in `references/R2-pattern-library.md`.
---
Activate when a coder agent must make an **external HTTP API callable by an LLM**. Concrete triggers:
<service>", "wrap our REST/GraphQL/RPC endpoint as a function the model can use".
names, or burns context re-reading it.
`tool_use`, an MCP server, LangChain `@tool`, and CrewAI `BaseTool`.
**Do not activate** when: the API is already exposed as an MCP server you merely consume (just connect it); the "tool" is pure local computation with no network I/O (write a plain typed function); or you are designing the upstream API itself.
This is a **tool-construction** skill — sibling to the framework SOPs (`langgraph-sop`, `crewai-sop`) which decide *whether/where* tools run. Once you know you need a tool, this skill decides *what shape it takes*.
---
**The tool surface is an LM-friendly subset of the API surface. One tool per intent, not one per endpoint.**
A REST API is designed for *programmers* who read docs, hold a mental model of resources, and compose calls. An agent tool is designed for a *language model* that sees only a name, a description, and a JSON schema — and must decide, mid-reasoning, whether this is the thing to call. These are different audiences, so the surface must be *re-cut*, not *mirrored*.
> "Tool descriptions are often more important than code comments because the LLM > directly uses them for reasoning." `[apxml/schema]`
Four load-bearing consequences:
1. **Intent, not CRUD.** The unit of a tool is a *thing the agent wants to accomplish* (`cancel_order`, `find_customer_by_email`), not an HTTP verb on a resource (`DELETE /orders/{id}`). One intent may compose several endpoints; one endpoint may serve zero intents (admin/batch/webhook-out endpoints get dropped). Surface intent, not the verb table `[zuplo/agent-ready]`.
2. **The schema is the prompt.** The model never sees your code. It sees the tool name, the description, and each field's `description=`. Every field needs units, format, enum values, and an example *aimed at the model* — "if a field is a date, specify ISO 8601 vs Unix timestamp" `[apxml/schema]`. A typed schema (Pydantic / JSON Schema) is non-negotiable because it is *both* the validation layer and the documentation the model reads `[lc/tools]`.
3. **The response is context, and context is scarce.** A 10 MB JSON payload is not "data the agent has" — it is tokens the agent must pay for, re-read, and can misquote. Shape the response down to the fields the agent needs to *reason or act* on. Returning raw upstream JSON is the second most common anti-pattern after 1:1 mapping.
4. **The model cannot promise call discipline.** It may emit zero, one, or several calls — "best practice [is] to assume there are several" `[oai/fc]` — retry on its own, or be resumed by the framework. So the *wrapper* owns reliability (timeout, retry, rate-limit) and *safety* (idempotency on mutations). You cannot prompt these guarantees into existence; you build them into the tool. (Side-effect safety is deep enough to be its own skill — cross-link **`llm-tool-idempotency`** for any mutating tool.)
The pre-LLM analog: you are writing an **SDK for a non-deterministic, amnesiac junior dev who reads only the function signature** — generous docstrings, narrow typed inputs, small clean returns, and total robustness to being called wrong.
---
Walk top-down. Each step has a gate — if it fails, fix it before adding surface.
List every endpoint × verb. For each, ask
Turn people, methods, and experience into installable, reusable agent skills. SkillAlchemy is an open-world agent skill creation system that turns underspecified skill briefs and open-world sources into installable, reusable agent skills.
LEAP builds skills through two pipelines: Branch A distills a skill from raw data, while Branch B combines multiple skills into one. It is called by the main…
Lens — Add a cognitive lens to any problem. It accepts a task description and produces an enhanced description that surfaces hidden dimensions, prerequisites,…
Cross-framework enhancement overlay for choosing a multi-agent topology BEFORE writing any agent. A binary-question rubric — is single-agent + tools enough? do…
SOP for terminal-based, git-native AI pair programming with Aider (git work-tree + tree-sitter repo-map + edit-format + human-in-loop REPL). Use when editing…
Screens biomedical / life-science papers for signs of data fabrication, image manipulation, and statistical anomalies, using the detection techniques distilled…
Universal discipline for any LM-driven loop — agent retries, plan-act-observe, multi-agent handoffs, optimiser passes, test-fix cycles. Encodes the one rule…