Skip to main content
Glama
modellers

ConsignCloud MCP Server

by modellers

get_sale

Retrieve detailed information about a specific sale transaction by providing its unique ID. This tool helps track sales data for consignment and retail business operations.

Instructions

Get details of a specific sale

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesSale ID

Implementation Reference

  • Primary handler that fetches sale by ID from API /sales/{id} and converts response to store currency format.
    async getSale(id: string): Promise<Sale> { const response = await this.client.get(`/sales/${id}`); return this.convertSaleResponse(response.data); }
  • src/server.ts:114-124 (registration)
    Registers the 'get_sale' MCP tool with input schema requiring sale ID.
    { name: 'get_sale', description: 'Get details of a specific sale', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Sale ID' }, }, required: ['id'], }, },
  • MCP server dispatch case that calls client.getSale and returns JSON-formatted result.
    case 'get_sale': return { content: [{ type: 'text', text: JSON.stringify(await client.getSale((args as any).id), null, 2) }] };
  • TypeScript interface defining the Sale response structure.
    export interface Sale { id: string; created: string; total: number; // converted to store currency subtotal: number; // converted to store currency tax: number; // converted to store currency customer: string | null; location: string | null; items: any[]; payments: any[]; status: 'completed' | 'voided' | 'returned'; }
  • Helper function converting API cents-based sale data to store currency values.
    private convertSaleResponse(sale: any): Sale { return { ...sale, total: this.convertFromApiCents(sale.total), subtotal: this.convertFromApiCents(sale.subtotal), tax: this.convertFromApiCents(sale.tax), items: sale.items?.map((item: any) => ({ ...item, tag_price: item.tag_price ? this.convertFromApiCents(item.tag_price) : undefined, total: item.total ? this.convertFromApiCents(item.total) : undefined, })), payments: sale.payments?.map((payment: any) => ({ ...payment, amount: payment.amount ? this.convertFromApiCents(payment.amount) : undefined, })), }; }

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/modellers/mcp-consigncloud'

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