Skip to main content
Glama
mkroo
by mkroo

get_ad_snippet

Generate framework-specific ad integration code for React, Next.js, Vue, Astro, Svelte, and HTML. Provide publisher ID, slot ID, and style to get ready-to-use AdSense snippets.

Instructions

Generate framework-specific ad integration code (React, Next.js, Vue, Astro, Svelte, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
styleNoAd placement styleresponsive
widthNoWidth in px (only for "fixed" style)
heightNoHeight in px (only for "fixed" style)
slotIdYesAd unit slot ID (e.g., 1234567890)
frameworkYesTarget framework
publisherIdYesPublisher ID (e.g., ca-pub-1234567890123456)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.1/5.0
Behavior2/5

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

With no annotations, the description carries the full burden of disclosing behavior. It only says code is generated, but does not clarify whether this is a pure, side-effect-free operation, whether it validates ad unit existence, what the output format is, or whether any account changes occur. The absence of such detail for a code-generation tool with no output schema is a significant gap.

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 single sentence is efficient, front-loaded with the action and resource, and uses a compact parenthetical to list frameworks. No wasted words or redundancy. It is concise, though it could be slightly expanded to include behavioral or usage context without becoming verbose.

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

Completeness2/5

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

There is no output schema and no annotations, so the description must provide a complete picture. It covers the core purpose but omits the return format, preconditions (e.g., required ad unit existence), permissions, and how it relates to get_ad_code. For a tool with six parameters and overlapping siblings, this one-line description is under-specified.

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 description coverage is 100%, so the schema already documents all parameters (framework, publisherId, slotId, style, width, height). The description adds no parameter-specific meaning beyond echoing some framework names that are already in the enum. Baseline 3 is appropriate because the schema carries the parameter documentation burden.

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

Purpose4/5

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

The description uses a specific verb ('Generate') with a clear resource ('framework-specific ad integration code') and gives concrete framework examples (React, Next.js, Vue, Astro, Svelte). It signals differentiation from the sibling get_ad_code by focusing on frameworks, but it does not explicitly name the alternative or define the contrast, so it stops short of full sibling differentiation.

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

Usage Guidelines3/5

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

The phrase 'framework-specific' and the framework list imply when to use this tool, but no explicit guidance is given about when not to use it or which sibling to prefer. For example, it does not state that get_ad_code should be used for plain HTML or that this tool is for JavaScript frameworks. Usage context is implied, not stated.

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