al4_submit_file
Submit a local file to AssemblyLine for immediate malware analysis. Returns a submission ID for tracking results.
Instructions
Submit a local file to AssemblyLine for immediate synchronous analysis. Returns a submission ID. Limited to 5 concurrent submissions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Absolute path to the file to analyse | |
| name | No | Override display name for the file | |
| description | No | Human-readable description of the submission | |
| classification | No | Classification label (e.g. TLP:CLEAR) | |
| services | No | Specific services to run (empty = all defaults) | |
| metadata | No | Key/value metadata attached to the submission |
Implementation Reference
- src/al4-client.ts:417-433 (handler)The `submitFile` method on AL4Client that executes the actual tool logic for al4_submit_file. It validates the file exists, builds the JSON part with name/params/metadata, and calls multipartUpload to POST to /api/v4/submit/.
async submitFile( filePath: string, options: SubmitOptions = {}, ): Promise<Record<string, unknown>> { if (!existsSync(filePath)) throw new Error(`File not found: ${filePath}`); const jsonPart: Record<string, unknown> = {}; if (options.name) jsonPart.name = options.name; if (options.params) jsonPart.params = options.params; if (options.metadata) jsonPart.metadata = options.metadata; return this.multipartUpload( "/api/v4/submit/", filePath, jsonPart, options.name ?? basename(filePath), options, ); } - src/index.ts:385-387 (handler)The switch-case handler in the MCP request handler that dispatches al4_submit_file to client.submitFile with args from the request.
case "al4_submit_file": result = await client.submitFile(a.file_path as string, buildSubmitOptions(a)); break; - src/index.ts:31-55 (schema)The tool schema registration for al4_submit_file, defining its name, description, and inputSchema (file_path required, plus optional name, description, classification, services, metadata).
// ── Submit (synchronous, quota-limited) ──────────────────────────────── { name: "al4_submit_file", description: "Submit a local file to AssemblyLine for immediate synchronous analysis. Returns a submission ID. Limited to 5 concurrent submissions.", inputSchema: { type: "object", properties: { file_path: { type: "string", description: "Absolute path to the file to analyse" }, name: { type: "string", description: "Override display name for the file" }, description: { type: "string", description: "Human-readable description of the submission" }, classification: { type: "string", description: "Classification label (e.g. TLP:CLEAR)" }, services: { type: "array", items: { type: "string" }, description: "Specific services to run (empty = all defaults)", }, metadata: { type: "object", additionalProperties: { type: "string" }, description: "Key/value metadata attached to the submission", }, }, required: ["file_path"], }, - src/index.ts:25-56 (registration)The TOOLS array that registers al4_submit_file (and all other tools) on the MCP server, listed via ListToolsRequestSchema.
const TOOLS = [ { name: "al4_whoami", description: "Return details about the currently authenticated AssemblyLine user.", inputSchema: { type: "object", properties: {}, required: [] }, }, // ── Submit (synchronous, quota-limited) ──────────────────────────────── { name: "al4_submit_file", description: "Submit a local file to AssemblyLine for immediate synchronous analysis. Returns a submission ID. Limited to 5 concurrent submissions.", inputSchema: { type: "object", properties: { file_path: { type: "string", description: "Absolute path to the file to analyse" }, name: { type: "string", description: "Override display name for the file" }, description: { type: "string", description: "Human-readable description of the submission" }, classification: { type: "string", description: "Classification label (e.g. TLP:CLEAR)" }, services: { type: "array", items: { type: "string" }, description: "Specific services to run (empty = all defaults)", }, metadata: { type: "object", additionalProperties: { type: "string" }, description: "Key/value metadata attached to the submission", }, }, required: ["file_path"], }, }, - src/index.ts:322-334 (helper)The buildSubmitOptions helper function that transforms raw request arguments into the SubmitOptions shape used by client.submitFile.
function buildSubmitOptions(args: Record<string, unknown>) { return { name: args.name as string | undefined, params: { ...(args.description ? { description: args.description as string } : {}), ...(args.classification ? { classification: args.classification as string } : {}), ...(args.services ? { services: { selected: args.services as string[] } } : {}), }, metadata: args.metadata as Record<string, string> | undefined, }; }