Skip to main content
Glama

Create Video Factory Job

pipeline_create_job

Set up a new AI video production job by creating a structured folder and manifest with job ID, title, prompt, platforms, style, and duration for pipeline processing.

Instructions

Create a structured job folder and manifest for an AI video production pipeline.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jobIdYes
titleYes
promptYes
platformsNo
styleNo
durationSecondsNo

Implementation Reference

  • The async handler function that executes the pipeline_create_job tool logic: creates job folder structure (inputs, comfy, renders, ae, review, publish), writes a manifest.json with all input fields plus createdAt and status, and returns the result or error.
    async (input) => {
      try {
        const jobRoot = safePath(`jobs/${input.jobId}`);
        for (const dir of ['inputs', 'comfy', 'renders', 'ae', 'review', 'publish']) {
          await fs.mkdir(path.join(jobRoot, dir), { recursive: true });
        }
        const manifest = { ...input, createdAt: new Date().toISOString(), status: 'created' };
        await writeJsonFile(path.join(jobRoot, 'manifest.json'), manifest);
        return textResult({ ok: true, jobRoot, manifestPath: `jobs/${input.jobId}/manifest.json`, manifest });
      } catch (err) {
        return errorResult('Failed to create pipeline job', String(err));
      }
    }
  • The inputSchema definition for pipeline_create_job using Zod: validates jobId (alphanumeric+hyphen+underscore), title, prompt, platforms (array of platform enums with default ['douyin']), optional style, and durationSeconds (positive max 300, default 8).
      title: 'Create Video Factory Job',
      description: 'Create a structured job folder and manifest for an AI video production pipeline.',
      inputSchema: z.object({
        jobId: z.string().regex(/^[a-zA-Z0-9_-]+$/),
        title: z.string(),
        prompt: z.string(),
        platforms: z.array(z.enum(['douyin', 'xiaohongshu', 'bilibili', 'youtube_shorts', 'tiktok'])).default(['douyin']),
        style: z.string().optional(),
        durationSeconds: z.number().positive().max(300).default(8)
      })
    },
  • Registration of the 'pipeline_create_job' tool via server.registerTool() within the registerPipelineTools function, which is called from src/index.ts line 23.
    server.registerTool(
      'pipeline_create_job',
      {
        title: 'Create Video Factory Job',
        description: 'Create a structured job folder and manifest for an AI video production pipeline.',
        inputSchema: z.object({
          jobId: z.string().regex(/^[a-zA-Z0-9_-]+$/),
          title: z.string(),
          prompt: z.string(),
          platforms: z.array(z.enum(['douyin', 'xiaohongshu', 'bilibili', 'youtube_shorts', 'tiktok'])).default(['douyin']),
          style: z.string().optional(),
          durationSeconds: z.number().positive().max(300).default(8)
        })
      },
      async (input) => {
        try {
          const jobRoot = safePath(`jobs/${input.jobId}`);
          for (const dir of ['inputs', 'comfy', 'renders', 'ae', 'review', 'publish']) {
            await fs.mkdir(path.join(jobRoot, dir), { recursive: true });
          }
          const manifest = { ...input, createdAt: new Date().toISOString(), status: 'created' };
          await writeJsonFile(path.join(jobRoot, 'manifest.json'), manifest);
          return textResult({ ok: true, jobRoot, manifestPath: `jobs/${input.jobId}/manifest.json`, manifest });
        } catch (err) {
          return errorResult('Failed to create pipeline job', String(err));
        }
      }
    );
  • The safePath helper used in the handler to resolve job paths safely under VIDEO_FACTORY_ROOT, preventing path traversal.
    export function safePath(input: string) {
      ensureRoot();
      const resolved = path.resolve(config.root, input);
      if (!resolved.startsWith(config.root)) {
        throw new Error(`Path escapes VIDEO_FACTORY_ROOT: ${input}`);
      }
      return resolved;
    }
  • The writeJsonFile helper used to write the manifest.json file.
    export async function writeJsonFile(filePath: string, data: unknown) {
      await fs.mkdir(path.dirname(filePath), { recursive: true });
      await fs.writeFile(filePath, JSON.stringify(data, null, 2), 'utf8');
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool 'creates' something, implying a write operation, but gives no details on side effects, required permissions, or whether it overwrites existing data. The behavioral insight is minimal.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, which is concise but too brief to be informative. It is front-loaded with the main action, but lacks necessary details, sacrificing completeness for brevity.

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

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 6 parameters, no output schema, and no annotations, the description is severely incomplete. It does not explain the manifest structure, return values, or how the job folder is organized. This is insufficient for correct invocation.

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

Parameters1/5

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

The schema has 0% description coverage, meaning no parameter descriptions exist. The tool description does not explain the purpose of parameters like jobId, title, prompt, platforms, style, or durationSeconds. It adds no value to understanding what each parameter controls.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool creates a 'structured job folder and manifest' for an AI video production pipeline. The verb 'create' and resource 'job folder and manifest' are specific. However, it does not explicitly differentiate from sibling tools, though the siblings are distinct enough that confusion is unlikely.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus alternatives like comfy_submit_workflow or ae_render_template. The description lacks context about prerequisites, constraints, or scenarios where this tool is appropriate.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Eliveral/codex-mcp-comfy-ae-video-factory-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server