Skip to main content
Glama
michaeljiangmingfeng-debug

quanttogo-mcp-servers

get_signal_stats

Analyze trading strategy performance by retrieving statistics like win rate, total trades, and P&L metrics for specified time periods.

Instructions

Get signal statistics and performance metrics for a strategy, including win rate, total trades, and P&L.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
strategyIdNoStrategy ID (omit for all strategies)
periodNoTime period30d

Implementation Reference

  • Main handler implementation for get_signal_stats tool. Registers the tool with MCP server, defines input schema using zod (strategyId optional, period enum with default '30d'), and implements the handler that calls client.getAnalytics() and returns the statistics data as JSON.
    server.tool(
      'get_signal_stats',
      'Get signal statistics and performance metrics for a strategy, including win rate, total trades, and P&L.',
      {
        strategyId: z.string().optional().describe('Strategy ID (omit for all strategies)'),
        period: z.enum(['7d', '30d', '90d', '1y', 'all']).default('30d').describe('Time period'),
      },
      async ({ strategyId, period }) => {
        try {
          const result = await client.getAnalytics({ type: 'signals', period });
    
          return {
            content: [{
              type: 'text',
              text: JSON.stringify(result.data || { message: 'No stats available' }, null, 2),
            }],
          };
        } catch (error: any) {
          return { content: [{ type: 'text', text: `Error: ${error.message}` }] };
        }
      }
    );
  • getAnalytics client method that wraps the API call. Accepts optional 'type' and 'period' parameters and makes a POST request to '/getAnalytics' endpoint. This is called by the get_signal_stats handler with type='signals'.
    async getAnalytics(params: { type?: string; period?: string } = {}) {
      return this.call('/getAnalytics', params);
    }
  • Base call method that performs HTTP POST requests to the QuantToGo API. Handles authentication headers (Bearer token and x-user-id), error handling, and response parsing. Used by getAnalytics and all other client methods.
    async call<T = any>(path: string, data: Record<string, any> = {}): Promise<ApiResponse<T>> {
      const url = `${this.apiBase}${path}`;
    
      const headers: Record<string, string> = {
        'Content-Type': 'application/json',
      };
    
      if (this.apiKey) {
        headers['Authorization'] = `Bearer ${this.apiKey}`;
      }
      if (this.userId) {
        headers['x-user-id'] = this.userId;
      }
    
      const response = await fetch(url, {
        method: 'POST',
        headers,
        body: JSON.stringify(data),
      });
    
      if (!response.ok) {
        const errorText = await response.text();
        throw new Error(`API error ${response.status}: ${errorText}`);
      }
    
      const result = await response.json() as ApiResponse<T>;
    
      if (result.code !== undefined && result.success === undefined) {
        result.success = result.code === 0;
      }
    
      return result;
    }
  • ApiResponse type definition that defines the structure of API responses including code, data, message, and success fields. Used as the return type for all client methods including getAnalytics.
    export interface ApiResponse<T = any> {
      code: number;
      data?: T;
      message?: string;
      success?: boolean;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves statistics (implying read-only behavior) but doesn't cover critical aspects like authentication requirements, rate limits, error handling, or response format. This leaves significant gaps for a tool that likely accesses sensitive trading data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose. Every word contributes to understanding what the tool does, though it could be slightly more structured by separating purpose from metric examples.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the returned statistics look like (e.g., format, units), nor does it cover behavioral aspects like permissions or limitations. Given the complexity of trading data, this leaves too many unknowns for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds no parameter-specific information beyond what's already in the schema (which has 100% coverage). It mentions 'strategy' and 'period' implicitly but doesn't explain semantics like what 'all' period means or how strategyId affects results. Baseline 3 is appropriate since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('Get signal statistics and performance metrics') and resources ('for a strategy'), including key metrics like win rate, total trades, and P&L. It distinguishes from sibling tools by focusing on statistics rather than confirmation or raw signals, though it doesn't explicitly name alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus its siblings (confirm_signal, get_trading_signals), nor does it mention prerequisites like authentication or rate limits. It implies usage for strategy analysis but lacks explicit context or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/michaeljiangmingfeng-debug/quanttogo-mcp-servers'

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