Skip to main content
Glama
JCF0

CG Alpha MCP

by JCF0

ta_summary

Read-only

Calculate RSI and Bollinger Bands simultaneously for crypto market analysis. Input price data to get technical indicators for evaluating token performance.

Instructions

Return both RSI and Bollinger in one call. Inputs: values:number[] (oldest→newest), rsiPeriod?:number(14), bbPeriod?:number(20), bbMult?:number(2).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
valuesYes
rsiPeriodNo
bbPeriodNo
bbMultNo

Implementation Reference

  • Handler function for the 'ta_summary' tool. Validates input, calls RSI and Bollinger helpers, and returns combined results.
    "ta_summary": async (args) => {
      const values = Array.isArray(args?.values) ? args.values : null;
      const rsiPeriod = Number.isFinite(Number(args?.rsiPeriod)) ? Number(args.rsiPeriod) : 14;
      const bbPeriod  = Number.isFinite(Number(args?.bbPeriod))  ? Number(args.bbPeriod)  : 20;
      const bbMult    = Number.isFinite(Number(args?.bbMult))    ? Number(args.bbMult)    : 2;
      if (!values || values.length === 0) {
        return { content: textContent({ error:true, message:"'values' must be a non-empty array of numbers (oldest → newest)" }), isError:true };
      }
      const rsiVal = taRSI(values, rsiPeriod);
      const bbVal  = taBoll(values, bbPeriod, bbMult);
      return { content: textContent({ ok:true, rsi: rsiVal, bollinger: bbVal, rsiPeriod, bbPeriod, bbMult }) };
    }
  • mcp-server.js:345-353 (registration)
    Tool registration entry for 'ta_summary', including input schema, description, and annotations used in tools/list response.
    { name:"ta_summary",
      description:"Return both RSI and Bollinger in one call. Inputs: values:number[] (oldest→newest), rsiPeriod?:number(14), bbPeriod?:number(20), bbMult?:number(2).",
      inputSchema:{ type:"object", properties:{
        values:{ type:"array", items:{ type:"number" } },
        rsiPeriod:{ type:"number" },
        bbPeriod:{ type:"number" },
        bbMult:{ type:"number" }
      }, required:["values"] },
      annotations:{ title:"TA: Summary", readOnlyHint:true, openWorldHint:false }
  • Pure RSI computation function (taRSI alias), called by ta_summary handler.
    export function rsi(values, period = 14) {
      const arr = normalize(values);
      if (arr.length < period + 1) return null;
    
      // Seed averages over the first `period` deltas
      let gains = 0, losses = 0;
      for (let i = 1; i <= period; i++) {
        const d = arr[i] - arr[i - 1];
        if (d >= 0) gains += d; else losses -= d;
      }
      let avgGain = gains / period;
      let avgLoss = losses / period;
    
      // Wilder smoothing for the remaining deltas
      for (let i = period + 1; i < arr.length; i++) {
        const d = arr[i] - arr[i - 1];
        const gain = d > 0 ? d : 0;
        const loss = d < 0 ? -d : 0;
        avgGain = (avgGain * (period - 1) + gain) / period;
        avgLoss = (avgLoss * (period - 1) + loss) / period;
      }
    
      if (!isFiniteNum(avgGain) || !isFiniteNum(avgLoss)) return null;
    
      // Handle flat / division-by-zero cases explicitly
      if (avgLoss === 0) {
        if (avgGain === 0) return 50;   // perfectly flat
        return 100;                     // only gains
      }
    
      const rs = avgGain / avgLoss;
      if (!isFiniteNum(rs)) return null;
    
      const rsi = 100 - (100 / (1 + rs));
      return isFiniteNum(rsi) ? clamp(rsi, 0, 100) : null;
    }
  • Pure Bollinger Bands computation function (taBoll alias), called by ta_summary handler.
    export function bollinger(values, period = 20, mult = 2) {
      const arr = normalize(values);
      if (arr.length < period) return null;
    
      const slice = arr.slice(-period);
      const mean = avg(slice);
      if (!isFiniteNum(mean)) return null;
    
      const variance = avg(slice.map(v => (v - mean) * (v - mean)));
      const stdev = Math.sqrt(variance);
      if (!isFiniteNum(stdev)) return null;
    
      const upper = mean + mult * stdev;
      const lower = mean - mult * stdev;
      const last  = arr[arr.length - 1];
    
      // Avoid division by zero in derived metrics
      const denomBands = upper - lower;
      const denomMean  = mean;
    
      const percentB =
        isFiniteNum(denomBands) && denomBands !== 0
          ? (last - lower) / denomBands
          : null;
    
      const bandwidth =
        isFiniteNum(denomMean) && denomMean !== 0
          ? (upper - lower) / denomMean
          : null;
    
      return {
        mean,
        upper,
        lower,
        last,
        percentB: isFiniteNum(percentB) ? percentB : null,
        bandwidth: isFiniteNum(bandwidth) ? bandwidth : null
      };
    }
Behavior3/5

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

Annotations provide readOnlyHint=true and openWorldHint=false, indicating a safe, deterministic operation. The description adds minimal behavioral context by specifying it returns both indicators in one call, which hints at efficiency but doesn't detail output format, error handling, or computational limits. Since annotations cover safety, the description adds some value but lacks depth, aligning with a baseline score.

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

Conciseness5/5

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

The description is highly concise and front-loaded: the first sentence states the purpose, followed by a compact parameter list. Every sentence earns its place with no wasted words, making it easy for an agent to parse quickly. The structure efficiently conveys essential information without redundancy.

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

Completeness3/5

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

Given 4 parameters, 0% schema coverage, no output schema, and annotations covering safety, the description is moderately complete. It defines the tool's purpose and parameters but lacks details on return values, error conditions, or performance considerations. For a technical analysis tool with multiple inputs, more context would help, but it meets a basic threshold.

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?

Schema description coverage is 0%, so the description must compensate. It lists all parameters with types and defaults (e.g., 'rsiPeriod?:number(14)'), adding meaning beyond the bare schema. However, it doesn't explain parameter roles (e.g., what 'values' array represents or valid ranges), leaving gaps. With 4 parameters and no schema descriptions, this partial compensation justifies a mid-range score.

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: 'Return both RSI and Bollinger in one call.' It specifies the verb ('Return') and resources ('RSI and Bollinger'), making the function explicit. However, it doesn't distinguish this from its sibling tools 'ta_bollinger' and 'ta_rsi' by explaining why one would use this combined tool versus the individual ones, which prevents a perfect score.

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 alternatives. It mentions sibling tools 'ta_bollinger' and 'ta_rsi' exist but offers no context on trade-offs, such as efficiency or use cases for combined versus separate calculations. Without any when-to-use or when-not-to-use advice, the agent lacks decision-making support.

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/JCF0/cg-alpha-mcp'

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