get_market_summary
Retrieve a global summary of Theagora exchange activity including trade volume, active functions, open orders, and top functions by volume to understand overall market conditions.
Instructions
Get a global summary of the Theagora exchange: overall trade volume, active function count, open order count, and top functions by volume. Good for understanding overall market activity before diving into specific functions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| window | No | Time window for volume data (default: 7d) |
Implementation Reference
- src/tools/market-data.ts:26-42 (handler)The MCP tool registration and handler for get_market_summary. Defines the input schema (window parameter), executes the API call via client.getMarketDataSummary(), and returns the formatted JSON result.
// get_market_summary — Global exchange overview server.tool( 'get_market_summary', 'Get a global summary of the Theagora exchange: overall trade volume, active function count, open order count, and top functions by volume. Good for understanding overall market activity before diving into specific functions.', { window: z.enum(['24h', '7d', '30d']).optional().describe('Time window for volume data (default: 7d)'), }, { readOnlyHint: true, openWorldHint: true }, async (params) => { const result = await client.getMarketDataSummary({ window: params.window, }); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }], }; } ); - src/client.ts:233-235 (helper)The AgoraApiClient method that makes the actual HTTP GET request to the /market-data/summary endpoint with optional window query parameter.
async getMarketDataSummary(params?: { window?: string }): Promise<any> { return this.request('/market-data/summary', { params: params as any }); } - src/index.ts:10-30 (registration)Main entry point that imports and calls registerMarketDataTools to register the get_market_summary tool with the MCP server.
import { registerMarketDataTools } from './tools/market-data.js'; import { registerAnalyticsTools } from './tools/analytics.js'; export function createServer(): McpServer { const server = new McpServer({ name: 'theagora', version: '0.1.0', }); const client = new AgoraApiClient(); // Register all tool groups registerDiscoveryTools(server, client); registerBuyingTools(server, client); registerSellingTools(server, client); registerIdentityTools(server, client); registerSocialTools(server, client); registerTrustTools(server, client); registerExchangeTools(server, client); registerMarketDataTools(server, client); registerAnalyticsTools(server, client);