logly_realtime
See which visitors are currently active on a site. Provide the site ID to fetch real-time data from the last few minutes.
Instructions
Visitors currently active on a site (real-time, the last few minutes).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | Yes | Logly site ID (slug). Call logly_list_sites to discover it. |
Implementation Reference
- index.js:76-81 (registration)Registration of the 'logly_realtime' tool via the 'tool()' helper function. Line 76-81 define the tool name, description, schema (site arg), and the handler callback.
tool( "logly_realtime", "Visitors currently active on a site (real-time, the last few minutes).", { site: siteArg }, ({ site }) => loglyApi(`/api/sites/${encodeURIComponent(site)}/active`) ); - index.js:80-80 (handler)Handler function for logly_realtime: makes an API call to `/api/sites/{site}/active` using the loglyApi helper.
({ site }) => loglyApi(`/api/sites/${encodeURIComponent(site)}/active`) - index.js:79-79 (schema)Schema for logly_realtime: expects a 'site' argument (string, described as 'Logly site ID (slug)') — defined via the shared 'siteArg' on line 47.
{ site: siteArg }, - index.js:37-45 (helper)The 'tool()' helper that wraps server.tool() with error handling. All tool registrations (including logly_realtime) use this helper.
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 }; } }); }