Skip to main content
Glama

get_alerts

Check triggered financial alerts by evaluating conditions against live market data to monitor trading risks and opportunities.

Instructions

Check which of your configured alerts are currently triggered. Evaluates all alert conditions against live market data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function 'getAlertsTool' fetches stored alerts, evaluates them against current market data, and returns the triggering status.
    export async function getAlertsTool(cache: CacheService): Promise<GetAlertsOutput | ErrorOutput> {
      const stored = getStoredAlerts(AGENT_ID);
    
      if (!stored || stored.alerts.length === 0) {
        return {
          error: true, error_source: 'get_alerts',
          agent_guidance: 'No alerts configured. Use set_alert to define conditions like: [{field: "fear_greed", operator: "<", threshold: 20, label: "Extreme fear"}].',
          last_known_data: null, data_warnings: ['No alerts set for this agent.'],
        };
      }
    
      try {
        const reality = await getRealityCheck(cache);
        const currentValues = extractCurrentValues(reality as unknown as Record<string, unknown>);
    
        const triggered: GetAlertsOutput['triggered'] = [];
        const notTriggered: GetAlertsOutput['not_triggered'] = [];
    
        for (const alert of stored.alerts) {
          const result = evaluateCondition(
            { field: alert.field, operator: alert.operator, threshold: alert.threshold },
            currentValues,
          );
    
          const entry = { ...result, alert_id: alert.alert_id, label: alert.label };
    
          if (result.met) triggered.push(entry);
          else notTriggered.push(entry);
        }
    
        let guidance = `${triggered.length} of ${stored.alerts.length} alerts triggered. `;
        if (triggered.length > 0) {
          guidance += `ACTIVE ALERTS: ${triggered.map(t => t.label).join('; ')}. `;
          guidance += 'Take action based on your strategy or wait for additional confirmation.';
        } else {
          guidance += 'No conditions met. Market is within your defined parameters. Continue monitoring.';
        }
    
        return {
          agent_id: AGENT_ID,
          total_alerts: stored.alerts.length,
          triggered_count: triggered.length,
          triggered,
          not_triggered: notTriggered,
          agent_guidance: guidance,
        };
      } catch {
        return {
          error: true, error_source: 'get_alerts',
          agent_guidance: 'Alert evaluation temporarily unavailable. Retry shortly.',
          last_known_data: null, data_warnings: ['Alert evaluation service temporarily unavailable.'],
        };
      }
    }
  • The output schema defining the shape of the data returned by the get_alerts tool.
    export interface GetAlertsOutput {
      agent_id: string;
      total_alerts: number;
      triggered_count: number;
      triggered: Array<ConditionResult & { alert_id: string; label: string }>;
      not_triggered: Array<ConditionResult & { alert_id: string; label: string }>;
      agent_guidance: string;
    }
Behavior3/5

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

Adds valuable behavioral context that 'alert conditions' are evaluated against 'live market data' (real-time evaluation). However, with zero annotations, the description fails to disclose safety profile (read-only vs mutation), error conditions (what if no alerts configured?), or idempotency concerns.

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?

Two tightly constructed sentences with zero redundancy. First sentence establishes purpose, second adds critical behavioral context (live evaluation). Appropriately terse for a parameterless tool.

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?

Covers core functionality adequately for a low-complexity tool, but lacks output specification (what format do triggered alerts return in?) and error scenarios. No output schema exists to compensate, leaving operational gaps.

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

Parameters4/5

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

Zero parameters present per schema. Per scoring rules, 0 params equals baseline score of 4. No parameters require semantic elaboration.

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

Purpose5/5

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

Excellent specificity: 'Check' and 'Evaluates' are clear action verbs, 'configured alerts' identifies the resource precisely. Implicitly distinguishes from sibling 'set_alert' by focusing on checking existing configured alerts rather than creating them.

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

Usage Guidelines3/5

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

Provides implied usage context ('Check which...are currently triggered'), but fails to explicitly contrast with sibling 'set_alert' or indicate when to prefer this over other monitoring tools like 'get_watchlist_report'. No explicit when-not-to-use guidance.

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/0xHashy/fathom-fyi'

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