list_sites
List all sites on a server by providing the server ID.
Instructions
List all sites on a server
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server_id | Yes | The ID of the server |
Implementation Reference
- src/tools/sites.ts:26-44 (registration)The registerSiteTools function registers 'list_sites' and all other site tools on the MCP server.
export function registerSiteTools(server: McpServer, client: PloiClient) { server.tool( "list_sites", "List all sites on a server", { server_id: z.coerce.number().describe("The ID of the server"), }, async ({ server_id }) => { const sites = await client.listSites(server_id); return { content: [ { type: "text" as const, text: JSON.stringify(sites, null, 2), }, ], }; } ); - src/tools/sites.ts:33-43 (handler)The handler for the 'list_sites' tool: calls client.listSites(server_id) and returns the sites as JSON.
async ({ server_id }) => { const sites = await client.listSites(server_id); return { content: [ { type: "text" as const, text: JSON.stringify(sites, null, 2), }, ], }; } - src/tools/sites.ts:30-32 (schema)Input schema for 'list_sites' tool: requires a server_id (coerced to number).
{ server_id: z.coerce.number().describe("The ID of the server"), }, - src/client.ts:139-145 (helper)The client.listSites method that makes the actual HTTP GET request to /servers/{serverId}/sites and returns paginated site data.
async listSites(serverId: number): Promise<Site[]> { const response = await this.request<PaginatedResponse<Site>>( "GET", `/servers/${serverId}/sites` ); return response.data; }