Skip to main content
Glama
dqhieu
by dqhieu

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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

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;
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves data ('Get'), implying a read-only operation, but doesn't specify if it requires authentication, has rate limits, returns real-time or historical data, or what format the output is in. The description lacks details on behavioral traits beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence that directly states the tool's purpose without unnecessary words. It's front-loaded and efficient, though it could be slightly more informative by clarifying terms like 'Compresto' and 'reduced' to improve clarity without sacrificing brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no parameters, no annotations, and no output schema, the description is minimally adequate but incomplete. It explains what the tool does at a high level but lacks details on output format, data scope, or behavioral context. For a simple retrieval tool, this might suffice, but it leaves gaps in understanding the tool's full behavior and usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description doesn't add parameter information, which is appropriate here. A baseline of 4 is applied since there are no parameters to describe, and the schema fully covers this aspect.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the action ('Get') and target ('total file size reduced of Compresto'), which is clear but vague. It doesn't specify what 'Compresto' is (e.g., a system, service, or dataset) or what 'reduced' means (e.g., compression, deduplication, or cleanup). It distinguishes from siblings by focusing on size reduction rather than processed files or users, but the purpose remains somewhat ambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus its siblings. The description doesn't mention context, prerequisites, or alternatives. While it implies usage for monitoring size reduction metrics, there's no explicit direction on when it's appropriate or how it relates to other tools like 'get-total-processed-files' or 'get-total-users'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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