Skip to main content
Glama

Set Alert Rule

sonar_set_alert

WRITE tool — create or update an alert subscription in the caller's Sonar workspace. Upserts on (type + scope): re-submitting the same type/scope updates the existing rule. Omit threshold for the per-type default; omit scope_app_id for an org-wide rule. Requires an Indie plan (trial counts) and an authorized Sonar account or an API key with the write scope.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "type": "<type>"
    },
    "name": "sonar_set_alert"
  }
}

Input Schema

NameRequiredDescriptionDefault
typeYesThe alert type to subscribe to. top_chart = one of your own apps entered or left a store top chart (overall + its category, free/paid/grossing). new_review = a new App Store review arrived for an own iOS app (needs App Store Connect connected and the review responder switched on for the app).
cadenceNonew_review only: email cadence. instant = within ~5 minutes of the review syncing, hourly = at most one email an hour, daily = the 08:30 UTC digest. Omit to keep the stored value (daily on create).
enabledNoWhether the rule is active. Defaults to enabled when omitted.
countriesNotop_chart only: storefronts to watch (ISO 3166-1 alpha-2, e.g. ["us", "de"]), max 10. Omit to keep the stored list; null or [] = the countries you track keywords in.
thresholdNoTrigger threshold; omit or null for the default. rank_drop / rank_gain: positions moved (default 5). rating_drop: tenths of a star (default 2 = a 0.2-star drop). review_spike: new reviews since the previous daily snapshot (default 25). top_chart: rank cutoff, 1-200 (default 200). new_review: highest star rating that alerts, 1-5 (default 5 = every review; 3 = only 1-3★). Ignored by entered_top10, left_top10, new_ranking, competitor_change.
scope_app_idNoLimit the alert to a single app (Sonar app UUID). Omit or null for an org-wide rule covering all tracked apps.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / cadence
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "instant",
      +        "hourly",
      +        "daily"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "new_review only: email cadence. instant = within ~5 minutes of the review syncing, hourly = at most one email an hour, daily = the 08:30 UTC digest. Omit to keep the stored value (daily on create)."
      +}
    • changedInput schema / properties / threshold / description
      Previous value: -"Trigger threshold; omit or null for the default. rank_drop / rank_gain: positions moved (default 5). rating_drop: tenths of a star (default 2 = a 0.2-star drop). review_spike: new reviews since the previous daily snapshot (default 25). top_chart: rank cutoff, 1-200 (default 200). Ignored by entered_top10, left_top10, new_ranking, competitor_change."New value: +"Trigger threshold; omit or null for the default. rank_drop / rank_gain: positions moved (default 5). rating_drop: tenths of a star (default 2 = a 0.2-star drop). review_spike: new reviews since the previous daily snapshot (default 25). top_chart: rank cutoff, 1-200 (default 200). new_review: highest star rating that alerts, 1-5 (default 5 = every review; 3 = only 1-3★). Ignored by entered_top10, left_top10, new_ranking, competitor_change."
    • changedInput schema / properties / type / description
      Previous value: -"The alert type to subscribe to. top_chart = one of your own apps entered or left a store top chart (overall + its category, free/paid/grossing)."New value: +"The alert type to subscribe to. top_chart = one of your own apps entered or left a store top chart (overall + its category, free/paid/grossing). new_review = a new App Store review arrived for an own iOS app (needs App Store Connect connected and the review responder switched on for the app)."
    • changedInput schema / properties / type / enum
      Previous value: -[
      -  "rank_drop",
      -  "rank_gain",
      -  "entered_top10",
      -  "left_top10",
      -  "new_ranking",
      -  "rating_drop",
      -  "review_spike",
      -  "competitor_change",
      -  "top_chart"
      -]New value: +[
      +  "rank_drop",
      +  "rank_gain",
      +  "entered_top10",
      +  "left_top10",
      +  "new_ranking",
      +  "rating_drop",
      +  "review_spike",
      +  "competitor_change",
      +  "top_chart",
      +  "new_review"
      +]
  2. Changed1 schema field changed
    • changedInput schema / properties / threshold / description
      Previous value: -"Sensitivity threshold (meaning depends on type; for top_chart it's the rank cutoff, 1-200, default 200). Omit or null to use the per-type default."New value: +"Trigger threshold; omit or null for the default. rank_drop / rank_gain: positions moved (default 5). rating_drop: tenths of a star (default 2 = a 0.2-star drop). review_spike: new reviews since the previous daily snapshot (default 25). top_chart: rank cutoff, 1-200 (default 200). Ignored by entered_top10, left_top10, new_ranking, competitor_change."
  3. Changed4 schema fields changed
    • addedInput schema / properties / countries
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "maxLength": 2,
      +        "minLength": 2,
      +        "type": "string"
      +      },
      +      "maxItems": 10,
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "top_chart only: storefronts to watch (ISO 3166-1 alpha-2, e.g. [\"us\", \"de\"]), max 10. Omit to keep the stored list; null or [] = the countries you track keywords in."
      +}
    • changedInput schema / properties / threshold / description
      Previous value: -"Sensitivity threshold (meaning depends on type). Omit or null to use the per-type default."New value: +"Sensitivity threshold (meaning depends on type; for top_chart it's the rank cutoff, 1-200, default 200). Omit or null to use the per-type default."
    • changedInput schema / properties / type / description
      Previous value: -"The alert type to subscribe to."New value: +"The alert type to subscribe to. top_chart = one of your own apps entered or left a store top chart (overall + its category, free/paid/grossing)."
    • changedInput schema / properties / type / enum
      Previous value: -[
      -  "rank_drop",
      -  "rank_gain",
      -  "entered_top10",
      -  "left_top10",
      -  "new_ranking",
      -  "rating_drop",
      -  "review_spike",
      -  "competitor_change"
      -]New value: +[
      +  "rank_drop",
      +  "rank_gain",
      +  "entered_top10",
      +  "left_top10",
      +  "new_ranking",
      +  "rating_drop",
      +  "review_spike",
      +  "competitor_change",
      +  "top_chart"
      +]
  4. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Goes well beyond the annotations (readOnlyHint=false, destructiveHint=false, idempotentHint=false, openWorldHint=false) by disclosing the upsert keying, the partial-merge behavior of omitted fields (keep stored value), the plan gate, and the authorization requirement. The upsert claim sits in mild tension with idempotentHint=false, and no failure/error behavior is described, keeping this at 4 rather than 5.

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?

Four dense sentences, front-loaded with the WRITE declaration and the core action, then keying semantics, then defaults, then prerequisites. No boilerplate or repetition; every sentence carries operational information.

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

Completeness4/5

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

Covers the prerequisites, defaults, and upsert semantics an agent needs to call a 6-parameter mutation correctly. With no output schema, the only real gap is what the call returns (e.g., the created/updated rule identifier), which would further help an agent chain into sonar_list_alerts.

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 description coverage is 100%, so parameter meaning is already largely carried by the schema, and several description statements (omit threshold/scope_app_id) restate it. The genuine addition is the composite key concept — 'upserts on (type + scope)' — which ties type and scope_app_id together in a way the schema alone does not express.

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?

Opens with a specific verb+resource+scope: 'create or update an alert subscription in the caller's Sonar workspace', and flags itself as a WRITE tool. The create/update framing cleanly separates it from sonar_list_alerts, sonar_delete_alert, and sonar_alert_events without needing to name them.

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

Usage Guidelines4/5

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

Gives clear operational context: it upserts on (type + scope), omit `threshold` for the per-type default, omit `scope_app_id` for an org-wide rule, and it requires an Indie plan plus write-scoped credentials. It stops short of explicitly naming alternative siblings or stating when *not* to use it (e.g., to modify vs. re-create), so it is strong context without full exclusion guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.