Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.
PHP ai-agentsblueskyfacebookinstagramlaravellinkedinmastodonmcpmcp-serveropen-sourcerest-apiself-hostedsocial-mediasocial-media-managementsocial-media-schedulerthreadstiktokvuejsxyoutube
<?php
declare(strict_types=1);
namespace App\Mcp\Concerns;
use Illuminate\Contracts\JsonSchema\JsonSchema;
use Illuminate\JsonSchema\Types\ArrayType;
/**
* The `media` input of the post tools, described the same way everywhere. The
* rules live in `PostMediaRules::rules()`.
*/
trait DescribesPostMedia
{
protected function mediaSchema(JsonSchema $schema, string $description): ArrayType
{
return $schema->array()
->items($schema->object(fn (JsonSchema $item): array => [
'upload_token' => $item->string()->description('Token of a file uploaded earlier with request-media-upload-tool; valid once, before it expires. To use the same file on another post, pass the media id the first post returned.'),
'url' => $item->string()->description('Public http(s) URL that serves the file itself (a JPEG, PNG, GIF or WebP image, HEIC or HEIF when the server can convert it, an MP4 or MOV video, or a PDF; redirects are not followed and web pages are refused); downloaded once per call, within 20 seconds, up to the server limits (by default 10 MB and 67 megapixels for an image, 1 GB for a video, 100 MB for a PDF).'),
'id' => $item->string()->description('UUID of a media item of this workspace, as returned in a post\'s media (get-post-tool, list-posts-tool); copied for the post. An id already on the post keeps it, so send the current ids in the new order to reorder, and leave one out to remove it.'),
'alt' => $item->string()->description('Alt text for an image or a video (ignored for PDF; sent for a video only where supports_video_alt_text).'),
'meta' => $item->object()->description('Per-item settings: alt_text (string, up to 2000 characters; cut to the network limit, alt_text_max_length in list-content-types-tool, when published; sent for images where supports_alt_text, and for videos where supports_video_alt_text), user_tags (Instagram feed images only: up to 20 of {username, x, y}, x and y between 0 and 1 from the top-left corner), cover_offset_ms (video cover frame in milliseconds, for content types with supports_video_cover), cover (an image used as the video cover instead of a frame, for content types with supports_custom_video_cover: {upload_token}, {url} or {id} like a media item; a still image; the network crops it to the middle 9:16, so upload it at 9:16. YouTube applies it once the video is processed, and a channel that is not verified cannot take one), cover_source (frame or image: where the cover comes from, image when cover is sent without it; with frame, cover_offset_ms is the cover, and YouTube, which takes no frame time, uses cover as that frame\'s screenshot; a network that only takes a frame keeps cover_offset_ms and drops cover).'),
]))
->description("{$description} Items keep the order given (the first is the cover of a carousel). Each item gives exactly one of upload_token, url or id. A PDF must be the only attachment. Check the content type's media rules with list-content-types-tool.");
}
}