Installation
Install the integration package and configure your API key.
bun add @quercle/ai-sdkAvailable tools
All five Quercle endpoints are exposed as tools through this integration.
| Tool | Endpoint | Description |
|---|---|---|
quercleFetch | Fetch | Fetch a URL and return an AI-synthesized answer based on page content and your prompt. |
quercleSearch | Search | Search the web and return an AI-synthesized answer from the retrieved results. |
quercleRawFetch | Raw Fetch | Fetch a URL and return raw markdown or HTML. |
quercleRawSearch | Raw Search | Run web search and return raw results. |
quercleExtract | Extract | Fetch a URL and return chunks relevant to a query. |
Endpoint examples
Use the same endpoint methods directly through this integration.
import { createQuercleTools } from "@quercle/ai-sdk";
const { quercleFetch } = createQuercleTools({ apiKey: "qk_your_api_key" });
const result = await quercleFetch.execute({ url: "https://example.com", prompt: "Summarize the main points" });
console.log(result);Use in agents
Wire the integration into your agent orchestration loop.
import { quercleFetch, quercleSearch, quercleRawFetch, quercleRawSearch, quercleExtract } from "@quercle/ai-sdk";
import { generateText } from "ai";
import { openai } from "@ai-sdk/openai";
const { text } = await generateText({
model: openai("gpt-4o"),
tools: { quercleFetch, quercleSearch, quercleRawFetch, quercleRawSearch, quercleExtract },
maxSteps: 5,
prompt: "Research MCP security pitfalls and summarize mitigation techniques.",
});
console.log(text);