Skip to main content
Glama

importMedia

Adds a video or audio file from disk to an OpenScreen project's media library without placing it on the timeline, returning the asset ID and duration.

Instructions

Add a video or audio file from disk to the project's media, as the editor's Import does. It does not place it on the timeline. An audio file is then played by a track you lay with addAudio. A video becomes the project's footage when it has none yet (a project createProject made without a video): replaceTimeline then lays it out. Returns the new assetId and the file's durationSec, null when OpenScreen could not read it (the editor reads it again when it opens the project).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindNoWhat the file is. Default: audio for an audio-only extension, video otherwise, so pass audio for a .webm that holds only sound.
pathYesAbsolute path of the file. Video: .mp4, .mov, .m4v, .webm, .mkv, .avi, .wmv. Audio: .mp3, .wav, .m4a, .aac, .flac, .ogg, .oga, .opus, .webm.
labelNoIts name in the project's media. Default: the file name.
projectIdNoThe project to act on, from listProjects. Omit it only for the project open in the OpenScreen editor, which works only while the app runs.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.1

TDQS

A4.3/5.0
Behavior4/5

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

Annotations only state it is a non-destructive, non-open-world write; the description adds the real side effects an agent needs — media is added to the project but not the timeline, and the asset may silently become the project's footage. It also discloses the failure mode (durationSec null when OpenScreen could not read the file). It stops short of covering deduplication or re-import behavior.

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-loads the core action and the key non-behavior ('does not place it on the timeline') in the first two sentences. The third is dense with three chained conditions, but each clause carries genuine routing information rather than filler.

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

Completeness4/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 correctly supplies return values (assetId, durationSec, and the null case), and the schema covers all four parameters. The only gap is guidance on importing the same file twice or replacing existing media, which would matter for a media-mutating tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, including the kind enum default and the extension lists for path, so the schema already carries parameter meaning. The description adds no syntax, format, or defaulting detail beyond that, making the baseline 3 appropriate.

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 ('Add a video or audio file from disk to the project's media') and immediately bounds the scope with 'It does not place it on the timeline', which separates it from timeline-manipulating siblings like insertClip and replaceTimeline.

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?

Explicitly routes the agent: audio is played later via addAudio, and video only becomes project footage if createProject made one without a video, after which replaceTimeline lays it out. It names the downstream alternatives and the conditions that select them rather than leaving sequencing to inference.

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