Skip to main content
Glama

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
NameRequiredDescriptionDefault
pairYesPair contract package hash (e.g., "hash-abc123...")
currencyNoFiat currency code

Implementation Reference

  • 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);
  • 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) }] };
      },
    );

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/make-software/cspr-trade-mcp'

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