Skip to main content
Glama
PrismPoster Creator Tools MCP

PrismPoster Creator Tools MCP

Official
by PrismPoster

Calculate aspect ratio and crop/pad plan

calculate_aspect_ratio
Read-onlyIdempotent

Reduce any pixel size to its simplest aspect ratio, round dimensions up to even or codec-block multiples, and get centre-crop plus letterbox/pillarbox plans for a target ratio.

Instructions

Reduce any pixel size to its simplest aspect ratio (1920x1080 is 16:9), round it up to an even or codec-block multiple, and, given a target ratio, return the centre-crop and letterbox/pillarbox plans with the px removed or added per edge. Use this for arbitrary sizes and ratios (cinema 2.39:1, a client's 4:5); when the target is a named platform placement, use get_social_media_placement with sourceWidth/sourceHeight instead, which picks the right ratio for you. Errors on a non-integer or out-of-range size, or on only one of targetRatioW/targetRatioH.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "width": "<width>",
      "height": "<height>"
    },
    "name": "calculate_aspect_ratio"
  }
}

Input Schema

NameRequiredDescriptionDefault
widthYesFrame width in px.
heightYesFrame height in px.
blockSizeNoRound dimensions up to a multiple of this: 2 for H.264 4:2:0, 16 for macroblock-aligned. Default 2.
targetRatioHNoHeight term of the target ratio, e.g. 16 for 9:16. Requires targetRatioW.
targetRatioWNoWidth term of the ratio to crop or pad to, e.g. 9 for 9:16 or 2.39 for 2.39:1. Requires targetRatioH.

Output Schema

NameRequiredDescriptionDefault
inputYes
ratioYes
padPlanYes
cropPlanYes
blockSizeYes
targetRatioYes
alignedToBlockYes
formattedRatioYes
referenceToolUrlYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed18 schema fields changedv1.0.0
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / blockSize / default
      Added value: +2
    • changedInput schema / properties / blockSize / description
      Previous value: -"Optional codec block alignment (default 2)."New value: +"Round dimensions up to a multiple of this: 2 for H.264 4:2:0, 16 for macroblock-aligned. Default 2."
    • addedInput schema / properties / blockSize / minimum
      Added value: +1
    • changedInput schema / properties / blockSize / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / properties / height / description
      Previous value: -"Frame height in pixels."New value: +"Frame height in px."
    • addedInput schema / properties / height / maximum
      Added value: +100000
    • addedInput schema / properties / height / minimum
      Added value: +1
    • changedInput schema / properties / height / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / properties / targetRatioH / description
      Previous value: -"Optional target aspect ratio height term (e.g. 16)."New value: +"Height term of the target ratio, e.g. 16 for 9:16. Requires targetRatioW."
    • addedInput schema / properties / targetRatioH / exclusiveMinimum
      Added value: +0
    • changedInput schema / properties / targetRatioW / description
      Previous value: -"Optional target aspect ratio width term (e.g. 9)."New value: +"Width term of the ratio to crop or pad to, e.g. 9 for 9:16 or 2.39 for 2.39:1. Requires targetRatioH."
    • addedInput schema / properties / targetRatioW / exclusiveMinimum
      Added value: +0
    • changedInput schema / properties / width / description
      Previous value: -"Frame width in pixels."New value: +"Frame width in px."
    • addedInput schema / properties / width / maximum
      Added value: +100000
    • addedInput schema / properties / width / minimum
      Added value: +1
    • changedInput schema / properties / width / type
      Previous value: -"number"New value: +"integer"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "alignedToBlock": {
      +      "anyOf": [
      +        {
      +          "properties": {
      +            "height": {
      +              "type": "integer"
      +            },
      +            "width": {
      +              "type": "integer"
      +            }
      +          },
      +          "required": [
      +            "width",
      +            "height"
      +          ],
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "blockSize": {
      +      "type": "integer"
      +    },
      +    "cropPlan": {
      +      "anyOf": [
      +        {
      +          "properties": {
      +            "areaKept": {
      +              "type": "number"
      +            },
      +            "removed": {
      +              "properties": {
      +                "bottom": {
      +                  "type": "integer"
      +                },
      +                "left": {
      +                  "type": "integer"
      +                },
      +                "right": {
      +                  "type": "integer"
      +                },
      +                "top": {
      +                  "type": "integer"
      +                }
      +              },
      +              "required": [
      +                "top",
      +                "right",
      +                "bottom",
      +                "left"
      +              ],
      +              "type": "object"
      +            },
      +            "result": {
      +              "properties": {
      +                "height": {
      +                  "type": "integer"
      +                },
      +                "width": {
      +                  "type": "integer"
      +                }
      +              },
      +              "required": [
      +                "width",
      +                "height"
      +              ],
      +              "type": "object"
      +            }
      +          },
      +          "required": [
      +            "result",
      +            "removed",
      +            "areaKept"
      +          ],
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "formattedRatio": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "input": {
      +      "properties": {
      +        "height": {
      +          "type": "integer"
      +        },
      +        "width": {
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "width",
      +        "height"
      +      ],
      +      "type": "object"
      +    },
      +    "padPlan": {
      +      "anyOf": [
      +        {
      +          "properties": {
      +            "added": {
      +              "properties": {
      +                "bottom": {
      +                  "type": "integer"
      +                },
      +                "left": {
      +                  "type": "integer"
      +                },
      +                "right": {
      +                  "type": "integer"
      +                },
      +                "top": {
      +                  "type": "integer"
      +                }
      +              },
      +              "required": [
      +                "top",
      +                "right",
      +                "bottom",
      +                "left"
      +              ],
      +              "type": "object"
      +            },
      +            "imageFraction": {
      +              "type": "number"
      +            },
      +            "result": {
      +              "properties": {
      +                "height": {
      +                  "type": "integer"
      +                },
      +                "width": {
      +                  "type": "integer"
      +                }
      +              },
      +              "required": [
      +                "width",
      +                "height"
      +              ],
      +              "type": "object"
      +            }
      +          },
      +          "required": [
      +            "result",
      +            "added",
      +            "imageFraction"
      +          ],
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "ratio": {
      +      "anyOf": [
      +        {
      +          "properties": {
      +            "h": {
      +              "type": "number"
      +            },
      +            "w": {
      +              "type": "number"
      +            }
      +          },
      +          "required": [
      +            "w",
      +            "h"
      +          ],
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "referenceToolUrl": {
      +      "type": "string"
      +    },
      +    "targetRatio": {
      +      "anyOf": [
      +        {
      +          "properties": {
      +            "h": {
      +              "type": "number"
      +            },
      +            "w": {
      +              "type": "number"
      +            }
      +          },
      +          "required": [
      +            "w",
      +            "h"
      +          ],
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    }
      +  },
      +  "required": [
      +    "input",
      +    "ratio",
      +    "formattedRatio",
      +    "blockSize",
      +    "alignedToBlock",
      +    "targetRatio",
      +    "cropPlan",
      +    "padPlan",
      +    "referenceToolUrl"
      +  ],
      +  "type": "object"
      +}
  2. First observedv0.3.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world, so the safety profile is covered. The description adds real context beyond that: what is returned (crop plan plus letterbox/pillarbox with px removed or added per edge) and what triggers errors (non-integer/out-of-range size, or only one of targetRatioW/targetRatioH).

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?

Front-loaded with the primary operation and only three sentences total; the usage/alternative routing is placed after the capability statement. The first sentence is dense with chained clauses but every clause carries information the agent needs.

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?

Output schema exists, so return structure needn't be spelled out, yet the description still summarizes what comes back (crop and letterbox plans, px per edge). Combined with the error conditions and sibling routing, nothing needed to invoke it correctly 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 baseline is 3, and the description adds meaning on top: the blockSize concept is framed as 'even or codec-block multiple' tied to the ratio workflow, and it clarifies that the ratio pair must be supplied together. It still doesn't explain what units or defaults apply to the returned plan values.

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 specific operations (simplify to aspect ratio, round to block multiple, compute centre-crop/letterbox plans) on a specific resource (pixel dimensions). It explicitly contrasts itself with the sibling get_social_media_placement, so an agent can pick between them without opening either schema.

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

Usage Guidelines5/5

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

Gives an explicit use case (arbitrary sizes and ratios like 2.39:1 or 4:5) and an explicit alternative plus condition (named platform placement → get_social_media_placement with sourceWidth/sourceHeight). It also names the failure conditions, which further bounds correct usage.

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