Skip to main content
Glama
luis0794

Violett MCP Server

by luis0794

fetch_url

Retrieve content from any web URL using HTTP GET requests to access online data and resources.

Instructions

Fetch content from a URL via HTTP GET request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to fetch

Implementation Reference

  • The handler function for the 'fetch_url' tool. It extracts the URL from arguments, performs an HTTP GET request using the fetch API, retrieves the response status, headers, and body content, and returns it formatted as 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, }; } }
  • Registration of the 'fetch_url' tool in the ListTools response. Includes the tool name, description, and input schema defining a required 'url' string property.
    { 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"], }, },
  • The input schema for the 'fetch_url' tool, specifying an object with a single required 'url' property of type string.
    inputSchema: { type: "object", properties: { url: { type: "string", description: "URL to fetch", }, }, required: ["url"], },

Other 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