Use Agent Data Tools with the Vercel AI SDK
The npm package agent-data-tools turns any of the tools on this service into AI SDK tools. Name the few tools a task needs; the model calls them and gets each tool's JSON answer.
Install
npm install ai agent-data-toolsGive tools to a model
import { generateText, isStepCount } from 'ai';
import { agentDataTools } from 'agent-data-tools/ai-sdk';
const { text } = await generateText({
model: 'anthropic/claude-haiku-5.5',
tools: await agentDataTools(['pdf_text', 'extract', 'weather']),
stopWhen: isStepCount(5),
prompt: 'Read https://bitcoin.org/bitcoin.pdf and tell me in three sentences what problem it solves.',
});
console.log(text);agentDataTools(names, options) reads each tool's description and input schema from https://glyphtools.com/openapi.json. Names are the tool names (pdf_text, weather, price_token) or paths (/pdf/text). The full list with prices is at https://glyphtools.com/tools.
Paying
Without any setup the first successful calls are free on tools that only compute or look up public data (not AI, speech, transcription, images, rendering, search or resold data). After that, and on every other tool, a call that is not paid returns its price and a link to the model as the tool result, so a generation does not fail.
Prepaid key, by card from $1 at https://glyphtools.com/credits:
const tools = await agentDataTools(['pdf_text'], { apiKey: process.env.ADT_API_KEY });USDC per call from your own wallet over x402, with no account:
import { wrapFetchWithPayment, x402Client } from '@x402/fetch';
import { registerExactEvmScheme } from '@x402/evm/exact/client';
import { privateKeyToAccount } from 'viem/accounts';
const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.WALLET_KEY) });
const tools = await agentDataTools(['pdf_text'], { fetch: wrapFetchWithPayment(fetch, client) });Failed calls are never charged. Most tools cost $0.01 a call or less.
The same tools in an MCP client, paid from a wallet
For Claude Desktop, Cursor, Cline and other MCP clients the package is also a local MCP server. Set AGENT_DATA_TOOLS_WALLET_KEY to the private key of a wallet that holds USDC on Base and each call is paid from it:
{
"mcpServers": {
"agent-data-tools": {
"command": "npx",
"args": ["-y", "agent-data-tools", "mcp"],
"env": { "AGENT_DATA_TOOLS_WALLET_KEY": "0x..." }
}
}
}It pays at most $0.10 a call and $1 a day unless AGENT_DATA_TOOLS_MAX_USD and AGENT_DATA_TOOLS_DAILY_USD say otherwise. The key is read from the environment only, signs nothing but the exact USDC amount the service quoted, and is never written or sent. Use a wallet that holds only what you are willing to spend. Without the variable the server uses the free calls or a prepaid key (AGENT_DATA_TOOLS_KEY).
Package: https://www.npmjs.com/package/agent-data-tools
Agent Data Tools · All tools and prices · Guides · Card credits