al4_ingest_sha256
Ingest an existing file into AssemblyLine for analysis by providing its SHA256 hash, with optional notification, alert, and service configuration.
Instructions
Asynchronously ingest a file by SHA256 hash into AssemblyLine. The file must already exist in the AL4 file store.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sha256 | Yes | ||
| notification_queue | No | ||
| alert | No | ||
| description | No | ||
| classification | No | ||
| services | No | ||
| metadata | No |
Implementation Reference
- src/al4-client.ts:500-514 (handler)The ingestSha256 method on AL4Client – validates SHA256 format, builds the request body with optional ingest options (params, metadata, notification_queue, alert), and POSTs to /api/v4/ingest/.
ingestSha256( sha256: string, options: IngestOptions = {}, ): Promise<Record<string, unknown>> { if (!SHA256_RE.test(sha256)) throw new Error(`Invalid sha256: ${sha256}`); const body: Record<string, unknown> = { sha256 }; if (options.params) body.params = options.params; if (options.metadata) body.metadata = options.metadata; if (options.notification_queue) body.notification_queue = options.notification_queue; if (options.notification_threshold !== undefined) body.notification_threshold = options.notification_threshold; if (options.alert !== undefined) body.generate_alert = options.alert; return this.requestJson("POST", "/api/v4/ingest/", body, options); } - src/index.ts:401-403 (handler)The switch case in CallToolRequestSchema that dispatches 'al4_ingest_sha256' to client.ingestSha256() with the sha256 argument and ingest options.
case "al4_ingest_sha256": result = await client.ingestSha256(a.sha256 as string, buildIngestOptions(a)); break; - src/index.ts:126-143 (schema)Tool definition with name, description, and inputSchema for al4_ingest_sha256 (requires sha256 string, optional notification_queue, alert, description, classification, services, metadata).
{ name: "al4_ingest_sha256", description: "Asynchronously ingest a file by SHA256 hash into AssemblyLine. The file must already exist in the AL4 file store.", inputSchema: { type: "object", properties: { sha256: { type: "string" }, notification_queue: { type: "string" }, alert: { type: "boolean" }, description: { type: "string" }, classification: { type: "string" }, services: { type: "array", items: { type: "string" } }, metadata: { type: "object", additionalProperties: { type: "string" } }, }, required: ["sha256"], }, }, - src/index.ts:336-342 (helper)buildIngestOptions helper function used to construct ingest options (notification_queue, alert, plus base submit options) from the raw arguments.
function buildIngestOptions(args: Record<string, unknown>) { return { ...buildSubmitOptions(args), notification_queue: args.notification_queue as string | undefined, alert: args.alert as boolean | undefined, }; } - src/index.ts:126-143 (registration)Tool registration within the TOOLS array – the tool object at index [9] is named 'al4_ingest_sha256' and is included in the list returned by ListToolsRequestSchema.
{ name: "al4_ingest_sha256", description: "Asynchronously ingest a file by SHA256 hash into AssemblyLine. The file must already exist in the AL4 file store.", inputSchema: { type: "object", properties: { sha256: { type: "string" }, notification_queue: { type: "string" }, alert: { type: "boolean" }, description: { type: "string" }, classification: { type: "string" }, services: { type: "array", items: { type: "string" } }, metadata: { type: "object", additionalProperties: { type: "string" } }, }, required: ["sha256"], }, },