get_pair_details
Retrieve detailed information about specific trading pairs on the Casper Network's CSPR.trade DEX, including contract hash and currency data.
Instructions
Get detailed information about a specific trading pair
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pair | Yes | Pair contract package hash (e.g., "hash-abc123...") | |
| currency | No | Fiat currency code |
Implementation Reference
- packages/sdk/src/api/pairs.ts:41-48 (handler)The actual API client method that fetches pair details from the backend.
async getPairDetails(contractPackageHash: string, currencyId?: number): Promise<Pair> { const response = await this.http.get<ApiResponse<PairApiResponse>>( `/pairs/${contractPackageHash}`, { includes: currencyId !== undefined ? `csprtrade_data(${currencyId})` : undefined, } ); return mapPair(response.data); - packages/mcp/src/tools/market-data.ts:38-49 (registration)MCP tool registration for 'get_pair_details' and its handler logic which calls the SDK client.
server.tool( 'get_pair_details', 'Get detailed information about a specific trading pair', { pair: z.string().describe('Pair contract package hash (e.g., "hash-abc123...")'), currency: z.string().optional().describe('Fiat currency code'), }, async ({ pair, currency }) => { const result = await client.getPairDetails(pair, currency); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }] }; }, );