Skip to main content
Glama
alamri-intel

Telegram OSINT

by alamri-intel

preview_rule

Test a candidate Telegram alert rule against real message history to see what it would match before creating it, so you can judge if it is too broad or narrow.

Instructions

Test a candidate rule against real message history before creating it.

Shows what the rule would have matched, so the user can judge whether it is too broad or too narrow while they are still writing it. Creates nothing. Use this during setup, before add_alert_rule, and show the user the samples — a rule that looks sensible in the abstract often turns out to match mostly noise.

The matched samples are also the right input for testing draft criteria: read them and decide which ones a criterion should keep, then tell the user which would have been surfaced and which filtered out.

Args: pattern: the candidate pattern. match_type: 'substring', 'word', or 'regex'. case_sensitive: match case exactly. chat_ids: restrict to these chats; omit to search everywhere. search_hint: a plain word to search Telegram for when match_type is 'regex' — Telegram cannot search by regex, so this narrows what gets scanned locally. Required for an unscoped regex preview. limit: max samples to return. scan: how many messages to pull and test.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scanNo
limitNo
patternYes
chat_idsNo
match_typeNosubstring
search_hintNo
case_sensitiveNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

No annotations exist, so the description carries the burden and does well: it declares 'Creates nothing' (read-only semantics) and discloses a non-obvious platform constraint — Telegram cannot search by regex, hence search_hint narrows what is scanned locally. It stops short of stating cost/latency implications of a large scan.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core purpose, then caveats, then the args block. Slightly wordy in the middle paragraph about draft criteria, but each sentence carries actionable content.

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 7-param, annotation-free, no-output-schema preview tool, the description covers purpose, side-effect profile, workflow routing, and every parameter. Only return-shape details and scan-cost behavior are left implicit.

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?

With 0% schema description coverage the description must compensate, and it documents all seven parameters. The search_hint explanation (required for an unscoped regex preview, and why) and the match_type enum values are genuinely useful; the remaining entries are terse but adequate.

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?

States a specific verb+resource: test a candidate rule against real message history before creating it. It also explicitly distinguishes itself from the mutation sibling add_alert_rule and from list/search tools via 'Creates nothing.'

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?

Explicit when-to-use: 'Use this during setup, before add_alert_rule,' plus a follow-on workflow ('show the user the samples'). It also names a second use case — testing draft criteria — and says which samples to feed it.

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