get_site
Retrieve details for a specific site by providing server and site IDs. Get site configuration, status, and metadata to manage deployments and server integration efficiently.
Instructions
Get details of a specific site
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server_id | Yes | The ID of the server | |
| site_id | Yes | The ID of the site |
Implementation Reference
- src/tools/sites.ts:46-64 (registration)The 'get_site' tool is registered on the MCP server via server.tool() with Zod schema for server_id and site_id parameters.
server.tool( "get_site", "Get details of a specific site", { server_id: z.coerce.number().describe("The ID of the server"), site_id: z.coerce.number().describe("The ID of the site"), }, async ({ server_id, site_id }) => { const site = await client.getSite(server_id, site_id); return { content: [ { type: "text" as const, text: JSON.stringify(site, null, 2), }, ], }; } ); - src/tools/sites.ts:53-63 (handler)The handler function for 'get_site': calls client.getSite(server_id, site_id) and returns the site object as JSON text content.
async ({ server_id, site_id }) => { const site = await client.getSite(server_id, site_id); return { content: [ { type: "text" as const, text: JSON.stringify(site, null, 2), }, ], }; } - src/tools/sites.ts:49-52 (schema)Input schema for 'get_site' using Zod: server_id (coerced number) and site_id (coerced number), each with a description.
{ server_id: z.coerce.number().describe("The ID of the server"), site_id: z.coerce.number().describe("The ID of the site"), }, - src/client.ts:147-153 (helper)The PloiClient.getSite() method that makes the actual GET request to /servers/{serverId}/sites/{siteId} and returns the Site data.
async getSite(serverId: number, siteId: number): Promise<Site> { const response = await this.request<ApiResponse<Site>>( "GET", `/servers/${serverId}/sites/${siteId}` ); return response.data; } - src/client.ts:19-31 (helper)The Site interface defining the shape of the data returned by get_site (id, server_id, domain, status, etc.).
export interface Site { id: number; server_id: number; domain: string; deploy_script: string | null; web_directory: string; project_type: string; php_version: string; status: string; has_repository: boolean; zero_downtime_deployment: boolean; created_at: string; }