Skip to main content
Glama

get-total-size-reduced

Calculate the total file size reduction achieved by Compresto’s compression app, providing insights into data optimization and storage efficiency.

Instructions

Get total file size reduced of Compresto

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": {}, "type": "object" }

Implementation Reference

  • Handler function that fetches landing page data from Supabase API and returns the totalReducedSize as formatted text content, handling errors by returning an error message.
    async () => { const url = `${API_BASE}/v1/getLandingPageData`; const response = await makeSupabaseRequest<LandingPageDataResponse>(url); if (!response) { return { content: [ { type: "text", text: "Failed to fetch user data" } ], isError: true }; } return { content: [ { type: "text", text: `Reduced ${response.data.totalReducedSize} bytes` } ] }; },
  • src/index.ts:109-138 (registration)
    Registration of the 'get-total-size-reduced' tool using McpServer.tool, with description, empty input schema, and inline async handler.
    server.tool( "get-total-size-reduced", "Get total file size reduced of Compresto", {}, async () => { const url = `${API_BASE}/v1/getLandingPageData`; const response = await makeSupabaseRequest<LandingPageDataResponse>(url); if (!response) { return { content: [ { type: "text", text: "Failed to fetch user data" } ], isError: true }; } return { content: [ { type: "text", text: `Reduced ${response.data.totalReducedSize} bytes` } ] }; }, );
  • Shared helper function for making API requests to Supabase functions with error handling and JSON parsing, used by the tool handler.
    async function makeSupabaseRequest<T>(url: string): Promise<T | null> { const headers = { "User-Agent": USER_AGENT, Accept: "application/json", }; try { const response = await fetch(url, { headers }); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } return (await response.json()) as T; } catch (error) { console.error("Error making Supabase request:", error); return null; } }
  • Type definition for the API response structure, including the totalReducedSize field consumed by the tool.
    interface LandingPageDataResponse { data: { totalUsers: number; totalCompressedVideos: number; totalReducedSize: number; monthlyUsers: number; } }

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/dqhieu/compresto-mcp'

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