Docs · How it works
How it works
Search by the job, read one endpoint, call it: the loop every agent runs, and why Kitepod exposes a handful of tools instead of one per endpoint.
This page as MarkdownKitepod sits between your agent and 4 providers' APIs (DataForSEO, Apify, Context.dev, Firecrawl). The catalog lists 31 endpoints, each with its parameters, a real example response and a price taken from the provider's own pricing page.
The loop
- Search by the job.
catalog_search {"query": "scrape a web page by url"}. Describe the task, not a vendor. The answer lists endpoint ids with name, provider, price and whether Kitepod can run it on its own key. - Read one endpoint.
catalog_get {"id": "firecrawl.web.scrape"}. Its parameters (path, query and body, required ones marked), the price with its source, and an example response. Reading costs nothing. - Call it.
call {"id": "firecrawl.web.scrape", "input": {…}}. Kitepod checks the parameters, holds the price, sends the request with the provider's key, and returns the provider's answer withcost_usdandcall_id.
Search ranks by how well the words match, then by whether Kitepod can call the endpoint on its own key, then by measured success rate, then by price. For "scrape a web page by url" the catalog has 2 endpoints that do the same job: contextdev.web.scrape ($0.0009 / page), firecrawl.web.scrape ($0.00099 / page). When nothing matches every word, the answer has near_misses and a hint to ask for the missing endpoint with catalog_request.
What a call does
- Identify the team from the token.
- Resolve the id: the team's own tool by that name first, then the catalog endpoint.
- Check parameters against the catalog. A missing or mistyped one is refused with
400 catalog_parameter_invalidbefore anything is held or sent. - Pick the key. The team's own key for that provider if it has connected one (unmetered), else Kitepod's key (metered).
- Hold the estimated cost on the team's balance. Not enough balance answers
402 insufficient_balanceand nothing is sent. - Relay the request to the provider with the key added; Kitepod's own headers, cookies and the caller's Authorization are removed. Redirects are not followed.
- Settle the hold to the real cost of the answer and return the rest to the balance. A provider failure releases the hold in full. The call is written to Activity.
Details: Billing, Your own keys, REST reference.
Why a few tools and not one per endpoint
An MCP client puts every tool's name, description and input schema into the model's context on every turn. One tool per endpoint would cost context in proportion to the catalog, and the agent would have to choose among hundreds of similar tools. Kitepod's server exposes 8 tools whatever the catalog's size: search and read are how the agent finds what it needs, and call runs any endpoint by id. Adding endpoints to the catalog costs your agent nothing until it searches for them.
What the agent gets back
Over MCP, every call answer is one JSON object: the provider's status and result plus Kitepod's call_id, outcome and cost. Over REST, the body is the provider's, unchanged, and Kitepod's facts are in X-Kitepod-* headers.
{
"call_id": "call_8b0f3c6a2d4e4f1a9c7b5e3d1f0a2b4c",
"endpoint": "firecrawl.web.scrape",
"status": 200,
"outcome": "hit",
"cost_usd": "0.00099",
"cost_micro": 990,
"result": {
"success": true,
"data": {
"markdown": "Launch Week I is here! [See our Day 2 Release 🚀](https://www.firecrawl.dev/blog/launch-we…",
"html": "<!DOCTYPE html><html lang=\"en\" class=\"light\" style=\"color-scheme: light;\"><body class=\"__v…",
"metadata": {
"title": "Home - Firecrawl",
"description": "Firecrawl crawls and converts any website into clean markdown.",
"language": "en",
"keywords": "Firecrawl,Markdown,Data,Mendable,Langchain",
"robots": "follow, index",
"ogTitle": "Firecrawl",
"ogDescription": "The API to search, scrape, and interact with the web at scale.",
"ogUrl": "https://www.firecrawl.dev/"
}
}
}
}The result above is Firecrawl's real example response for this endpoint, shortened.