cortex_get_job_artifacts
Retrieve extracted observables and IOCs from a completed analysis job by providing the job ID.
Instructions
Get artifacts (extracted observables/IOCs) from a completed analysis job
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| jobId | Yes | The job ID to get artifacts for |
Implementation Reference
- src/tools/jobs.ts:212-241 (handler)MCP tool handler that receives a jobId, calls client.getJobArtifacts(), and returns the artifacts as JSON string in the response content.
server.tool( "cortex_get_job_artifacts", "Get artifacts (extracted observables/IOCs) from a completed analysis job", { jobId: z.string().describe("The job ID to get artifacts for"), }, async ({ jobId }) => { try { const artifacts = await client.getJobArtifacts(jobId); return { content: [ { type: "text" as const, text: JSON.stringify(artifacts, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text" as const, text: `Error getting job artifacts: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } }, ); - src/tools/jobs.ts:215-217 (schema)Zod schema defining input: jobId (required string).
{ jobId: z.string().describe("The job ID to get artifacts for"), }, - src/tools/jobs.ts:212-213 (registration)Tool registered on the server with the name 'cortex_get_job_artifacts' as part of registerJobTools().
server.tool( "cortex_get_job_artifacts", - src/tools/jobs.ts:5-8 (registration)Function registerJobTools() exported from jobs.ts, called from index.ts to register all job-related tools including cortex_get_job_artifacts.
export function registerJobTools( server: McpServer, client: CortexClient, ): void { - src/client.ts:309-313 (helper)CortexClient helper method that performs GET request to /api/job/{jobId}/artifacts and returns an array of Artifact objects.
async getJobArtifacts(jobId: string): Promise<Artifact[]> { return this.request<Artifact[]>( `/job/${encodeURIComponent(jobId)}/artifacts`, ); }