Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/mcp/local-tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
scrapeTweets,
searchTweets,
scrapeThread,
scrapePost,
scrapeLikes,
scrapeMedia,
scrapeListMembers,
Expand Down Expand Up @@ -202,6 +203,11 @@ export async function x_get_thread({ url }) {
return scrapeThread(pg, url);
}

export async function x_read_post({ url }) {
const { page: pg } = await ensureBrowser();
return scrapePost(pg, url);
}

export async function x_best_time_to_post({ username, limit = 100 }) {
const { page: pg } = await ensureBrowser();
const tweets = await scrapeTweets(pg, username, { limit });
Expand Down Expand Up @@ -1346,6 +1352,7 @@ export const toolMap = {
x_get_tweets,
x_search_tweets,
x_get_thread,
x_read_post,
x_best_time_to_post,
// Core actions
x_follow,
Expand Down
11 changes: 11 additions & 0 deletions src/mcp/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,17 @@ const TOOLS = [
required: ['url'],
},
},
{
name: 'x_read_post',
description: 'Read a tweet/post with full rich data. Returns thread if the post is part of one (author self-replies only). Recursively resolves quoted tweets — if a quoted tweet is itself a thread or contains its own quote tweet, those are fetched too. Each tweet includes: text, media (images + video URLs), X Articles, cards (link previews), external URLs, and engagement stats.',
inputSchema: {
type: 'object',
properties: {
url: { type: 'string', description: 'URL of the tweet/post' },
},
required: ['url'],
},
},
// ====== Posting Analytics ======
{
name: 'x_best_time_to_post',
Expand Down
2 changes: 2 additions & 0 deletions src/scrapers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export const {
scrapeTweets,
searchTweets,
scrapeThread,
scrapePost,
scrapeLikes,
scrapeHashtag,
scrapeMedia,
Expand Down Expand Up @@ -308,6 +309,7 @@ export default {
scrapeTweets,
searchTweets,
scrapeThread,
scrapePost,
scrapeLikes,
scrapeHashtag,
scrapeMedia,
Expand Down
Loading