get_marketplace_order_messages
Retrieve and manage order message threads from Discogs marketplace by specifying order ID, page, and sorting parameters for efficient communication tracking.
Instructions
Get a list of an order's messages
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| order_id | Yes | ||
| page | No | ||
| per_page | No | ||
| sort | No | ||
| sort_order | No |
Implementation Reference
- src/tools/marketplace.ts:141-158 (handler)Definition and execute handler for the 'get_marketplace_order_messages' tool. Instantiates MarketplaceService and calls getOrderMessages with args, returning JSON stringified messages.export const getMarketplaceOrderMessagesTool: Tool< FastMCPSessionAuth, typeof OrderMessagesParamsSchema > = { name: 'get_marketplace_order_messages', description: `Get a list of an order's messages`, parameters: OrderMessagesParamsSchema, execute: async (args) => { try { const marketplaceService = new MarketplaceService(); const messages = await marketplaceService.getOrderMessages(args); return JSON.stringify(messages); } catch (error) { throw formatDiscogsError(error); } }, };
- src/types/marketplace.ts:206-206 (schema)Input schema for the tool: OrderMessagesParamsSchema, which merges QueryParamsSchema and OrderIdParamSchema requiring order_id and optional query params.export const OrderMessagesParamsSchema = QueryParamsSchema().merge(OrderIdParamSchema);
- src/tools/marketplace.ts:249-249 (registration)Registration of the tool via server.addTool in registerMarketplaceTools function.server.addTool(getMarketplaceOrderMessagesTool);
- src/tools/index.ts:17-17 (registration)High-level registration calling registerMarketplaceTools(server) which includes the marketplace tools.registerMarketplaceTools(server);
- src/services/marketplace.ts:176-194 (helper)MarketplaceService.getOrderMessages method: makes authenticated GET request to Discogs /orders/{order_id}/messages, validates and returns paginated messages.async getOrderMessages({ order_id, ...options }: OrderMessagesParams): Promise<OrderMessagesResponse> { try { const response = await this.request<OrderMessagesResponse>(`/orders/${order_id}/messages`, { params: options, }); const validatedResponse = OrderMessagesResponseSchema.parse(response); return validatedResponse; } catch (error) { if (isDiscogsError(error)) { throw error; } throw new Error(`Failed to get order messages: ${String(error)}`); } }