Skip to main content
Glama
competlab

competlab-mcp-server

get_content_changelog

Track content changes across competitors: detect new, removed, and moved URLs. Filter by competitor or content category to monitor specific updates without full run comparisons.

Instructions

Get detected content changes over time — new URLs, removed URLs, moved URLs. Filter by competitor and/or content category (e.g., blog, docs, tools, landing, caseStudies). Use this instead of comparing full runs when you only need to know what changed. Complements get_content_dashboard which shows the current state. Read-only. Returns paginated JSON array with pagination.hasMore flag.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject ID (from list_projects)
pageNoPage number (1-indexed, default: 1)
limitNoItems per page (default: 20, max: 100)
competitorIdNoFilter by competitor ID (from list_competitors)
categoryNoFilter by content category

Implementation Reference

  • Tool definition including name, description, Zod schema for parameters (projectId, pagination, optional competitorId, optional category enum), path, and queryParams for 'get_content_changelog'.
    {
      name: "get_content_changelog",
      description:
        "Get detected content changes over time — new URLs, removed URLs, moved URLs. Filter by competitor and/or content category (e.g., blog, docs, tools, landing, caseStudies). Use this instead of comparing full runs when you only need to know what changed. Complements get_content_dashboard which shows the current state. Read-only. Returns paginated JSON array with pagination.hasMore flag.",
      parameters: z.object({
        projectId: objectId("Project ID (from list_projects)"),
        ...pagination,
        competitorId: z
          .string()
          .optional()
          .describe("Filter by competitor ID (from list_competitors)"),
        category: z
          .enum([
            "blog",
            "docs",
            "tools",
            "landing",
            "legal",
            "caseStudies",
            "comparison",
            "integrations",
            "changelog",
            "webinars",
            "other",
          ])
          .optional()
          .describe("Filter by content category"),
      }),
      path: (a) => `/v1/projects/${a.projectId}/content/changelog`,
      queryParams: ["page", "limit", "competitorId", "category"],
    },
  • src/index.ts:14-25 (registration)
    Generic tool registration loop — iterates over all tools (including get_content_changelog) and registers them via server.tool().
    // ── Tools ───────────────────────────────────────────────────
    
    for (const tool of tools) {
      server.tool(tool.name, tool.description, tool.parameters.shape, async (args: Record<string, any>) => {
        const path = tool.path(args);
        const query: Record<string, any> = {};
        for (const key of tool.queryParams ?? []) {
          if (args[key] !== undefined) query[key] = args[key];
        }
        return apiGet(path, Object.keys(query).length ? query : undefined);
      });
    }
  • Handler function for all tools (including get_content_changelog). Dynamically builds the API path from tool.path(args), collects query parameters from tool.queryParams, and calls apiGet() to make the HTTP GET request to the CompetLab API.
    for (const tool of tools) {
      server.tool(tool.name, tool.description, tool.parameters.shape, async (args: Record<string, any>) => {
        const path = tool.path(args);
        const query: Record<string, any> = {};
        for (const key of tool.queryParams ?? []) {
          if (args[key] !== undefined) query[key] = args[key];
        }
        return apiGet(path, Object.keys(query).length ? query : undefined);
      });
  • API client helper — apiGet() function used by all tool handlers. Builds the full URL, adds query params, calls fetch with CL-API-Key header, and returns the response text wrapped in the MCP content format.
    const API_BASE = "https://api.competlab.com";
    
    export async function apiGet(
      path: string,
      query?: Record<string, string | number>,
    ): Promise<{ content: Array<{ type: "text"; text: string }>; isError?: true }> {
      const apiKey = process.env.COMPETLAB_API_KEY;
      if (!apiKey) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                error: "api_key_missing",
                message: "COMPETLAB_API_KEY environment variable is not set",
              }),
            },
          ],
          isError: true,
        };
      }
    
      const url = new URL(`${API_BASE}${path}`);
      if (query) {
        for (const [k, v] of Object.entries(query)) {
          if (v !== undefined) url.searchParams.set(k, String(v));
        }
      }
    
      try {
        const res = await fetch(url, {
          headers: { "CL-API-Key": apiKey },
        });
    
        const body = await res.text();
    
        if (!res.ok) {
          return { content: [{ type: "text", text: body }], isError: true };
        }
    
        return { content: [{ type: "text", text: body }] };
      } catch (err) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                error: "api_unreachable",
                message:
                  err instanceof Error ? err.message : "Failed to reach CompetLab API",
                status: 503,
              }),
            },
          ],
          isError: true,
        };
      }
    }
Behavior5/5

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

Discloses read-only nature, paginated return with hasMore flag, and no side effects. With no annotations, the description fully covers behavioral traits.

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?

Every sentence adds value: purpose, usage, filtering, comparison, read-only, return format. No wasted words, front-loaded with key info.

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

Completeness5/5

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

Despite no output schema, description covers return format (paginated JSON with hasMore). With 5 parameters and 1 required, the description provides sufficient context for an agent to use correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All 5 parameters have schema descriptions (100% coverage). The description adds context by grouping filters (competitor, category) and listing example categories, adding value beyond schema.

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

Purpose5/5

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

Specific verb 'get' and resource 'content changelog' with clear output: new, removed, moved URLs. Distinguishes from sibling get_content_dashboard (current state) and get_content_history (full runs).

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

Usage Guidelines5/5

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

Explicitly states when to use ('only need to know what changed'), when not to ('instead of comparing full runs'), and names alternative tool (get_content_dashboard). Also mentions filtering options.

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/competlab/competlab-mcp-server'

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