Skip to main content
Glama
TwitterAPIs

twitterapis

twitter_dm_send

Send a direct message to a user by providing their numeric ID and message text, requiring authenticated session and residential proxy for reliable delivery. Returns message ID and conversation ID.

Instructions

Send a Direct Message AS your authenticated account. Provide the recipient's numeric user id (recipient_id, resolve a @handle with twitter_user_info first) and the message text. Requires an authenticated session with write capability behind your key; X soft-blocks writes from datacenter IPs, so route through a residential proxy_url for reliability. Returns message_id and conversation_id. Delivers a real DM and is not silently reversible.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ct0NoOptional. The account's ct0 cookie, paired with auth_token. Sent as the x-ct0 header.
textYesThe Direct Message body text to send (non-empty).
proxy_urlNoOptional. Residential proxy URL to egress this call through. Recommended for writes: X soft-blocks writes from datacenter IPs as automated. Sent as the x-proxy-url header.
auth_tokenNoOptional. The account's auth_token cookie, to act AS that account for this call (must be paired with ct0). Sent as the x-auth-token header; never placed in the URL.
user_agentNoOptional. User-Agent string to send for this session. Sent as the x-user-agent header.
recipient_idYesNumeric Twitter/X user id of the recipient (e.g. '44196397'). Resolve a @handle to its id with twitter_user_info first. The recipient must allow DMs from you.
Behavior5/5

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

The description discloses that it sends a real, non-silently reversible DM, which goes beyond the readOnlyHint=false annotation. It also reveals the need for residential proxy to avoid IP-based blocks, and notes that it returns message_id and conversation_id. No contradictions with annotations; adds actionable behavioral context.

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 a single, information-dense sentence that front-loads the primary action. Every clause serves a purpose: action, destination, prerequisite, proxy recommendation, return info, and irreversibility warning. No redundant fluff; well-structured for quick agent comprehension.

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 write operation with auth and proxy requirements, the description covers all critical aspects: authentication, IP restrictions, parameter handling, and irreversibility. It also specifies the return fields, compensating for the lack of an output schema. Given the tool's complexity, this is complete.

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?

With 100% schema coverage, the baseline is 3, but the description enriches parameter meaning: it explains the necessity of numeric recipient_id and how to resolve handles, recommends proxy_url for reliability, and clarifies that text must be non-empty. These practical hints are not in the schema, adding significant value.

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 the action: send a Direct Message as the authenticated account. It specifies the resource (DM) and distinguishes itself from sibling read tools like twitter_dm_list and twitter_dm_conversation. It also notes this is a real, irreversible action, setting it apart from other write tools.

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?

Provides explicit directives: resolve recipient_id via twitter_user_info, require authenticated session with write capability, and recommend residential proxy for reliability due to X's soft-blocking of datacenter IPs. It effectively tells the agent when and how to use the tool, including prerequisites and alternatives for handle resolution.

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/TwitterAPIs/twitterapis-mcp'

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