Skip to main content
Glama
Jameswlepage

WordPress Trac MCP Server

by Jameswlepage

getTimeline

Retrieve recent WordPress Trac activity including tickets, commits, and events to track development progress and changes.

Instructions

Get recent activity from WordPress Trac timeline including recent tickets, commits, and other events.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNoNumber of days to look back (default: 7, max: 30)
limitNoMaximum number of events to return (default: 20, max: 100)

Implementation Reference

  • src/index.ts:120-138 (registration)
    Registration of the getTimeline tool in the tools/list response, including its input schema.
    {
      name: "getTimeline",
      description: "Get recent activity from WordPress Trac timeline including recent tickets, commits, and other events.",
      inputSchema: {
        type: "object",
        properties: {
          days: {
            type: "number",
            description: "Number of days to look back (default: 7, max: 30)",
            default: 7,
          },
          limit: {
            type: "number",
            description: "Maximum number of events to return (default: 20, max: 100)",
            default: 20,
          },
        },
      },
    },
  • Main handler implementation for the getTimeline tool within the tools/call switch statement. Fetches RSS timeline from Trac, parses events, and formats results.
    case "getTimeline": {
      const { days = 7, limit = 20 } = args;
      
      try {
        const timelineUrl = `https://core.trac.wordpress.org/timeline?from=${days}%2Bdays+ago&max=${Math.min(limit, 100)}&format=rss`;
        
        const response = await fetch(timelineUrl, {
          headers: {
            'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
          }
        });
    
        if (!response.ok) {
          throw new Error(`Failed to fetch timeline: ${response.statusText}`);
        }
    
        const rssText = await response.text();
        
        // Better RSS parsing with multiple pattern attempts
        const itemMatches = rssText.match(/<item>([\s\S]*?)<\/item>/g);
        const events = [];
        
        if (itemMatches) {
          for (const itemMatch of itemMatches) {
            // Try CDATA patterns first
            let titleMatch = itemMatch.match(/<title><!\[CDATA\[(.*?)\]\]><\/title>/s);
            let linkMatch = itemMatch.match(/<link>(.*?)<\/link>/s);
            let descMatch = itemMatch.match(/<description><!\[CDATA\[(.*?)\]\]><\/description>/s);
            let dateMatch = itemMatch.match(/<pubDate>(.*?)<\/pubDate>/s);
            let creatorMatch = itemMatch.match(/<dc:creator>(.*?)<\/dc:creator>/s);
            
            // Fallback to non-CDATA patterns
            if (!titleMatch) {
              titleMatch = itemMatch.match(/<title>(.*?)<\/title>/s);
            }
            if (!descMatch) {
              descMatch = itemMatch.match(/<description>(.*?)<\/description>/s);
            }
            
            if (titleMatch && linkMatch) {
              const title = titleMatch[1]?.trim() || 'Unknown Event';
              const link = linkMatch[1]?.trim() || '';
              const description = descMatch ? descMatch[1]?.replace(/<[^>]*>/g, '').trim() : '';
              const date = dateMatch ? dateMatch[1]?.trim() : '';
              const creator = creatorMatch ? creatorMatch[1]?.trim() : '';
              
              events.push({
                id: link || `event-${events.length}`,
                title,
                text: `${title}\n\nAuthor: ${creator || 'Unknown'}\nDate: ${date || 'Unknown'}\n\n${description || 'No description available'}`,
                url: link,
                metadata: {
                  date,
                  author: creator,
                  description,
                },
              });
            }
          }
        }
    
        result = {
          results: events,
          totalEvents: events.length,
          daysBack: days,
          timelineUrl: 'https://core.trac.wordpress.org/timeline',
        };
      } catch (error) {
        result = {
          results: [],
          error: error instanceof Error ? error.message : 'Unknown error',
          daysBack: days,
          timelineUrl: 'https://core.trac.wordpress.org/timeline',
        };
      }
      break;
  • Helper function getTimelineForChatGPT used in ChatGPT-specific MCP handler for timeline queries.
    async function getTimelineForChatGPT(days: number, limit: number) {
      try {
        const timelineUrl = `https://core.trac.wordpress.org/timeline?from=${days}%2Bdays+ago&max=${Math.min(limit, 100)}&format=rss`;
        
        const response = await fetch(timelineUrl, {
          headers: {
            'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
          }
        });
    
        if (!response.ok) {
          throw new Error(`Failed to fetch timeline: ${response.statusText}`);
        }
    
        const rssText = await response.text();
        const itemMatches = rssText.match(/<item>([\s\S]*?)<\/item>/g);
        const results = [];
        
        if (itemMatches) {
          for (const itemMatch of itemMatches) {
            let titleMatch = itemMatch.match(/<title><!\[CDATA\[(.*?)\]\]><\/title>/s);
            let linkMatch = itemMatch.match(/<link>(.*?)<\/link>/s);
            let descMatch = itemMatch.match(/<description><!\[CDATA\[(.*?)\]\]><\/description>/s);
            let dateMatch = itemMatch.match(/<pubDate>(.*?)<\/pubDate>/s);
            let creatorMatch = itemMatch.match(/<dc:creator>(.*?)<\/dc:creator>/s);
            
            if (!titleMatch) titleMatch = itemMatch.match(/<title>(.*?)<\/title>/s);
            if (!descMatch) descMatch = itemMatch.match(/<description>(.*?)<\/description>/s);
            
            if (titleMatch && linkMatch) {
              const title = titleMatch[1]?.trim() || 'Unknown Event';
              const link = linkMatch[1]?.trim() || '';
              const description = descMatch ? descMatch[1]?.replace(/<[^>]*>/g, '').trim() : '';
              const date = dateMatch ? dateMatch[1]?.trim() : '';
              const creator = creatorMatch ? creatorMatch[1]?.trim() : '';
              
              results.push({
                id: link || `event-${results.length}`,
                title,
                text: `${title}\n\nAuthor: ${creator || 'Unknown'}\nDate: ${date || 'Unknown'}\n\n${description || 'No description available'}`,
                url: link,
                metadata: { date, author: creator, description },
              });
            }
          }
        }
    
        return { results };
      } catch (error) {
        return { results: [], error: error instanceof Error ? error.message : 'Unknown error' };
      }
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the tool 'gets' activity, implying a read-only operation, but doesn't specify aspects like rate limits, authentication needs, or what happens if parameters exceed limits. It adds minimal context beyond the basic action.

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 key action and resource, with no wasted words. It directly conveys the tool's purpose without unnecessary elaboration, making it highly concise and well-structured.

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

Completeness3/5

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

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is adequate but incomplete. It covers the basic purpose but lacks details on behavioral traits, usage guidelines, and output format, which are important for a read operation with configurable parameters.

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?

The input schema has 100% description coverage, detailing both parameters with defaults and limits. The description adds no additional parameter semantics beyond what the schema provides, such as explaining how 'days' and 'limit' interact or the format of returned events. Baseline 3 is appropriate as the schema handles the heavy lifting.

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 tool's purpose with specific verbs ('Get recent activity') and resources ('WordPress Trac timeline'), including the types of events covered ('recent tickets, commits, and other events'). However, it doesn't explicitly differentiate from sibling tools like getChangeset or getTicket, which might handle similar data but with different scopes or formats.

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 like getChangeset or getTicket, nor does it mention any prerequisites or exclusions. It implies usage for retrieving recent activity but lacks explicit context for tool selection.

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/Jameswlepage/trac-mcp'

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