Skip to main content
Glama

Calculate video bitrate and file size

calculate_bitrate
Read-onlyIdempotent

Calculates the file size of a video export from its duration and bitrate, or (when target_size_mb is given) the highest video bitrate that fits that size with a 2% safety margin. Without an explicit bitrate it uses the reference value for the platform, resolution and frame rate (YouTube and Vimeo recommendations, Apple ProRes target data rates, or Rast's delivery target for Instagram and TikTok, which publish none). Also returns size-limit warnings (Meta 4 GB, TikTok ads 500 MB / 516 kbps) and a two-pass ffmpeg command.

Input Schema

NameRequiredDescriptionDefault
fpsNoFrame rate, e.g. 24, 25, 29.97, 30, 50, 60. Default 30. 48 fps and above use the high-frame-rate tables.
platformNoDelivery target used for the reference bitrate: 'youtube', 'youtube_hdr', 'vimeo', 'instagram', 'tiktok', or a ProRes flavour ('prores_proxy', 'prores_lt', 'prores_422', 'prores_hq', 'prores_4444', 'prores_xq'). Default 'youtube'.
audio_kbpsNoAudio bitrate in kbps; 0 = no audio. Default 320.
resolutionNo'720p', '1080p' (also 1080x1920 vertical), '1440p', '2160p' (4K UHD) or 'dci4k' (4096x2160). Default '1080p'.
target_size_mbNoIf set, calculate the maximum video bitrate that fits this file size in megabytes (1 MB = 1,000,000 bytes) instead of the file size.
duration_secondsYesVideo length in seconds (e.g. 90 for 1:30).
video_bitrate_mbpsNoVideo bitrate in Mbps to calculate the file size with. Omit to use the platform reference value.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already cover the read-only, idempotent, closed-world safety profile, and the description goes well beyond them: the 2% safety margin on target-size calculations, the specific reference sources (YouTube/Vimeo recs, Apple ProRes data rates, Rast for Instagram/TikTok), and the extra outputs (size-limit warnings for Meta 4 GB and TikTok 500 MB/516 kbps, plus an ffmpeg two-pass command).

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?

Three sentences, front-loaded with the primary calculation and immediately followed by the inverse mode. Dense but every clause carries information the agent needs; no filler.

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

Completeness5/5

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

With no output schema, the description carries the return-value burden and does so: numeric result, size-limit warnings, and an ffmpeg command are all disclosed. For a 7-parameter calculation tool with full schema coverage, nothing needed for correct invocation is missing.

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%, so the 3 baseline is met by the schema alone. The description adds genuine value by explaining where the default bitrate comes from per platform/resolution/frame rate and by making the mutual exclusivity of target_size_mb and video_bitrate_mbps operationally clear, which the schema only implies.

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?

States a specific verb and resource and covers both directions of the calculation: file size from duration+bitrate, or max bitrate from target_size_mb. It also names the fallback source of the bitrate (platform/resolution/fps reference tables), so the agent knows exactly what the tool produces and what it derives it from.

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

Usage Guidelines4/5

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

Explicitly explains the mode switch: pass target_size_mb for the inverse calculation, omit video_bitrate_mbps to use the reference value. Sibling tools (check_text_position, validate_srt, etc.) are unrelated, so no alternative routing is required, but no explicit when-not guidance is given.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources