Skip to main content
Glama
cswkim

Discogs MCP Server

by cswkim

get_marketplace_order_messages

Retrieve messages for a Discogs marketplace order to track communication and manage transactions.

Instructions

Get a list of an order's messages

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNo
per_pageNo
sortNo
sort_orderNo
order_idYes

Implementation Reference

  • MCP tool handler for 'get_marketplace_order_messages'. Instantiates MarketplaceService and delegates to its getOrderMessages method, returning JSON-stringified result or formatted error.
    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);
        }
      },
    };
  • Zod input schema for the tool parameters, combining general query params with required order_id.
    export const OrderMessagesParamsSchema = QueryParamsSchema().merge(OrderIdParamSchema);
  • Registers the tool with the FastMCP server instance.
    server.addTool(getMarketplaceOrderMessagesTool);
  • MarketplaceService method implementing the core logic: makes authenticated GET request to Discogs `/orders/${order_id}/messages` API, 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)}`);
      }
    }

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