Skip to main content
Glama
AdSense-MCP-Server

AdSense-MCP-Server

by AppsYogi-com

adsense_get_ad_code

Retrieves the HTML embed code for a Google AdSense ad unit using its ad client ID and ad unit ID, so you can place ads on a webpage.

Instructions

Get the HTML embed code for an ad unit

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": {
      "adClientId": "<adClientId>",
      "adUnitId": "<adUnitId>"
    },
    "name": "adsense_get_ad_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
adUnitIdYesAd unit ID
accountIdNoAdSense account ID. Uses default if not specified.
adClientIdYesAd client ID (e.g., ca-pub-1234567890123456)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.2

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the behavioral burden. It discloses the core behavior (retrieving an HTML embed code, implying a read operation) and the return type, but says nothing about authentication needs, quota impact, error behavior if the ad unit is missing, or whether the operation has side effects.

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

Conciseness5/5

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

A single, front-loaded sentence with no redundant wording. Every word earns its place and the purpose is immediately clear.

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 simple read tool with fully documented parameters and no output schema, the description is mostly complete: it names the return value (HTML embed code) and the target resource. The only notable gap is the lack of any behavioral note about authentication or error handling, which keeps it from being fully complete.

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 all three parameters are already documented in the input schema. The description adds no syntax, format, or behavioral detail about adClientId, adUnitId, or the optional accountId default, so baseline 3 is appropriate.

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 gives a specific verb ('Get') and resource ('HTML embed code for an ad unit'), which clearly distinguishes it from sibling listing and reporting tools. It stops short of explicitly naming a sibling or stating what it is not, so it is clear but not maximally differentiated.

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

Usage Guidelines2/5

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

There is no explicit when-to-use guidance, no prerequisites, and no mention of alternatives such as adsense_list_ad_units. The use case is only implied by the phrase 'for an ad unit', leaving the agent to infer context.

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