Skip to main content
Glama

set_alert

Create custom alerts to monitor market conditions and receive notifications when specific thresholds are met, such as fear_greed dropping below 20 or risk_score exceeding certain levels.

Instructions

Set custom alerts that trigger when market conditions meet your thresholds. Example: [{field: "fear_greed", operator: "<", threshold: 20, label: "Extreme fear"}]. Call get_alerts to check which are triggered.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
alertsYesArray of alert conditions

Implementation Reference

  • The implementation of the set_alert tool handler, which validates input alert conditions and persists them using setAlerts.
    export function setAlertTool(alerts: SetAlertInput[]): SetAlertResult {
      const validated: AlertCondition[] = [];
    
      for (const a of alerts) {
        if (!VALID_FIELDS.has(a.field)) continue;
        if (!VALID_OPS.has(a.operator)) continue;
    
        validated.push({
          alert_id: generateAlertId(),
          field: a.field,
          operator: a.operator as AlertCondition['operator'],
          threshold: a.threshold,
          label: a.label ?? `${a.field} ${a.operator} ${a.threshold}`,
        });
      }
    
      const stored = setAlerts(AGENT_ID, validated);
    
      return {
        success: true,
        agent_id: AGENT_ID,
        alerts_count: validated.length,
        updated_at: stored.updated_at,
        agent_guidance: `${validated.length} alert${validated.length === 1 ? '' : 's'} configured. Call get_alerts to check which conditions are currently triggered. Alerts are evaluated against live market data on each call.`,
      };
    }
  • Type definitions (schema) for the input and result of the set_alert tool.
    export interface SetAlertInput {
      field: string;
      operator: string;
      threshold: string | number;
      label?: string;
    }
    
    export interface SetAlertResult {
      success: boolean;
      agent_id: string;
      alerts_count: number;
      updated_at: string;
      agent_guidance: string;
    }
Behavior3/5

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

With no annotations, description carries full burden. It explains the trigger mechanism conceptually and the workflow (set then get), but omits critical behavioral details: whether alerts persist across sessions, overwrite previous calls or append, volume limits, and what 'triggered' means (notification vs state change).

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?

Three efficient components: purpose statement, concrete example, and usage workflow. Every sentence earns its place; front-loaded with no 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 100% schema coverage and no output schema, the description covers the essential input structure via example. However, for a configuration tool with no annotations, it should clarify mutation semantics (append vs replace) and persistence to be complete.

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?

Schema has 100% coverage (baseline 3). The concrete JSON example adds significant semantic value by showing valid operator syntax ('<'), field name format ('fear_greed'), and array structure, complementing the schema's type definitions.

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?

Clear verb+resource ('Set custom alerts'), specific domain context ('market conditions'), and distinguishes from sibling get_alerts by stating alerts 'trigger' and require calling get_alerts to check status. The example clarifies the threshold concept effectively.

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 workflow guidance ('Call get_alerts to check which are triggered') but lacks explicit comparison with similar configuration tools like set_signal_preferences or manage_webhooks, and doesn't specify when to use alerts vs webhooks.

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