Skip to main content
Glama
cswkim

Discogs MCP Server

by cswkim

inventory_export

Request a CSV export of your inventory to manage or back up your collection.

Instructions

Request an export of your inventory as a CSV

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The 'inventory_export' MCP tool handler. It creates an InventoryService instance, calls the export() method, and returns a confirmation string.
    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);
        }
      },
    };
  • The service method that performs the actual API call for inventory export. Sends a POST request to /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)}`, { cause: error });
      }
    }
  • Registers the inventory_export tool (and related export tools) with the FastMCP server.
    export function registerInventoryExportTool(server: FastMCP): void {
      server.addTool(inventoryExportTool);
      server.addTool(getInventoryExportsTool);
      server.addTool(getInventoryExportTool);
      server.addTool(downloadInventoryExportTool);
    }
  • Import and invocation of registerInventoryExportTool from the main tools registration function.
    import { registerInventoryExportTool } from './inventoryExport.js';
    import { registerMarketplaceTools } from './marketplace.js';
    import { registerMediaTools } from './media.js';
    import { registerUserCollectionTools } from './userCollection.js';
    import { registerUserIdentityTools } from './userIdentity.js';
    import { registerUserListsTools } from './userLists.js';
    import { registerUserWantlistTools } from './userWantlist.js';
    
    /**
     * Registers all MCP tools with the server
     * @param server The FastMCP server instance
     */
    export function registerTools(server: FastMCP): void {
      registerDatabaseTools(server);
      registerMarketplaceTools(server);
      registerInventoryExportTool(server);
      registerUserIdentityTools(server);
      registerUserCollectionTools(server);
      registerUserWantlistTools(server);
      registerUserListsTools(server);
      registerMediaTools(server);
    }
  • Schema and type definitions for inventory exports. Includes InventoryIdParamSchema, InventoryExportItemSchema, and InventoryExportsResponseSchema.
    import { z } from 'zod';
    import { urlOrEmptySchema } from '../utils.js';
    import { PaginatedResponseSchema } from './common.js';
    
    export const InventoryIdParamSchema = z.object({
      id: z.number(),
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided. The description mentions 'request', implying an asynchronous operation, but does not explain the behavioral implications (e.g., where the export is stored, how to retrieve it).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single concise sentence with no redundancy. Every word is informative.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple request action with no parameters or output schema, the description is adequate but lacks mention of the follow-up step (downloading the export).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema has 0 parameters, so no parameter documentation needed. Baseline for 0 params is 4, and the description does not add any parameter info.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action 'request an export' and the resource 'inventory' with format 'CSV'. It distinguishes from sibling tools like 'download_inventory_export' and 'get_inventory_exports'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives, such as the need to later call 'download_inventory_export'. No prerequisites or context provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cswkim/discogs-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server