Skip to main content
Glama
luis0794

Violett MCP Server

by luis0794

fetch_url

Retrieve content from any URL using an HTTP GET request. Ideal for extracting data or integrating web resources into workflows.

Instructions

Fetch content from a URL via HTTP GET request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to fetch

Implementation Reference

  • The handler for the fetch_url tool. It performs an HTTP GET request to the specified URL, captures the response status, headers, and body, and returns formatted text content. Handles errors by returning an error message.
    case "fetch_url": { const url = request.params.arguments?.url as string; if (!url) { throw new Error("URL is required"); } try { const response = await fetch(url); const content = await response.text(); const headers = Object.fromEntries(response.headers.entries()); return { content: [ { type: "text", text: `HTTP ${response.status} ${response.statusText}\n\nHeaders:\n${JSON.stringify(headers, null, 2)}\n\nBody:\n${content}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error fetching URL: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } }
  • Tool registration in ListToolsRequestHandler, defining the name, description, and input schema requiring a 'url' string.
    { name: "fetch_url", description: "Fetch content from a URL via HTTP GET request", inputSchema: { type: "object", properties: { url: { type: "string", description: "URL to fetch", }, }, required: ["url"], }, },
  • Input schema for fetch_url tool, specifying an object with a required 'url' string property.
    inputSchema: { type: "object", properties: { url: { type: "string", description: "URL to fetch", }, }, required: ["url"], },

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/luis0794/violett-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server