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.

Input Schema

TableJSON 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).
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.
thresholdNoSensitivity 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.
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 / 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"
      +]
  2. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations indicate readOnlyHint=false, which aligns with the description's 'WRITE tool' and 'create or update' wording, so there is no contradiction. The description adds valuable behavioral context beyond annotations: it discloses the upsert semantics, the dependency on an Indie plan, and the need for authorization/API key write scope. This goes beyond what annotations provide.

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 three sentences with no fluff. It front-loads the core purpose, then the upsert behavior, then the key usage notes. Every sentence adds information an agent needs to call the tool correctly.

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?

The description covers the tool's purpose, write behavior, upsert semantics, parameter defaults, and authorization requirements. There is no output schema, but the description does not describe the response format or error behavior. For a write tool this is a minor gap; an agent knows it will return a confirmation or the created/updated alert, but explicit guidance would be slightly better.

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 each parameter is documented in the schema. The description adds extra usage semantics: for `threshold` it clarifies omitting uses per-type default; for `scope_app_id` it clarifies omitting makes an org-wide rule. It also expands on the `top_chart` type in the enum description. This adds meaning beyond the schema's basic descriptions.

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?

The description clearly states the tool is a write tool that creates or updates alert subscriptions, with explicit reference to the resource (alert subscription) and scope (caller's Sonar workspace). It also distinguishes itself from siblings like sonar_list_alerts and sonar_delete_alert by focusing on create/update.

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

Usage Guidelines5/5

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

The description explains when to use the tool (to create/update alerts) and provides concrete usage guidance: how to trigger an update (re-submitting same type/scope), how to use defaults (omit threshold, omit scope_app_id), and what conditions apply (Indie plan, authorized account). It implicitly routes to alternatives like listing or deleting alerts, which are clearly distinct siblings.

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.