get_inventory_export
Retrieve details about a specific inventory export from your Discogs music collection using its unique ID to track and manage your catalog data.
Instructions
Get details about an inventory export
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/tools/inventoryExport.ts:31-45 (handler)MCP tool handler for 'get_inventory_export'. Instantiates InventoryService and calls getExport(args), returning JSON stringified result or formatted error.export const getInventoryExportTool: Tool<FastMCPSessionAuth, typeof InventoryIdParamSchema> = { name: 'get_inventory_export', description: 'Get details about an inventory export', parameters: InventoryIdParamSchema, execute: async (args) => { try { const inventoryService = new InventoryService(); const exportItem = await inventoryService.getExport(args); return JSON.stringify(exportItem); } catch (error) { throw formatDiscogsError(error); } }, };
- src/types/inventory.ts:5-7 (schema)Zod schema defining the input parameters for the tool: { id: number }export const InventoryIdParamSchema = z.object({ id: z.number(), });
- src/tools/inventoryExport.ts:85-90 (registration)Registers the getInventoryExportTool (among others) to the FastMCP server.export function registerInventoryExportTool(server: FastMCP): void { server.addTool(inventoryExportTool); server.addTool(getInventoryExportsTool); server.addTool(getInventoryExportTool); server.addTool(downloadInventoryExportTool); }
- src/services/inventory.ts:66-78 (helper)Core implementation in InventoryService.getExport: makes API request to /inventory/export/{id}, validates with schema, handles errors.async getExport({ id }: InventoryIdParam): Promise<InventoryExportItem> { try { const response = await this.request<InventoryExportItem>(`/export/${id}`); const validatedResponse = InventoryExportItemSchema.parse(response); return validatedResponse; } catch (error) { if (isDiscogsError(error)) { throw error; } throw new Error(`Failed to get inventory export: ${String(error)}`); } }