Skip to main content
Glama
sudomichael

Gizmo Analytics

get_event_tracking_snippet

Read-onlyIdempotent

Retrieve a JavaScript snippet to fire custom events like signups or clicks from your site code. Add optional properties for later breakdown analysis.

Instructions

Return the JavaScript snippet for firing a custom event from the user's site code (e.g. window.gizmo("signup", {plan:"pro"})). Call this when the user says 'track signups', 'fire an event when someone clicks X', 'add custom event for Y', 'how do I track Z' — anything that means instrumenting a custom event in their codebase. The tracker script must already be installed (create_site or get_install_snippet handles that). After this call returns, EDIT the user's code to insert the snippet at the right code path — a click handler, a form-submit success branch, a router-change effect, etc. — based on what they're tracking. Don't just print the snippet; place it. Pass properties for any dimensions you want to break down later (plan, sku, variant, etc.); the dashboard can then roll up event counts by property via breakdown_by_property. Event name and property keys must be 1–64 chars, letters/digits/underscore (event name also allows dot and dash).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
event_nameYesName of the custom event to fire (1–64 chars, letters/digits/dot/dash/underscore). Examples: 'signup', 'cta_click', 'purchase'.
propertiesNoOptional key-value props attached to the event. Strings, numbers, or booleans. Keys must be [A-Za-z0-9_]{1,64}. Use to enable breakdown_by_property later (e.g. {plan:'pro'} → group signups by plan).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
languageYes
instructionsYes
codeYesJS call to fire the event: window.gizmo(...)
html_codeYesHTML variant for use inline in onclick='...' on a static page.
Behavior4/5

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

Annotations declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, openWorldHint=true. The description aligns by stating it returns a snippet (read-only). It adds valuable context: the need for the tracker to be pre-installed, event naming constraints (1-64 chars, specific characters), and property value types (strings, numbers, booleans). Does not contradict annotations.

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 well-structured with clear sentences, covering purpose, usage triggers, prerequisites, post-call action, and parameter details. It is slightly verbose but every sentence adds value. Front-loads the main purpose and examples.

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?

Given the presence of an output schema (context indicates true), the description does not need to detail return format. It covers all necessary aspects: input parameters, usage context, and behavioral expectations. The tool is simple (returns a snippet), so the description is complete.

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 coverage is 100%. The description adds meaning beyond the schema by providing example property values (e.g., {plan:'pro'}) and explaining the purpose of properties ('enable breakdown_by_property later'). It also clarifies event_name character rules with examples.

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 specifies 'return the JavaScript snippet for firing a custom event' with explicit examples like `window.gizmo("signup", {plan:"pro"})`. It clearly distinguishes from siblings like get_install_snippet (for installing the tracker) and get_badge_snippet, by focusing on custom event instrumentation.

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

Usage Guidelines5/5

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

The description provides explicit trigger phrases ('track signups', 'fire an event when someone clicks X'), prerequisites (tracker must already be installed, handled by create_site or get_install_snippet), and post-call action (EDIT the user's code to insert the snippet at the right code path). It also advises against merely printing the snippet.

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/sudomichael/gizmoanalytics-mcp'

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