Skip to main content
Glama
tangivis

twikit-mcp

by tangivis

get_dm_history

Fetch a user's direct message history, including message details and pagination cursors, to review private conversations or walk back through older messages with max_id.

Instructions

Get DM conversation history with a user.

Note: Retrieves PRIVATE messages. Do not bulk-call. X has aggressive anti-spam on DMs and may suspend the account.

Returns JSON with messages (id/text/sender_id/recipient_id/time), next_cursor for pagination via max_id, and when present: timeline_events (non-message entries such as trust_conversation) and warnings (e.g. incomplete history for end-to-end encrypted / X Chat conversations — legacy DM history does not return ciphertext bodies after upgrade).

Args: screen_name: Twitter username (without @). max_id: If specified, retrieves messages older than this ID (for pagination). Pass the value from a previous response's next_cursor here on the next call to walk further back in time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
max_idNo
screen_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations, the description carries full behavioral disclosure. It details the return JSON structure (messages, next_cursor, timeline_events, warnings), pagination behavior (pass next_cursor to max_id), and edge-case caveats such as incomplete history for encrypted/X Chat conversations. This is unusually transparent about response format and limitations.

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 well-structured with a purpose sentence, a critical usage warning, a return-format explanation, and an Args list. Every section earns its place; the anti-spam warning and legacy-DM caveat are important risk/scope details. It is somewhat longer than minimal but appropriate for the tool's complexity.

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?

For a 2-parameter tool with no annotation context, the description covers purpose, usage warnings, return values, pagination, and limitations. Even though an output schema is signaled, the explicit return description is especially valuable. It leaves little ambiguity for an AI agent deciding to call this tool.

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 input schema provides zero parameter descriptions (0% coverage). The description compensates fully by explaining screen_name as 'Twitter username (without @)' and max_id as 'retrieves messages older than this ID' with explicit pagination instructions. This is exactly the semantic information an agent needs to invoke the tool correctly.

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 clearly states 'Get DM conversation history with a user' – a specific verb (Get) and resource (DM conversation history). The note about retrieving PRIVATE messages further clarifies the service's scope, distinguishing it from sibling tools like send_dm or xchat_get_history by focusing on a user's direct message history.

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?

The description provides explicit context that DMs are private and warns against bulk-calling due to X's aggressive anti-spam and suspension risk. It explains pagination usage via max_id and next_cursor, but does not explicitly name alternative tools like xchat_get_history for X Chat conversations, so it lacks a direct when-not-to-use comparison.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tangivis/twitter-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server