inventory_export
Export your Discogs inventory as a CSV file for easy management and analysis of your music collection directly through the Discogs API.
Instructions
Request an export of your inventory as a CSV
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/inventoryExport.ts:69-82 (handler)The main handler (execute function) for the 'inventory_export' MCP tool. It instantiates InventoryService and calls its export() method to request a CSV export of the user's inventory.export const inventoryExportTool: Tool<FastMCPSessionAuth, ToolParameters> = { name: 'inventory_export', description: 'Request an export of your inventory as a CSV', parameters: z.object({}), execute: async () => { try { const inventoryService = new InventoryService(); await inventoryService.export(); return 'Inventory export requested'; } catch (error) { throw formatDiscogsError(error); } },
- src/tools/inventoryExport.ts:85-90 (registration)Registration function that adds the 'inventory_export' tool (along with related tools) to the FastMCP server.export function registerInventoryExportTool(server: FastMCP): void { server.addTool(inventoryExportTool); server.addTool(getInventoryExportsTool); server.addTool(getInventoryExportTool); server.addTool(downloadInventoryExportTool); }
- src/tools/index.ts:18-18 (registration)Invocation of the registration function for inventory export tools within the main registerTools function.registerInventoryExportTool(server);
- src/services/inventory.ts:44-54 (helper)Supporting helper method in InventoryService that sends the POST request to '/inventory/export' to initiate the inventory export.async export(): Promise<void> { try { await this.request<void>('/export', { method: 'POST', }); } catch (error) { if (isDiscogsError(error)) { throw error; } throw new Error(`Failed to export inventory: ${String(error)}`); }