Skip to main content
Glama

get-clicks

Analyze and track outbound click activity from your WordPress site by specifying a URL, credentials, time period, and limit. Optimize links and monitor user behavior effectively.

Instructions

View a site's outbound clicks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of click items to return
passwordYesWordPress application password
periodNoTime period for stats
siteIdYesWordPress site ID
siteUrlYesWordPress site URL
usernameYesWordPress username

Implementation Reference

  • src/index.ts:1601-1650 (registration)
    Registration of the 'get-clicks' tool, including schema and inline handler function.
    server.tool(
      "get-clicks",
      "View a site's outbound clicks",
      {
        siteUrl: z.string().url().describe("WordPress site URL"),
        username: z.string().describe("WordPress username"),
        password: z.string().describe("WordPress application password"),
        siteId: z.number().describe("WordPress site ID"),
        period: z.enum(["day", "week", "month", "year"]).optional().describe("Time period for stats"),
        limit: z.number().min(1).max(100).optional().describe("Maximum number of click items to return"),
      },
      async ({ siteUrl, username, password, siteId, period = "week", limit = 10 }) => {
        try {
          const clicksData = await makeWPRequest<any>({
            siteUrl,
            endpoint: `sites/${siteId}/stats/clicks`,
            auth: { username, password },
            params: { period, limit }
          });
          
          // Format will depend on the actual API response
          const clicksText = Array.isArray(clicksData.clicks) && clicksData.clicks.length > 0
            ? clicksData.clicks.map((click: any) => 
                `${click.name || click.url || "Unknown URL"}
    Clicks: ${click.clicks || 0}
    URL: ${click.url || "No URL"}
    ---`
              ).join("\n")
            : "No outbound clicks found";
          
          return {
            content: [
              {
                type: "text",
                text: `Outbound Clicks for site #${siteId} (${period}):\n\n${clicksText}`,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error retrieving clicks data: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
          };
        }
      }
    );
  • The handler function that executes the tool logic: fetches outbound clicks stats from Jetpack Stats API endpoint `sites/${siteId}/stats/clicks`, formats the response, and returns it as text content.
      async ({ siteUrl, username, password, siteId, period = "week", limit = 10 }) => {
        try {
          const clicksData = await makeWPRequest<any>({
            siteUrl,
            endpoint: `sites/${siteId}/stats/clicks`,
            auth: { username, password },
            params: { period, limit }
          });
          
          // Format will depend on the actual API response
          const clicksText = Array.isArray(clicksData.clicks) && clicksData.clicks.length > 0
            ? clicksData.clicks.map((click: any) => 
                `${click.name || click.url || "Unknown URL"}
    Clicks: ${click.clicks || 0}
    URL: ${click.url || "No URL"}
    ---`
              ).join("\n")
            : "No outbound clicks found";
          
          return {
            content: [
              {
                type: "text",
                text: `Outbound Clicks for site #${siteId} (${period}):\n\n${clicksText}`,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error retrieving clicks data: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
          };
        }
      }
  • Input schema using Zod for validating parameters: siteUrl, username, password, siteId, period (optional), limit (optional).
      siteUrl: z.string().url().describe("WordPress site URL"),
      username: z.string().describe("WordPress username"),
      password: z.string().describe("WordPress application password"),
      siteId: z.number().describe("WordPress site ID"),
      period: z.enum(["day", "week", "month", "year"]).optional().describe("Time period for stats"),
      limit: z.number().min(1).max(100).optional().describe("Maximum number of click items to return"),
    },
Behavior2/5

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

With no annotations, the description carries full burden but only states 'View' without disclosing behavioral traits like authentication requirements (implied by parameters but not described), rate limits, or output format. It adds little beyond the basic action, leaving gaps in transparency.

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?

The description is a single, efficient sentence that front-loads the core purpose ('View a site's outbound clicks') with zero waste. It's appropriately sized for the tool's complexity, making it easy to parse.

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?

Given no annotations, no output schema, and 6 parameters (4 required), the description is incomplete. It lacks details on authentication needs, return values, or how parameters interact, making it inadequate for a tool with this complexity and missing structured data.

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 parameters are fully documented in the schema. The description adds no additional meaning beyond implying 'outbound clicks' as the data type, aligning with the baseline score for high schema coverage without extra param info.

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 clearly states the action ('View') and resource ('a site's outbound clicks'), providing specific functionality. However, it doesn't differentiate from sibling tools like 'get-site-stats' or 'get-referrers' that might also provide click-related data, preventing a perfect score.

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?

No guidance is provided on when to use this tool versus alternatives like 'get-site-stats' or 'get-referrers' from the sibling list. The description lacks context about prerequisites or typical scenarios, offering minimal usage direction.

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

Related 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/prathammanocha/wordpress-mcp-server'

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