Skip to main content
Glama
logly-uk

Logly MCP server

Official
by logly-uk

logly_events

Retrieve custom event counts for a site, using events sent via logly('event', ...), over a configurable time period (days or date range).

Instructions

Custom event counts for a site (events sent via logly('event', ...)) over the given period.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteYesLogly site ID (slug). Call logly_list_sites to discover it.
daysNoDays to look back: 7, 30 or 90. Defaults to 30. Ignored when 'from'/'to' are set.
fromNoRange start, YYYY-MM-DD. Use together with 'to'.
toNoRange end, YYYY-MM-DD. Use together with 'from'.

Implementation Reference

  • index.js:83-89 (handler)
    The logly_events tool handler: calls the Logly API at /api/sites/{site}/events with a date range, returning custom event counts for the site.
    tool(
      "logly_events",
      "Custom event counts for a site (events sent via logly('event', ...)) over the given period.",
      { site: siteArg, days: daysArg, from: fromArg, to: toArg },
      ({ site, days, from, to }) =>
        loglyApi(`/api/sites/${encodeURIComponent(site)}/events`, range({ days, from, to }))
    );
  • Zod schemas reused by logly_events: siteArg (required string), daysArg (optional positive int), fromArg/toArg (optional date strings).
    const siteArg = z.string().describe("Logly site ID (slug). Call logly_list_sites to discover it.");
    const daysArg = z.number().int().positive().optional()
      .describe("Days to look back: 7, 30 or 90. Defaults to 30. Ignored when 'from'/'to' are set.");
    const fromArg = z.string().optional().describe("Range start, YYYY-MM-DD. Use together with 'to'.");
    const toArg = z.string().optional().describe("Range end, YYYY-MM-DD. Use together with 'from'.");
  • index.js:37-45 (registration)
    Helper function that registers any tool with the McpServer. logly_events is registered via this helper on line 83.
    function tool(name, description, shape, fn) {
      server.tool(name, description, shape, async (args) => {
        try {
          return { content: [{ type: "text", text: await fn(args || {}) }] };
        } catch (e) {
          return { content: [{ type: "text", text: "Error: " + e.message }], isError: true };
        }
      });
    }
  • Date range helper: if explicit from/to provided, uses those; otherwise falls back to a days window (default 30). Used by logly_events to build query params.
    function range({ days, from, to }) {
      if (from || to) return { from, to };
      return { days: days ?? 30 };
    }
  • index.js:8-27 (helper)
    Core API helper used by logly_events: authenticates with LOGLY_API_KEY, builds URL with query params, and fetches data from the Logly API.
    async function loglyApi(path, params) {
      const key = process.env.LOGLY_API_KEY;
      if (!key) {
        throw new Error(
          "LOGLY_API_KEY is not set. Create one in Logly → Settings → API keys."
        );
      }
      const url = new URL(BASE + path);
      for (const [k, v] of Object.entries(params || {})) {
        if (v !== undefined && v !== null && v !== "") url.searchParams.set(k, String(v));
      }
      const res = await fetch(url, {
        headers: { Authorization: `Bearer ${key}`, Accept: "application/json" },
      });
      const text = await res.text();
      if (!res.ok) {
        throw new Error(`Logly API ${res.status} on ${path}: ${text.slice(0, 300)}`);
      }
      return text;
    }
Behavior2/5

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

No annotations are provided, so the description must carry the burden. It does not disclose whether the tool is read-only, requires permissions, or any side effects. The description is minimal and adds no behavioral context 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.

Conciseness5/5

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

The description is a single sentence, concise and to the point, with no wasted words. It front-loads the core purpose.

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

Completeness3/5

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

The tool is simple, but the description omits what the return value looks like (no output schema). It is adequate for a basic query but could mention the output format or limits.

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?

Schema coverage is 100%, with each parameter having a description. The description adds context about event source ('events sent via logly('event', ...)') but does not significantly enhance understanding beyond the schema.

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

Purpose5/5

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

The description clearly specifies the tool's function: retrieving custom event counts for a site over a given period. It distinguishes from siblings like logly_breakdown (breakdowns) and logly_funnel_results (funnels) by focusing on aggregate event counts.

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 explicit guidance on when to use this tool versus alternatives (e.g., logly_breakdown for breakdowns). The description does not provide context for when this tool is appropriate.

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/logly-uk/logly-mcp'

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