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
List every MCP tool in one tools/list page (#429)
Paulo Castellanoa63045413eec
diff --git a/AGENTS.md b/AGENTS.mdindex 03f85d3ba..36b317f52 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -848,6 +848,10 @@ A controller serves **one resource**. Network-specific endpoints never pile up i- **MCP has no controllers**: one tool class per action (`app/Mcp/Tools/<Area>/<Verb><Resource>Tool.php`), never one tool that switches on the network.- Moving an endpoint between controllers keeps its URL and route name, so API clients see no change; the parity tests in `tests/Feature/Parity` must pass unchanged.+## MCP tools list in one page++`tools/list` returns every tool in a single response (owner decision October 2026): some MCP clients do not follow `nextCursor` and silently see only the first page. `TryPostServer` sets both `defaultPaginationLength` and `maxPaginationLength` to 200; laravel/mcp uses the smaller of the two, so raising only the default does nothing (the package's max is 50). The same page size applies to `resources/list`, `resources/templates/list` and `prompts/list`. Raise both before the server reaches 200 tools. A client may still ask for a smaller page (`per_page`, a laravel/mcp extension; the MCP spec only defines `cursor`) and follow `nextCursor`; a bigger request is capped at 200. `tests/Feature/Mcp/ToolListPaginationTest.php` calls the real endpoint and fails when the list is split.+## MCP tool annotations**Every MCP tool declares all three annotations explicitly, `false` included** (owner decision October 2026): `#[IsReadOnly(bool)]`, `#[IsDestructive(bool)]` and `#[IsOpenWorld(bool)]`, above its `#[Description]`. The OpenAI plugin directory refuses ("Not live") any tool without three explicit booleans, and the Claude directory requires `readOnlyHint` or `destructiveHint`. Annotations only describe the tool to the AI client (when to ask the user for confirmation); they never change what it does and are not rate limits.diff --git a/app/Mcp/Servers/TryPostServer.php b/app/Mcp/Servers/TryPostServer.phpindex 9e3ef7f9c..40afad8e5 100644--- a/app/Mcp/Servers/TryPostServer.php+++ b/app/Mcp/Servers/TryPostServer.php@@ -99,7 +99,9 @@ use Laravel\Mcp\Server\Attributes\Version;#[Instructions('TryPost is a social media scheduling platform. Use this server to manage posts (drafts, custom times, the channel queue and its free slots, recurrence, threads on X, Bluesky and Mastodon through meta.thread_replies, previews, notes and approvals), ideas, analytics, signatures, labels, social accounts and their posting times, workspaces, outgoing webhooks, repurposes (auto-replicating videos posted outside TryPost), and API keys. Call list-content-types-tool before choosing a content_type or attaching media: it lists the media rules, text and hashtag limits, thread support and the meta each network requires. Media is attached to a post by upload or URL; an upload is temporary, kept for 24 hours and single-use, and every post keeps its own copy of its files. Times are UTC. Members who need approval in a workspace can create and edit posts, but scheduling, queueing or publishing stores their post with status pending_approval until a member who publishes directly calls approve-post-tool or reject-post-tool; get-workspace-tool tells the caller which applies.')]class TryPostServer extends Server{- public int $defaultPaginationLength = 100;+ public int $defaultPaginationLength = 200;++ public int $maxPaginationLength = 200;protected array $tools = [ListPostsTool::class,diff --git a/tests/Feature/Mcp/ToolListPaginationTest.php b/tests/Feature/Mcp/ToolListPaginationTest.phpnew file mode 100644index 000000000..c42bc4cb6--- /dev/null+++ b/tests/Feature/Mcp/ToolListPaginationTest.php@@ -0,0 +1,55 @@+<?php++declare(strict_types=1);++use App\Mcp\Servers\TryPostServer;+use Illuminate\Testing\TestResponse;++beforeEach(function () {+ $result = createApiTestToken();+ subscribeAccount($result['user']->account);++ $this->token = mcpBearerToken($result['user'], $result['workspace'])['plain_token'];+ $this->registeredTools = count((new ReflectionClass(TryPostServer::class))->getDefaultProperties()['tools']);+});++/**+ * @param array<string, mixed> $params+ */+function listMcpTools(object $test, array $params = []): TestResponse+{+ return $test->withHeaders([+ 'Authorization' => "Bearer {$test->token}",+ 'Accept' => 'application/json, text/event-stream',+ ])->postJson(route('mcp.trypost'), [+ 'jsonrpc' => '2.0',+ 'id' => 1,+ 'method' => 'tools/list',+ 'params' => (object) $params,+ ])->assertSuccessful();+}++test('tools/list returns every registered tool in one page, without a next cursor', function () {+ $response = listMcpTools($this);++ expect($response->json('result.tools'))->toHaveCount($this->registeredTools)+ ->and($response->json('result'))->not->toHaveKey('nextCursor');+});++test('a client asking for a bigger page still gets one page of up to 200 tools', function () {+ $response = listMcpTools($this, ['per_page' => 1000]);++ expect($response->json('result.tools'))->toHaveCount($this->registeredTools)+ ->and($response->json('result'))->not->toHaveKey('nextCursor');+});++test('a client asking for a smaller page can still follow the cursor', function () {+ $first = listMcpTools($this, ['per_page' => 5]);+ $second = listMcpTools($this, ['per_page' => 5, 'cursor' => $first->json('result.nextCursor')]);++ expect($first->json('result.tools'))->toHaveCount(5)+ ->and($first->json('result.nextCursor'))->toBeString()+ ->and($second->json('result.tools'))->toHaveCount(5)+ ->and(collect($second->json('result.tools'))->pluck('name')->intersect(collect($first->json('result.tools'))->pluck('name')))+ ->toBeEmpty();+});