Skip to main content
Glama
competlab

competlab-mcp-server

list_projects

Retrieve a list of all projects in your organization, including status, competitor count, and last monitored timestamp. Use this to obtain projectId values needed for other tools.

Instructions

List all projects in your organization with status, competitor count, and last monitored timestamp. Start here — call this first to discover available projectId values required by all other tools. Read-only. Returns JSON array of projects.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/tools.ts:30-36 (registration)
    Registration of the 'list_projects' tool as a ToolDef entry in the tools array. It has no parameters, an empty zod object schema, and maps to GET /v1/projects.
    {
      name: "list_projects",
      description:
        "List all projects in your organization with status, competitor count, and last monitored timestamp. Start here — call this first to discover available projectId values required by all other tools. Read-only. Returns JSON array of projects.",
      parameters: z.object({}),
      path: () => "/v1/projects",
    },
  • The 'list_projects' tool definition including its empty parameters schema (z.object({})).
    export const tools: ToolDef[] = [
      // ── Projects ──────────────────────────────────────────────
      {
        name: "list_projects",
        description:
          "List all projects in your organization with status, competitor count, and last monitored timestamp. Start here — call this first to discover available projectId values required by all other tools. Read-only. Returns JSON array of projects.",
        parameters: z.object({}),
        path: () => "/v1/projects",
      },
  • Generic handler loop that registers and executes all tools (including list_projects) on the MCP server. The handler calls tool.path(args) to get the API endpoint, builds query params, and calls apiGet.
    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);
      });
    }
  • The apiGet helper function that makes HTTP GET requests to the CompetLab API with the CL-API-Key header. Used by all tool handlers to fetch data.
    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,
        };
      }
    }
Behavior4/5

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

With no annotations, the description carries full burden. It declares the tool is read-only and returns a JSON array, but lacks details on pagination, rate limits, or auth requirements. However, for a simple zero-parameter tool, this is adequate.

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?

Three efficient sentences: purpose+output fields, usage guidance, and behavioral note. No wasted words; front-loaded with key information.

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?

For a simple list tool with no parameters and no output schema, the description covers purpose, output fields, usage context, and safety. It mentions returning all projects and doesn't omit critical aspects.

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?

No parameters exist, so schema coverage is 100%. Baseline 4 is appropriate; the description adds no parameter info because none are needed.

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?

The description clearly states the tool lists all projects in an organization, specifies returned fields (status, competitor count, last monitored timestamp), and mentions return type. It distinguishes itself from sibling tools by being the starting point to discover projectId values required by other tools.

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 'Start here — call this first to discover available projectId values required by all other tools,' providing clear when-to-use guidance. Also declares read-only nature, which helps in 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/competlab/competlab-mcp-server'

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