remotion-dev/remotion · error · Error

compositionName must be a string.

Error message

compositionName must be a string.

What it means

The Studio Web MCP selectComposition tool could not find a composition whose id equals the provided compositionName in the currently loaded compositions.

Source

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

					name: 'select_composition',
					title: 'Select Studio composition',
					description:
						'Open a registered composition in Remotion Studio by name.',
					inputSchema: {
						type: 'object',
						properties: {
							compositionName: {
								type: 'string',
								description: 'The name of the composition to open.',
							},
						},
						required: ['compositionName'],
						additionalProperties: false,
					},
					annotations: {readOnlyHint: false},
					execute: ({compositionName}) => {
						if (typeof compositionName !== 'string') {
							throw new Error('compositionName must be a string.');
						}

						const composition = compositionsRef.current.find(
							(candidate) => candidate.id === compositionName,
						);
						if (!composition) {
							throw new Error(`Composition ${compositionName} not found.`);
						}

						selectComposition(composition, true);
						return Promise.resolve({
							currentContent: {
								type: 'composition',
								compositionId: composition.id,
							},
						});
					},
				},

View on GitHub (pinned to b2f4e34732)

Solutions

  1. List available compositions first via the MCP listing tool and use an exact id
  2. Ensure the target composition exists in src/Root.tsx and Studio has reloaded
  3. Retry after compositions finish loading in Studio
Defensive patterns

Strategy: try-catch

Validate before calling

const ids = compositionsRef.current.map((c) => c.id);
if (!ids.includes(compositionName)) { /* list valid ids to the caller */ }

Try / catch

try { await tool.execute({compositionName}); } catch (e) { if (e.message.includes('not found')) { /* re-list compositions and retry */ } }

Prevention

When it happens

Trigger: Calling the MCP tool with an id that does not exist (typo, stale id after a composition was renamed/removed, or compositions not yet loaded).

Common situations: Renaming or deleting a composition while an MCP session holds the old id, or asking the model to select a composition before Studio finished registering compositions.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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