Skip to main content
Glama
logly-uk

Logly MCP server

Official
by logly-uk

logly_install_snippet

Generate the Logly tracking tag to add to a site's . Works offline without an API call.

Instructions

Return the Logly tracking snippet for a site — the single tag to add to the site's . Works offline, no API call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteYesLogly site ID (slug). Call logly_list_sites to discover it.

Implementation Reference

  • The tool handler for 'logly_install_snippet'. It returns a JSON string containing the site ID, the <script> snippet tag, and installation instructions. Works offline (no API call).
    tool(
      "logly_install_snippet",
      "Return the Logly tracking snippet for a site — the single <script> tag to add to the site's <head>. Works offline, no API call.",
      { site: siteArg },
      ({ site }) =>
        JSON.stringify(
          {
            site,
            snippet: `<script src="https://logly.uk/p.js?s=${site}" data-site="${site}" async></script>`,
            instructions:
              "Add this tag inside the <head> of every page. It is a single cookie-free tag — no other setup needed.",
          },
          null,
          2
        )
    );
  • index.js:37-45 (registration)
    The generic 'tool' wrapper function that registers each tool with the McpServer (line 38: server.tool(...)). This is how 'logly_install_snippet' gets registered.
    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 };
        }
      });
    }
  • The 'site' argument schema used by the tool — a string describing the Logly site ID (slug).
    const siteArg = z.string().describe("Logly site ID (slug). Call logly_list_sites to discover it.");
Behavior4/5

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

Without annotations, the description transparently discloses that the tool works offline and makes no API call. It does not detail error handling or authentication, but for a simple snippet retrieval, this is sufficient.

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

Conciseness4/5

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

The description is a single, front-loaded sentence that efficiently conveys the tool's purpose and key behavior. Slightly more structure could improve readability, but it is already concise.

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

Completeness5/5

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

Given the low complexity (one parameter, no output schema), the description is complete: it states what is returned, how to find the site ID, and that it works offline.

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

Parameters4/5

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

The schema already covers 'site' with a description, but the description adds value by noting it's a slug and suggesting logly_list_sites to discover it, aiding the agent in parameter selection.

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 states it returns the Logly tracking snippet as a single <script> tag, which distinguishes it from sibling tools like logly_stats or logly_events that deal with analytics data.

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

Usage Guidelines4/5

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

It specifies 'works offline, no API call', informing the agent that this is a lightweight operation. However, it does not explicitly mention when to use it versus alternatives, but the sibling list provides implicit context.

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