Skip to main content
Glama

Import script file

import_script
Destructive

Import a Final Draft (.fdx) file, a WriterDuet (.json) file, or Fountain / screenplay-formatted plain text (a pasted script) into the project's script. Pass the full text as content, or the textId extract_file_text returned for a PDF or page images. The format is detected from the content; pass format only to force it ("fountain" forces the plain-text importer). Plain text counts as a screenplay when it has INT./EXT. scene headings or uppercase character cues with dialogue below them. Numbered headings (1. INT., 12 INT. ... 12), SC. n / SCÈNE n / SAHNE n markers and INTERIOR / INTÉRIEUR spelled out are read as scene headings.

A script that already has writing (beyond its title block) is never added to silently: a real call with insertPosition "end" or "start" then needs confirmAppend: true, and the preview's placement.existingScript says what is there. Ask the user first whether the file goes into a new project of its own (create_project, then import there), is added to this script, or replaces it. In the user's copy of the example project (existingScript.exampleProject), recommend a new project.

Call it with dryRun: true first. Nothing is written. The preview lists the scenes, element counts, where the content goes (and whether a Final Draft title page is kept), and for each character and place name in the file the entity it links to or "create", with near-miss candidates (a similar existing name, for example TOBY and TOBIAS). When the preview has near misses, show the user those links and ask; names to create need no question (say in your reply which story elements the import created). Then import for real with entityMap, mapping each confirmed name to its entityId (from the preview or list_entities). Names left out of entityMap are linked by name or created. The preview's warnings flag a file that looks misread: no scene heading in a long file, one scene holding hundreds of elements, or an abnormal number of characters (headings or action taken for cues). Relay every warning to the user before they confirm and never report such an import as a success.

entityMap keys are names as the file writes them; a cue extension is ignored ("MARA (O.S.)" is the key "MARA"). Only characters and places can be mapped. A mapped cue line takes the entity's name and keeps its extension, and a mapped scene heading takes the place's name.

The file is parsed by the app's own importers: scene headings, action, characters, dialogue, parentheticals, transitions and structure keep their types. CHARACTER lines and scene headings are linked to the project's characters and places by name ("MARA (O.S.)" and "MARA (CONT'D)" link to MARA and keep "(O.S.)" / "(CONT'D)" on the cue line), and missing ones are created as story elements (returned in createdEntities). The pre-import script is saved to version History so the user can undo it.

insertPosition: "end" (default) appends after the current script; "start" puts the file first, after the script's title block (its first EPISODE and the OUTLINE lines under it); "replace" replaces the whole script and requires confirmReplace: true on the real call (a dryRun does not), so ask the user before replacing their writing. A Final Draft or Fountain title page becomes the script's title block only on a replace or an empty script; otherwise it is left out.

A PDF, a scan or photos of pages: call extract_file_text first, then import its text here with textId. Never retype a long script with edit_script. For text that is not screenplay-formatted (notes, prose, a treatment), this tool refuses it: ask the user whether to turn it into a script before writing it with edit_script, one element per scene heading, action paragraph, character cue, parenthetical and dialogue line. A Word (.docx), OpenDocument (.odt) or EPUB file is read as text, and a Word screenplay with screenplay paragraph styles or INT./EXT. headings imports directly.

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": {
      "projectId": "<projectId>"
    },
    "name": "import_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
dryRunNoPreview only: parse and plan, write nothing, and return the links the import would make.
formatNoForce the importer. Detected from content when omitted.
textIdNotextId from extract_file_text: imports that text instead of content.
contentNoThe file's full text: FDX XML, WriterDuet JSON, or Fountain / screenplay-formatted plain text. Pass this or textId.
entityMapNoForce links: { "<name in the file>": "<entityId of an existing character or place>" }. A cue extension in the key is ignored.
projectIdYesScreenWeaver project id (from list_projects).
confirmAppendNoMust be true to add the file ("end" or "start") to a script that already has writing, once the user chose that over a new project or a replace (not needed with dryRun).
confirmReplaceNoMust be true when insertPosition is "replace" (not needed with dryRun).
insertPositionNoWhere the imported script goes. Default end.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / confirmAppend
      Added value: +{
      +  "description": "Must be true to add the file (\"end\" or \"start\") to a script that already has writing, once the user chose that over a new project or a replace (not needed with dryRun).",
      +  "type": "boolean"
      +}
    • removedInput schema / properties / insertPosition / default
      Removed value: -"end"
  2. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only state destructiveHint=true and non-idempotent; the description supplies the specifics an agent needs: replace wipes the whole script and needs confirmReplace, append to a script with existing writing needs confirmAppend, the pre-import script is saved to version History for undo, title pages are dropped except on replace/empty scripts, and misread files surface warnings that must be relayed and never reported as success. That is material behavior well beyond the annotation set.

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?

The purpose and the dryRun-first rule are front-loaded and nearly every sentence carries operational weight. It is nonetheless long and somewhat dense: the format list is restated in the closing paragraph (.docx/.odt/.EPUB adds new information, but FDX/WriterDuet/Fountain are repeated), and the 'ask the user first' instruction recurs in the confirmReplace section. Minor redundancy, not padding.

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?

For a 9-parameter destructive mutation with no output schema, the description covers the preview's contents (scenes, element counts, placement, entity links, near-miss candidates, warnings), createdEntities on the real call, and the confirmation protocol. Nothing an agent needs in order to call this safely on the first attempt is missing.

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

Parameters5/5

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

Schema coverage is 100%, so the baseline would be 3, but the description adds real meaning: entityMap keys are file-written names with cue extensions ignored ('MARA (O.S.)' keys as 'MARA'), only characters and places can be mapped, unmapped names fall back to name-linking or creation, and insertPosition 'start' places content after the first EPISODE and its OUTLINE lines. These are non-obvious semantics the schema alone does not convey.

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?

The opening sentence names a specific verb and resource (import a script file) and enumerates the accepted input formats (.fdx, WriterDuet .json, Fountain/plain text), and the body distinguishes the tool from edit_script and extract_file_text. An agent can identify this as the file-to-script ingestion path without opening the 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?

The description routes explicitly: 'Call it with dryRun: true first', 'call extract_file_text first, then import its text here with textId', 'Never retype a long script with edit_script', and 'create_project, then import there' for a new project. It also names the when-not case (non-screenplay text is refused; use edit_script after asking the user) which is an explicit exclusion rather than an implied one.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.