Skip to main content
Glama
cswkim

Discogs MCP Server

by cswkim

get_marketplace_orders

Retrieve a list of marketplace orders on Discogs, filter by status, creation date, or archive status, and sort results by ID, buyer, or activity for efficient order management.

Instructions

Get a list of marketplace orders

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
archivedNo
created_afterNo
created_beforeNo
pageNo
per_pageNo
sortNo
sort_orderNo
statusNo

Implementation Reference

  • The MCP tool definition including the execute handler function that instantiates MarketplaceService and calls getOrders to fetch and return the orders.
    export const getMarketplaceOrdersTool: Tool<FastMCPSessionAuth, typeof OrdersParamsSchema> = { name: 'get_marketplace_orders', description: 'Get a list of marketplace orders', parameters: OrdersParamsSchema, execute: async (args) => { try { const marketplaceService = new MarketplaceService(); const orders = await marketplaceService.getOrders(args); return JSON.stringify(orders); } catch (error) { throw formatDiscogsError(error); } }, };
  • Zod schema for the input parameters of the get_marketplace_orders tool, including optional filters like status, date ranges, and pagination/sort via QueryParamsSchema.
    export const OrdersParamsSchema = z .object({ status: OrderStatusSchema.optional(), created_after: z.string().optional(), created_before: z.string().optional(), archived: z.boolean().optional(), }) .merge(QueryParamsSchema(['id', 'buyer', 'created', 'status', 'last_activity'] as const));
  • Registration of the getMarketplaceOrdersTool with the FastMCP server instance.
    server.addTool(getMarketplaceOrdersTool);
  • The MarketplaceService.getOrders method, which makes the authenticated API request to Discogs /orders endpoint, validates the response, and handles errors.
    async getOrders(params: OrdersParams): Promise<OrdersResponse> { try { const response = await this.request<OrdersResponse>(`/orders`, { params, }); const validatedResponse = OrdersResponseSchema.parse(response); return validatedResponse; } catch (error) { if (isDiscogsError(error)) { throw error; } throw new Error(`Failed to get orders: ${String(error)}`); } }
  • Higher-level registration call within registerTools that includes the marketplace tools registration.
    registerMarketplaceTools(server);

Other Tools

Related 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