Skip to main content
Glama
draiqw
by draiqw

tg_wait

Read-onlyIdempotent

Wait for a matching Telegram message in a chat, from a user, or containing a keyword. Blocks until it arrives or times out, returning got=false when nothing arrives—so no polling loop needed.

Instructions

Block until a matching message arrives, then return it.

This is the right way to "wait for their reply" — the daemon is already listening to Telegram, so waiting costs nothing and misses nothing. Do not poll tg_events in a loop instead.

Returns got=false on timeout; that means nothing arrived, not that something failed.

Args: chat: only messages in this chat (id, @username or exact title). from_user: only messages from this person (id, @username or name). keyword: only messages whose text contains this. timeout: seconds to wait, 5 to 600. private_only: ignore groups and channels.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chatNo
keywordNo
timeoutNo
from_userNo
private_onlyNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A5/5.0
Behavior5/5

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

Beyond the read-only/idempotent annotations, the description discloses crucial runtime behavior: the daemon is already listening so no messages are missed, the call blocks up to timeout, and got=false specifically means timeout rather than failure. This is real behavioral context the annotations cannot convey.

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?

Every sentence earns its place: core behavior, when-to-use guidance, timeout semantics, and a compact parameter list. The critical guidance is front-loaded before the parameter listing, with no filler.

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

Completeness5/5

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

Despite lacking an output schema, the description explains the success/failure return semantics (message vs. got=false on timeout), how matching filters work, and how this tool interacts with the daemon. An agent has everything needed to invoke it correctly.

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 has 0% description coverage, so the description carries the full burden. It explains all five parameters with their matching semantics: chat filters by chat, from_user filters by person, keyword does text containment, timeout has a 5-to-600 range, and private_only ignores groups/channels.

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: 'Block until a matching message arrives, then return it.' It clearly describes the tool's core behavior and distinguishes it from event-pulling siblings like tg_events and tg_history.

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?

Explicitly tells the agent when to use this tool: 'This is the right way to "wait for their reply"' and warns against polling tg_events in a loop. This direct alternative-naming and exclusion is exactly what the dimension asks for.

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