Skip to main content
Glama
draiqw
by draiqw

tg_rules

Idempotent

Update Telegram alert rules and automations by merging a patch into current settings: configure alerts, digests, and inbox filters.

Instructions

Update alert rules. Keys: enabled, alert_on_private, alert_on_mention, keywords (list), watch_chats (list), mute_chats (list), ignore_bots, min_interval_sec, quiet_hours ([start_hour, end_hour] or null).

Two more keys drive automation the daemon runs on its own, with no Claude session involved: digest_at (["09:00", "20:00"] local time — a summary of the period into the owner's bot) and auto (inbox filters: a condition — chat, from, keyword, type — plus a safe reversible action out of read, archive, mute, folder, save). Filter actions never write to another person: save forwards to Saved Messages and nothing else can send anything at all. A rule that fires suppresses the alert for that message unless it sets alert: true. Full description of both sections is in docs/configuration.md.

Call tg_status first to see current values; this merges on top of them.

The confirm_* keys (write confirmation mode and its chat whitelist) are the owner's restriction on you, not a setting of yours: they are rejected here and are edited by hand in data/rules.json only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patchYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Even with annotations present (idempotentHint=true, destructiveHint=false), the description adds high-value behavioral context: it explains merge/patch semantics, that digest_at and auto run in a daemon without Claude, that filter actions are safe and reversible, that save only writes to Saved Messages, and that a rule suppresses alerts unless alert:true. This exceeds what the annotations alone reveal.

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 long but information-dense and well organized: the simple rule keys come first, then automation keys, safety constraints, and exclusions. Every sentence adds necessary behavior or semantics, and the pointer to docs/configuration.md keeps it from growing even longer.

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?

For a complex patch tool with no output schema, the description covers the input surface almost completely — key names, types, merge behavior, safety, and restrictions. It does not state what the call returns or how invalid patches are handled, but the detailed key semantics plus docs reference make it sufficient for correct invocation.

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

Parameters5/5

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

The schema is nearly empty (a single patch object with additionalProperties true), so the description carries the entire parameter burden. It lists all valid keys with their value shapes, nested structure for digest_at and auto, and explicitly rejects confirm_* keys. This fully compensates for 0% schema description coverage.

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 opens with a specific verb and resource — 'Update alert rules' — and then enumerates the keys it manages, including the automation-only digest_at and auto. It also distinguishes itself from tg_status by telling the agent to call that sibling first, and clarifies that confirm_* keys are not handled here.

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?

It gives an explicit workflow: call tg_status first because tg_rules merges onto current values. It also names an exclusion — confirm_* keys are rejected and must be edited by hand in data/rules.json — which tells the agent when not to use this tool.

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