Skip to main content
Glama

post_tweet_with_image

Post a tweet with an attached image to Twitter. Accepts local image files (JPEG, PNG, GIF, WebP), text up to 280 characters, and optional reply threading.

Instructions

Posts a new tweet with an attached image file to the authenticated Twitter/X account. Use this tool when the LLM needs to publish a status update that includes a photo, graphic, screenshot, or any visual media. The image is uploaded from a local filesystem path (supports JPEG, PNG, GIF, WebP). The accompanying text must be 280 characters or fewer. Optionally accepts a reply_to_tweet_id for threaded replies. Returns the created tweet object with ID, text, author, and timestamp. Falls back to the standard Twitter API v2 media upload endpoint.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesThe main body text of the tweet. Maximum 280 characters. This text accompanies the uploaded image in the tweet post.
image_pathYesAbsolute or relative filesystem path to the image file to upload and attach to the tweet. Supported formats: JPEG, PNG, GIF, WebP. The file must exist and be readable at the time of invocation.
reply_to_tweet_idNoThe unique numeric ID of an existing tweet to reply to. When provided, the new tweet-with-image will be posted as a threaded reply. Omit for a standalone tweet.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusYesIndicates the outcome of the operation: "success" or "error".
messageYesA human-readable summary of the result, e.g. "Tweet posted successfully".
dataYesContainer holding the created tweet details.
Behavior4/5

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

No annotations are provided, so the description must fully disclose behavior. It details the required file existence, supported formats, character limit, optional reply threading, return object fields, and even mentions the underlying API fallback. Doesn't explicitly state authentication or rate limits, but overall transparent about operation.

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?

Four sentences, each earning its place: purpose/usage, file constraints, character limit + threading option, return value and backend note. Front-loaded with the main action. No unnecessary words or repetition.

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?

Given the moderate complexity (3 params, no nested objects, output schema present), the description covers purpose, usage, parameters, and return. Missing details on error handling or rate limits, but sufficient for an agent to invoke correctly. Output schema supplements return info.

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

Parameters4/5

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

Schema coverage is 100% (all 3 parameters described in schema). The description adds value by explaining image_path as a filesystem path with supported formats and existence requirement, and clarifies that reply_to_tweet_id is a numeric ID for threading. This goes beyond the schema alone.

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?

Description clearly states it posts a new tweet with an attached image, distinguishing itself from siblings like post_tweet (text-only) and search_tweets (search). The verb 'Posts' and resource 'new tweet with an attached image file' are specific and unambiguous.

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?

Explicitly states when to use ('when the LLM needs to publish a status update that includes a photo...') and implies when not by mentioning alternatives (post_tweet for text-only). Also explains optional reply_to_tweet_id for threaded context. Lacks explicit rate limits or prerequisites, but provides clear context.

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/GenAIwithMS/twitter-mcp'

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