Extract Text from URL
web_extract_textExtract 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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"url": "<url>"
},
"name": "web_extract_text"
}
}Input 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)"), },