Skip to main content
Glama

get-streak-stats

Analyze WordPress site publishing activity by generating Calendar Heatmap stats using a secure API. Ideal for tracking and visualizing content productivity via site URL, username, password, and site ID.

Instructions

Get stats for Calendar Heatmap showing publishing activity

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
passwordYesWordPress application password
siteIdYesWordPress site ID
siteUrlYesWordPress site URL
usernameYesWordPress username

Implementation Reference

  • The handler function for the 'get-streak-stats' tool. It makes an API request to the WordPress Jetpack Stats endpoint `/sites/${siteId}/stats/streak`, processes the streak data by grouping publishing activity by month/year, formats it into a readable text summary, and returns it as a text content block. Handles errors gracefully.
    async ({ siteUrl, username, password, siteId }) => {
      try {
        const streakData = await makeWPRequest<any>({
          siteUrl,
          endpoint: `sites/${siteId}/stats/streak`,
          auth: { username, password }
        });
        
        let streakText = `Publishing Activity for site #${siteId}:\n\n`;
        
        if (streakData && Array.isArray(streakData.data)) {
          // Group by month/year for better readability
          const groupedByMonth: Record<string, any[]> = {};
          
          streakData.data.forEach((day: any) => {
            if (!day.date) return;
            
            const date = new Date(day.date);
            const monthYear = `${date.toLocaleString('default', { month: 'long' })} ${date.getFullYear()}`;
            
            if (!groupedByMonth[monthYear]) {
              groupedByMonth[monthYear] = [];
            }
            
            groupedByMonth[monthYear].push({
              date: date.toLocaleDateString(),
              count: day.count || 0
            });
          });
          
          // Format the output
          Object.keys(groupedByMonth).forEach(monthYear => {
            streakText += `${monthYear}:\n`;
            
            const days = groupedByMonth[monthYear];
            const activeDays = days.filter(day => day.count > 0);
            
            if (activeDays.length > 0) {
              streakText += activeDays.map(day => `${day.date}: ${day.count} post(s)`).join('\n');
            } else {
              streakText += "No publishing activity this month";
            }
            
            streakText += "\n\n";
          });
        } else {
          streakText += "No publishing activity data found.";
        }
        
        return {
          content: [
            {
              type: "text",
              text: streakText,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error retrieving streak stats: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
        };
      }
    }
  • Input schema for the 'get-streak-stats' tool using Zod validation. Requires WordPress site URL, credentials, and site ID.
    {
      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"),
    },
  • src/index.ts:1703-1780 (registration)
    Registration of the 'get-streak-stats' tool on the MCP server using server.tool(), including name, description, input schema, and handler function.
    server.tool(
      "get-streak-stats",
      "Get stats for Calendar Heatmap showing publishing activity",
      {
        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"),
      },
      async ({ siteUrl, username, password, siteId }) => {
        try {
          const streakData = await makeWPRequest<any>({
            siteUrl,
            endpoint: `sites/${siteId}/stats/streak`,
            auth: { username, password }
          });
          
          let streakText = `Publishing Activity for site #${siteId}:\n\n`;
          
          if (streakData && Array.isArray(streakData.data)) {
            // Group by month/year for better readability
            const groupedByMonth: Record<string, any[]> = {};
            
            streakData.data.forEach((day: any) => {
              if (!day.date) return;
              
              const date = new Date(day.date);
              const monthYear = `${date.toLocaleString('default', { month: 'long' })} ${date.getFullYear()}`;
              
              if (!groupedByMonth[monthYear]) {
                groupedByMonth[monthYear] = [];
              }
              
              groupedByMonth[monthYear].push({
                date: date.toLocaleDateString(),
                count: day.count || 0
              });
            });
            
            // Format the output
            Object.keys(groupedByMonth).forEach(monthYear => {
              streakText += `${monthYear}:\n`;
              
              const days = groupedByMonth[monthYear];
              const activeDays = days.filter(day => day.count > 0);
              
              if (activeDays.length > 0) {
                streakText += activeDays.map(day => `${day.date}: ${day.count} post(s)`).join('\n');
              } else {
                streakText += "No publishing activity this month";
              }
              
              streakText += "\n\n";
            });
          } else {
            streakText += "No publishing activity data found.";
          }
          
          return {
            content: [
              {
                type: "text",
                text: streakText,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error retrieving streak stats: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
          };
        }
      }
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'Get' implies a read operation, the description doesn't address authentication requirements (though parameters suggest WordPress auth), rate limits, error conditions, or what specific statistics are returned. For a tool with 4 required parameters and no annotation coverage, this is insufficient.

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 gets straight to the point with zero wasted words. It's appropriately sized for a tool with a clear purpose and doesn't suffer from verbosity or structural issues.

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?

For a tool with 4 required parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what statistics are returned, how they're formatted, what time periods are covered, or any behavioral aspects. The agent would need to guess about the tool's behavior and output based solely on the name and minimal description.

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 4 parameters with clear descriptions. The description doesn't add any meaningful parameter context beyond what's in the schema. The baseline score of 3 is appropriate when the schema does the heavy lifting for parameter documentation.

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 verb ('Get') and resource ('stats for Calendar Heatmap showing publishing activity'), making the purpose understandable. It distinguishes itself from siblings by focusing on streak/heatmap statistics rather than general stats, but doesn't explicitly differentiate from similar tools like 'get-post-stats' or 'get-site-stats'.

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?

The description provides no guidance on when to use this tool versus alternatives. With multiple sibling tools for retrieving statistics (get-post-stats, get-site-stats, get-stats-highlights, etc.), there's no indication of what makes this tool unique or when it's the appropriate choice.

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