MCP Tools Reference
The schedpilot-mcp package exposes six tools to MCP-compatible AI agents. This page documents each tool's inputs, outputs, and typical usage patterns.
All tools authenticate using the SCHEDPILOT_TOKEN environment variable. Both API keys (smm_...) and OAuth tokens (sp_tok_...) are accepted.
Tool 1: get_accounts
Retrieve all social media accounts connected to the authenticated SchedPilot user.
Inputs
This tool takes no input parameters.
Returns
An array of connected account objects.
| Field | Type | Description |
|---|---|---|
id | integer | Account ID. Used in create_post. |
name | string | Display name of the account. |
type | string | Platform identifier (e.g. "twitter", "linkedin", "instagram", "facebook", "bluesky", "threads"). |
username | string | The account handle or username on the platform. |
Example agent prompt
"Show me all my connected SchedPilot accounts."
Tool 2: list_posts
Retrieve a paginated list of posts, optionally filtered by status or date range.
Inputs
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
status | string | No | all | Filter by post status. One of: scheduled, posted, failed, draft, pending_approval. Omit to return all. |
start_date | string | No | — | Return posts scheduled on or after this date. Format: YYYY-MM-DD. |
end_date | string | No | — | Return posts scheduled on or before this date. Format: YYYY-MM-DD. |
page | integer | No | 1 | Page number for pagination. |
per_page | integer | No | 20 | Results per page. Maximum 100. |
Returns
A paginated list of post objects, each including post_id, content, platform, account_id, status, scheduled_date, and (for published posts) platform_post_id.
Example agent prompts
"Show me my last 5 scheduled posts."
"List all posts that failed to publish this week."
"Show me everything scheduled between June 1 and June 7."
Tool 3: create_post
Schedule a new post on one or more connected accounts.
Inputs
| Parameter | Type | Required | Description |
|---|---|---|---|
content | string | Yes | The text body of the post. Check platform character limits before submitting. |
scheduled_date | string | Yes | When to publish. Format: "YYYY-MM-DD HH:MM:SS". Interpreted in the timezone provided. |
timezone | string | No (default: UTC) | IANA timezone name, e.g. "America/New_York" or "Europe/London". |
accounts | array | Yes | One or more account targets. Each item is an object with id (integer) and type (string) matching a connected account from get_accounts. |
image_ids | array of strings | No | Media IDs of images to attach (from upload_media). Cannot be combined with video_ids. |
video_ids | array of strings | No | Media IDs of videos to attach (from upload_media). Cannot be combined with image_ids. |
Returns
The newly created post object, including the assigned post_id.
Example agent prompts
"Schedule a tweet saying 'Big news tomorrow!' for June 20 at 9am Eastern time."
"Post the image I just uploaded to both my Twitter and LinkedIn accounts at noon UTC today."
Tool 4: delete_post
Delete a scheduled or draft post. Published posts cannot be deleted through the API.
Inputs
| Parameter | Type | Required | Description |
|---|---|---|---|
post_id | integer | Yes | The ID of the post to delete, as returned by list_posts or create_post. |
Returns
A confirmation object indicating the post was deleted.
Example agent prompts
"Delete post 1042."
"Cancel the tweet I just scheduled — delete post 1055."
Tool 5: upload_media
Download a publicly accessible image or video from a URL and add it to the SchedPilot media library. Returns a media_id that can be used in create_post.
Inputs
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Yes | A fully qualified public URL pointing to the image or video to upload. The SchedPilot server must be able to fetch this URL. |
filename | string | No | An optional filename hint (e.g. "product-banner.jpg"). Used as the file title in the media library. |
Returns
An object with media_id, type ("image" or "video"), and mime_type. Pass the media_id to create_post.
Example agent prompts
"Upload the image at https://example.com/promo.jpg so I can use it in a post."
"Fetch the video from https://cdn.example.com/demo.mp4 and schedule a LinkedIn post with it."
Tool 6: get_analytics
Retrieve engagement analytics for a published post.
Inputs
| Parameter | Type | Required | Description |
|---|---|---|---|
post_id | integer | Yes | The ID of the post to retrieve analytics for. The post must have status: "posted". |
Returns
An analytics object containing platform-reported metrics such as impressions, likes, shares, comments, and clicks (fields vary by platform).
Example agent prompts
"Get the analytics for post 987."
"How did my tweet from last Monday perform? The post ID is 1001."
Typical Agent Workflows
Workflow A: Schedule a tweet with an image
This is the most common multi-step workflow. The agent calls three tools in sequence:
1. get_accounts
→ finds the Twitter account id (e.g. id: 3, type: "twitter")
2. upload_media { url: "https://example.com/banner.jpg" }
→ returns { media_id: "image-55", type: "image", ... }
3. create_post {
content: "Check out our summer sale! 🌞",
scheduled_date: "2024-06-20 09:00:00",
timezone: "America/New_York",
accounts: [{ id: 3, type: "twitter" }],
image_ids: ["image-55"]
}
→ returns { post_id: 1099, status: "scheduled", ... }
Workflow B: Review analytics on recent posts
1. list_posts { status: "posted", per_page: 5 }
→ returns 5 recently published posts with their post_ids
2. get_analytics { post_id: 1085 }
3. get_analytics { post_id: 1086 }
4. get_analytics { post_id: 1087 }
→ agent compares engagement across posts and summarizes for the user
Authentication Note
All six tools read the SCHEDPILOT_TOKEN environment variable set in your MCP client config. You do not need to pass the token as a tool parameter — it is handled transparently by the MCP server.
Both authentication methods work:
| Token type | Prefix | Obtained from |
|---|---|---|
| Personal API key | smm_ | app.schedpilot.com/api-access |
| OAuth access token | sp_tok_ | OAuth 2.0 flow |