Skip to main content
Glama
paladini

devutils-mcp-server

byte_convert

Convert byte units between B, KB, MB, GB, TB, and PB using binary (1024) or SI (1000) standards for data size calculations.

Instructions

Convert between byte units (B, KB, MB, GB, TB, PB). Supports both binary (1024) and SI (1000) standards.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
valueYesThe numeric value to convert
from_unitYesSource unit
binaryNoUse binary (1024) instead of SI (1000) standard (default: true)

Implementation Reference

  • The "byte_convert" tool is defined and implemented directly using `server.tool` inside `registerConverterTools`. The implementation calculates the base (1024 vs 1000), normalizes the input value to bytes, and converts it to all other units.
    server.tool(
      "byte_convert",
      "Convert between byte units (B, KB, MB, GB, TB, PB). Supports both binary (1024) and SI (1000) standards.",
      {
        value: z.number().describe("The numeric value to convert"),
        from_unit: z
          .enum(["B", "KB", "MB", "GB", "TB", "PB"])
          .describe("Source unit"),
        binary: z
          .boolean()
          .default(true)
          .describe("Use binary (1024) instead of SI (1000) standard (default: true)"),
      },
      async ({ value, from_unit, binary }) => {
        const base = binary ? 1024 : 1000;
        const units = ["B", "KB", "MB", "GB", "TB", "PB"];
        const fromIndex = units.indexOf(from_unit);
        const bytes = value * Math.pow(base, fromIndex);
    
        const result: Record<string, string> = {
          standard: binary ? "Binary (1024)" : "SI (1000)",
        };
    
        for (let i = 0; i < units.length; i++) {
          const converted = bytes / Math.pow(base, i);
          result[units[i]] =
            converted >= 1
              ? converted.toLocaleString("en-US", { maximumFractionDigits: 4 })
              : converted.toExponential(4);
        }
    
        return {
          content: [
            { type: "text" as const, text: JSON.stringify(result, null, 2) },
          ],
        };
      }
    );
Behavior3/5

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

Discloses the critical behavioral trait of calculation method (binary 1024 vs SI 1000 standards). However, with no annotations and no output schema, it fails to specify the output format—crucially omitting what target unit(s) the function returns (e.g., all units, just bytes, or a specific target).

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

Conciseness5/5

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

Two compact sentences with zero waste. Front-loaded with the core purpose, followed immediately by the standards clarification. No filler words or redundant explanations.

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?

Appropriate for a simple 3-parameter utility with full schema coverage, but the missing output specification (target unit ambiguity) leaves a functional gap given the lack of output schema. Adequate but not comprehensive.

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?

Schema coverage is 100%, establishing baseline 3. The description adds valuable semantic context by defining what 'binary' means (1024) versus SI (1000), and implicitly clarifying the enum values are unit prefixes,adding meaning beyond the schema's technical field names.

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

Purpose5/5

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

Specific verb 'Convert' + clear resource 'byte units'. Lists exact supported units (B through PB) and distinguishes from sibling converters like color_convert and number_base_convert by specifying the byte domain.

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

Usage Guidelines3/5

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

Provides clear context that this is for byte unit conversion specifically, distinguishing it from other conversion siblings. However, lacks explicit guidance on when to prefer binary vs SI standards, or when to use alternatives like raw calculation.

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

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/paladini/devutils-mcp-server'

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