Skip to main content
Glama
telegram-mcp

telegram-mcp

by Maxsh

get_private_messages

Retrieve messages from a private Telegram chat by contact username, phone number, or user ID, with filters for date, time range, message limit, and pagination.

Instructions

Get messages from a private chat conversation

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": {
      "contact": "<contact>"
    },
    "name": "get_private_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
tzNoIANA time zone used to resolve date-only sinceDate and 'today'/'yesterday' (e.g., Europe/Kyiv). Default: UTC
limitNoNumber of messages to retrieve (default: 10, max: 100)
contactYesContact identifier: username (@username), phone number (+1234567890), or user ID
offsetIdNoReturn messages older than this message ID (pass nextOffsetId from the previous page to paginate)
sinceDateNoGet messages since this date. Accepts a full ISO datetime, a plain date (midnight in tz), or 'today' / 'yesterday'
sinceHoursNoGet messages from the last N hours
sinceMinutesNoGet messages from the last N minutes
maxTextLengthNoTruncate each message text to this many characters

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.1.0
    • addedInput schema / properties / maxTextLength
      Added value: +{
      +  "description": "Truncate each message text to this many characters",
      +  "minimum": 1,
      +  "type": "number"
      +}
    • addedInput schema / properties / offsetId
      Added value: +{
      +  "description": "Return messages older than this message ID (pass nextOffsetId from the previous page to paginate)",
      +  "type": "number"
      +}
    • changedInput schema / properties / sinceDate / description
      Previous value: -"Get messages since this date (ISO format: 2023-12-01T10:00:00Z)"New value: +"Get messages since this date. Accepts a full ISO datetime, a plain date (midnight in tz), or 'today' / 'yesterday'"
    • addedInput schema / properties / tz
      Added value: +{
      +  "description": "IANA time zone used to resolve date-only sinceDate and 'today'/'yesterday' (e.g., Europe/Kyiv). Default: UTC",
      +  "type": "string"
      +}
  2. First observedv1.0.0

TDQS

C2.8/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden, yet it only says messages are returned. It says nothing about pagination semantics (offsetId/nextOffsetId), ordering (newest-first vs oldest-first), whether messages are marked read, rate limits, or auth requirements — all relevant for an 8-parameter message-fetch tool.

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

Conciseness3/5

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

The single sentence is efficient and front-loaded with the action, with no filler. However, its brevity reflects under-specification rather than disciplined concision for a tool with eight parameters and pagination.

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

Completeness2/5

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

With eight parameters, multiple time-window filters, cursor pagination, no annotations, and no output schema, the description is far too thin to let an agent invoke it confidently. It omits ordering, return shape, filter precedence, and how pagination should be driven, all of which the schema alone does not fully resolve.

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 description coverage is 100%, so every parameter (contact, tz, limit, offsetId, sinceDate, sinceHours, sinceMinutes, maxTextLength) is already documented in the schema. The description adds no filter, format, or precedence meaning beyond that, so the baseline of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource ('Get messages from a private chat conversation'), which is clearer than the bare tool name alone. It does not differentiate from siblings such as get_messages_multi, get_recent_messages, or search_messages, so an agent cannot tell from this text alone which retrieval tool fits which case.

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

Usage Guidelines2/5

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

There is no guidance on when to use this versus the several other message-retrieval siblings, nor any prerequisites such as authorization state or chat-existence requirements. The agent must infer usage entirely from the tool name.

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