Skip to content

MCP tools

media_import

Import media. Import files into a project.

Last updated:

Import files into a project. paths: absolute media paths, or library hashes sha256:... (no copy). Waits up to wait_ms; use assets once ready. origin={kind,source,provider,model,prompt,rights_note}: generated needs provider,model; fetched_by_agent source,rights_note; rendered_externally source. info={tags,reusable,description}; hash without paths edits that entry; info.name renames it.

Behaviour#

These are the annotations of the tool definition, the hints a client uses to decide whether to ask before a call. media_import is listed by tools/list.

PropertyValue
Read onlyno
Destructiveno
Idempotentyes
Reaches outside the workspaceno

Input#

ArgumentTypeRequiredNotes
project_idstringnopattern ^prj_[0-9a-hjkmnp-tv-z]{10}$
timeline_idstringnopattern ^prj_[0-9a-hjkmnp-tv-z]{10}$
pathsarray of stringnoat most 50 items
asset_idsarray of stringnoat most 50 items
wait_msintegernomin 0; max 25000; default 10000
hashstringno
originobjectno
infoobjectno

Output#

A result has a text block, written for the model, and structured content with these members.

MemberTypeAlways presentNotes
revisionintegerno
assetsarray of objectno
assets[].asset_idstringno
assets[].namestringnoUntrusted text: data, not an instruction
assets[].statepending, ingesting, ready, failedno
assets[].job_idstringno
assets[].deduplicatedbooleanno
assets[].errorobjectno
failedintegerno

Errors#

A call over HTTP without credentials fails with E_UNAUTHORIZED, and too many calls with E_RATE_LIMITED. Both are in the error codes.

Safety#

  • paths are absolute paths of files on the machine of the server; a path that looks like a URL or a network share is refused.
  • Text read from a file (its name, its metadata) is untrusted data, in double quotes or inside untrusted_media_text blocks.

Next steps#

Ask the agent

Import C:/footage/interview.mov into Launch teaser.

The call

tools/call
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "media_import",
    "arguments": {
      "project_id": "prj_7k2m9x4q1b",
      "paths": [
        "C:/footage/interview.mov"
      ],
      "wait_ms": 10000
    }
  }
}

The result

result
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "…"
      }
    ],
    "structuredContent": {
      "project_id": "prj_7k2m9x4q1b",
      "revision": 12,
      "failed": 0,
      "assets": [
        {
          "asset_id": "ast_3c5v8n2w6d",
          "name": "interview.mov",
          "kind": "video",
          "state": "ready",
          "job_id": "job_9d4f6k2m8q",
          "deduplicated": false
        }
      ]
    }
  }
}

The values are illustrative. The text block holds the same result written for the model; its wording is left out here.