web_extract_translate
Extract text from any webpage URL and translate it to your target language using USDC micropayments on Base.
Instructions
Extract text from a URL and translate it to any language. Costs $0.10 USDC per request via x402 on Base.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to extract and translate | |
| language | Yes | Target language (e.g., Spanish, French, Hindi, Japanese) |
Implementation Reference
- src/index.ts:417-421 (handler)The handler function for web_extract_translate which calls the external translation API.
async ({ url, language }) => { const data = await apiPost(`${WEB_EXTRACT_API}/api/v1/extract/translate`, { url, language }); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } ); - src/index.ts:405-416 (registration)Registration of the web_extract_translate tool with its schema.
server.registerTool( "web_extract_translate", { title: "Extract and Translate", description: `Extract text from a URL and translate it to any language. Costs $0.10 USDC per request via x402 on Base.`, inputSchema: { url: z.string().url().describe("URL to extract and translate"), language: z.string().min(2).max(30).describe("Target language (e.g., Spanish, French, Hindi, Japanese)"), }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true }, },