Skip to main content
Glama

Auto-add analytics line

setSiteAutoInject
Idempotent

Turn the automatic addition of the collect line to STATIC deployments on or off — the Analytics page’s own switch, on the same owned project. Requires confirmed: true, representing the human’s agreement to this exact change for this exact projectId: with it on, that one line is added to the root index.html of the next site Tofu publishes from the submitted source, so it loads a script from Tofu’s domain into that site’s visitors’ pages, and turning it off and deploying again removes it. A deployment Tofu has to build (a framework build, or a project whose preset is not confirmed yet) never gets the line whichever way the switch is set. Returns the counter’s new state: the key, the line, the switch and what the last deployment got. It never edits the files you uploaded, and it cannot change what a visitor’s page counts by itself.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "projectId": "<projectId>",
      "enabled": "<enabled>",
      "confirmed": "<confirmed>"
    },
    "name": "setSiteAutoInject"
  }
}

Input Schema

NameRequiredDescriptionDefault
enabledYes
confirmedYes
projectIdYes

Output Schema

NameRequiredDescriptionDefault
noticeYes
siteKeyYes
snippetYes
availableYes
autoInjectYes
lastInjectionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses that the change takes effect on the NEXT deployment's root index.html, that the injected script loads from Tofu's domain into visitors' pages, that turning it off plus redeploying removes the line, that uploaded files are never edited, and that this setting alone cannot change what a page counts. These are exactly the side-effect details an agent needs before committing a human-confirmed write.

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

Conciseness3/5

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

The purpose is front-loaded, which is good, but the body is one long clause-chained sentence with em-dashes and parentheticals that is hard to parse on first read. The content mostly earns its place, yet splitting the side effects and the build-exemption caveat into separate sentences would materially improve scanability.

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

Completeness4/5

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

For a three-parameter mutation with an output schema, the description covers prerequisites, deployment-time effects, exemptions, and non-effects on uploaded files, so an agent can call it safely. Only the ownership/scoping semantics of projectId remain thin, which is a minor gap given the UUID format in the schema.

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?

Schema description coverage is 0%, so the description must carry the parameters, and it does explain `confirmed` (human agreement to this exact change for this exact projectId) and the semantics of `enabled` (on adds the line to the next deployment, off plus redeploy removes it). `projectId` is only implied via "the same owned project," leaving its ownership/scoping requirement somewhat implicit.

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?

States a specific verb and resource: turning automated insertion of the collect line on or off for STATIC deployments on an owned project. It also distinguishes itself from the sibling reading tool by calling itself "the Analytics page's own switch," so the agent can tell it apart from siteAnalytics without opening a schema.

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?

Gives a clear when-it-applies rule (static deployments only; framework builds or unconfirmed presets never get the line) and a hard prerequisite (`confirmed: true` must represent human agreement for this exact projectId). It does not explicitly name an alternative sibling to use for reading analytics state, but the usage context is otherwise unambiguous.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources