Skip to main content
Glama
luis0794

Violett MCP Server

by luis0794

post_data

Send HTTP POST requests with data payloads to specified URLs for API integration and data transmission.

Instructions

Send data via HTTP POST request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to send POST request to
dataYesData to send in POST body

Implementation Reference

  • Handler function for the 'post_data' tool that performs an HTTP POST request with the provided data to the specified URL, returns response status, headers, and body, or error details if failed.
    case "post_data": { const url = request.params.arguments?.url as string; const data = request.params.arguments?.data; if (!url || !data) { throw new Error("URL and data are required"); } try { const response = await fetch(url, { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify(data), }); const responseText = 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\nResponse:\n${responseText}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error posting data: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } }
  • Schema definition for the 'post_data' tool including name, description, and input schema requiring 'url' (string) and 'data' (object).
    { name: "post_data", description: "Send data via HTTP POST request", inputSchema: { type: "object", properties: { url: { type: "string", description: "URL to send POST request to", }, data: { type: "object", description: "Data to send in POST body", }, }, required: ["url", "data"], }, },
  • Registration of available tools list including 'post_data' in the ListToolsRequestHandler.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ { 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"], }, }, { name: "post_data", description: "Send data via HTTP POST request", inputSchema: { type: "object", properties: { url: { type: "string", description: "URL to send POST request to", }, data: { type: "object", description: "Data to send in POST body", }, }, required: ["url", "data"], }, }, ], }; });

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