Skip to main content
Glama
kotlogramme

kotlogramme

Count matching messages

telegram_count_messages
Read-onlyIdempotent

Count messages matching a text in one chat or across all chats without returning them. Use it to size a search before reading results.

Instructions

Counts the messages that match a text, in one chat or across all of them, without returning them. Use it to size a search before reading the results.

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": {
      "query": "<query>"
    },
    "name": "telegram_count_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
chatNoOnly count in this chat. The chat: 'me' for Saved Messages, an @username, or a numeric chat id as listed by telegram_list_chats. Invite links are not accepted.
queryYesThe text to look for.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.11.1

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, open-world behavior, so the bar is lower. The description still adds a genuinely useful fact beyond them: it returns only a tally, not message bodies, which matters because no output schema exists to convey that.

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?

Two sentences with no filler, leading with what is counted and what is not returned, then the reason to call it. Nothing could be cut without losing 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?

For a two-parameter read-only tool with full schema coverage and annotations carrying the safety profile, the description covers purpose, scope, and use case adequately. The only small gap is not stating outright that the result is a single number.

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

Parameters3/5

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

Schema coverage is 100%, and the schema already spells out the chat identifier formats ('me', @username, numeric id, no invite links) and the query max length. The description only restates the one-chat/all-chats choice, adding no syntax or format detail beyond the schema, so the baseline 3 applies.

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 (counts) and resource (messages matching a text), plus the scope dimension (one chat or all). The phrase 'without returning them' distinguishes it immediately from the sibling search tool, so an agent need not open either schema.

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?

'Use it to size a search before reading the results' gives a clear positive usage context and implicitly routes result-reading to a different tool. It does not name the alternative explicitly or state any when-not condition, which keeps it short of a 5.

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