spiderfoot_export_json
Export SpiderFoot OSINT scan results in JSON format using scan IDs for data analysis or integration with other tools.
Instructions
Export scan results in JSON for CSV of IDs.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ids | Yes |
Implementation Reference
- src/spiderfootClient.ts:86-89 (handler)The core handler logic for the 'spiderfoot_export_json' tool. It sends a POST request to Spiderfoot's '/scanexportjsonmulti' endpoint with the CSV of scan IDs and returns the JSON export data.async exportJson(idsCsv: string) { const { data } = await this.http.post('/scanexportjsonmulti', { ids: idsCsv }); return data; }
- src/index.ts:100-104 (registration)Registration of the 'spiderfoot_export_json' tool in the stdio MCP server, including input schema and thin wrapper handler that calls the client exportJson method.server.registerTool( 'spiderfoot_export_json', { title: 'Export JSON', description: 'Export scan results in JSON for CSV of IDs.', inputSchema: { ids: z.string() } }, async ({ ids }) => ({ content: [{ type: 'text', text: JSON.stringify(await sf.exportJson(ids)) }] }) );
- src/index-http.ts:84-88 (registration)Registration of the 'spiderfoot_export_json' tool in the HTTP MCP server, identical to the stdio version.server.registerTool( 'spiderfoot_export_json', { title: 'Export JSON', description: 'Export scan results in JSON for CSV of IDs.', inputSchema: { ids: z.string() } }, async ({ ids }) => ({ content: [{ type: 'text', text: JSON.stringify(await sf.exportJson(ids)) }] }) );
- src/index.ts:36-36 (schema)Zod schema definition for the tool input (scan IDs as string), though registration uses a similar inline schema.const ExportJsonSchema = z.object({ ids: z.string().min(1) });
- src/spiderfootClient.ts:92-97 (helper)Helper function to create the SpiderfootClient instance from environment variables, used to instantiate 'sf' in both server registrations.export function makeSpiderfootClientFromEnv() { const baseUrl = process.env.SPIDERFOOT_BASE_URL || 'http://127.0.0.1:5001'; const username = process.env.SPIDERFOOT_USER; const password = process.env.SPIDERFOOT_PASS; return new SpiderfootClient({ baseUrl, username, password }); }