web_extract_text
Extract clean, readable text from web pages. Converts webpage content into plain text format for analysis or processing.
Instructions
Extract clean, readable text from any web page URL. Costs $0.01 USDC per request via x402 on Base.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to extract text from (e.g., https://example.com) |
Implementation Reference
- src/index.ts:279-282 (handler)The handler function for web_extract_text that calls the external API.
async ({ url }) => { const data = await apiPost(`${WEB_EXTRACT_API}/api/v1/extract/text`, { url }); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } - src/index.ts:268-283 (registration)Registration of the web_extract_text tool with the MCP server.
server.registerTool( "web_extract_text", { title: "Extract Text from URL", description: `Extract clean, readable text from any web page URL. Costs $0.01 USDC per request via x402 on Base.`, inputSchema: { url: z.string().url().describe("URL to extract text from (e.g., https://example.com)"), }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true }, }, async ({ url }) => { const data = await apiPost(`${WEB_EXTRACT_API}/api/v1/extract/text`, { url }); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } ); - src/index.ts:274-276 (schema)The input schema for web_extract_text requiring a URL.
inputSchema: { url: z.string().url().describe("URL to extract text from (e.g., https://example.com)"), },