remotion-dev/remotion · error · Error

orientation must be either "horizontal" or "vertical".

Error message

orientation must be either "horizontal" or "vertical".

What it means

The add-guide MCP tool only accepts orientation of "horizontal" or "vertical". Any other string or type is rejected at runtime.

Source

Thrown at packages/studio/src/components/WebMcp.tsx:1403

						properties: {
							orientation: {
								type: 'string',
								enum: ['horizontal', 'vertical'],
								description: 'The orientation of the guide.',
							},
							position: {
								type: 'number',
								description:
									'The guide position in composition pixels. Vertical guides use an x-coordinate and horizontal guides use a y-coordinate.',
							},
						},
						required: ['orientation', 'position'],
						additionalProperties: false,
					},
					annotations: {readOnlyHint: false},
					execute: ({orientation, position}) => {
						if (orientation !== 'horizontal' && orientation !== 'vertical') {
							throw new Error(
								'orientation must be either "horizontal" or "vertical".',
							);
						}

						if (typeof position !== 'number' || !Number.isFinite(position)) {
							throw new Error('position must be a finite number.');
						}

						const compositionId = currentCompositionRef.current;
						if (compositionId === null) {
							throw new Error('No composition is currently selected.');
						}

						const guide: Guide = {
							id: crypto.randomUUID(),
							orientation,
							position,
							show: true,

View on GitHub (pinned to b2f4e34732)

Solutions

  1. Pass exactly "horizontal" or "vertical" (lowercase)

Example fix

// before
{"orientation": "h", "position": 100}
// after
{"orientation": "horizontal", "position": 100}
Defensive patterns

Strategy: validation

Validate before calling

const orientations = ['horizontal', 'vertical'] as const;
if (!orientations.includes(orientation)) throw new Error('bad orientation');

Type guard

const isOrientation = (v: unknown): v is 'horizontal' | 'vertical' => v === 'horizontal' || v === 'vertical';

Prevention

When it happens

Trigger: Calling the add-guide tool with orientation like "h", "Horizontal", or a non-string value.

Common situations: MCP clients abbreviating or capitalizing the orientation value.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of remotion-dev/remotion@b2f4e34732 (2026-08-28). Data as JSON: /api/errors/933160e3bc7486e5. Report an issue: GitHub.