Skip to main content
Glama

get_site_logs

Retrieve deployment and site logs for a specific server to review application events and troubleshoot issues.

Instructions

Get deployment/site logs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
server_idYesThe ID of the server
site_idYesThe ID of the site

Implementation Reference

  • The get_site_logs tool is registered using server.tool() with the name 'get_site_logs'. It defines the input schema (server_id, site_id) and the handler that calls client.getSiteLogs().
    server.tool(
      "get_site_logs",
      "Get deployment/site logs",
      {
        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 }) => {
        try {
          const logs = await client.getSiteLogs(server_id, site_id);
          return {
            content: [
              {
                type: "text" as const,
                text: String(logs || "No logs available"),
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text" as const,
                text: `Error fetching site logs: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
          };
        }
      }
    );
  • The tool handler for get_site_logs: calls client.getSiteLogs(server_id, site_id), returns the logs as text, or an error message on failure.
      async ({ server_id, site_id }) => {
        try {
          const logs = await client.getSiteLogs(server_id, site_id);
          return {
            content: [
              {
                type: "text" as const,
                text: String(logs || "No logs available"),
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text" as const,
                text: `Error fetching site logs: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
          };
        }
      }
    );
  • Input schema for get_site_logs using Zod: server_id (coerced number) and site_id (coerced number).
    {
      server_id: z.coerce.number().describe("The ID of the server"),
      site_id: z.coerce.number().describe("The ID of the site"),
    },
  • The client helper method PloiClient.getSiteLogs() that makes a GET request to /servers/{serverId}/sites/{siteId}/log and formats the response data into a readable string.
    async getSiteLogs(serverId: number, siteId: number): Promise<string> {
      const response = await this.request<PaginatedResponse<{ id: number; description: string; content: string; type: string | null; created_at: string }>>(
        "GET",
        `/servers/${serverId}/sites/${siteId}/log`
      );
      if (!response.data || response.data.length === 0) return "No logs available";
      return response.data
        .map((entry) => `[${entry.created_at}] ${entry.description}\n${entry.content || ""}`)
        .join("\n---\n");
    }
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description does not disclose any behavioral traits such as authentication requirements, rate limits, log format, or retention. The agent gains no insight into side effects or operational constraints beyond the basic operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise (3 words) but sacrifices informativeness. It does not earn its place as it omits critical context about usage and behavior. While not verbose, it is under-specified.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite having only 2 parameters and no output schema, the description fails to convey expected outputs, filtering capabilities, or any other contextual details. It is not complete enough for effective tool selection.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% coverage with descriptions for both parameters ('server_id' and 'site_id'). The description adds no additional meaning beyond the schema, so it meets the baseline for a schema-described tool.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get deployment/site logs' clearly states the action (Get) and resource (logs for deployment/site), and is differentiated from the sibling 'get_server_logs' which focuses on server-level logs. However, it could be more specific about what constitutes 'site logs'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No usage guidelines are provided. The description does not specify when to use this tool versus alternatives like 'get_server_logs', nor does it mention prerequisites, context, or limitations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sudanese/ploi-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server