Skip to main content
Glama
growthbook

GrowthBook MCP Server

Official
by growthbook

get_projects

Retrieve project data from the GrowthBook API using pagination controls like 'limit' and 'offset' to manage the volume of returned results.

Instructions

Fetches all projects from the GrowthBook API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo

Implementation Reference

  • The core handler function for the 'get_projects' tool. It accepts pagination parameters (limit, offset), fetches the list of projects from the GrowthBook API (/api/v1/projects), handles the response, and returns the data as a formatted JSON string in the expected MCP content format.
    async ({ limit, offset }) => {
      const queryParams = new URLSearchParams({
        limit: limit.toString(),
        offset: offset.toString(),
      });
    
      try {
        const res = await fetch(
          `${baseApiUrl}/api/v1/projects?${queryParams.toString()}`,
          {
            headers: {
              Authorization: `Bearer ${apiKey}`,
              "Content-Type": "application/json",
            },
          }
        );
    
        await handleResNotOk(res);
    
        const data = await res.json();
        return {
          content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
        };
      } catch (error) {
        throw new Error(`Error fetching projects: ${error}`);
      }
    }
  • The direct registration of the 'get_projects' tool using server.tool(), including name, description, input schema (paginationSchema), options (readOnlyHint), and the handler function.
    server.tool(
      "get_projects",
      "Fetches all projects from the GrowthBook API",
      {
        ...paginationSchema,
      },
      {
        readOnlyHint: true,
      },
      async ({ limit, offset }) => {
        const queryParams = new URLSearchParams({
          limit: limit.toString(),
          offset: offset.toString(),
        });
    
        try {
          const res = await fetch(
            `${baseApiUrl}/api/v1/projects?${queryParams.toString()}`,
            {
              headers: {
                Authorization: `Bearer ${apiKey}`,
                "Content-Type": "application/json",
              },
            }
          );
    
          await handleResNotOk(res);
    
          const data = await res.json();
          return {
            content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
          };
        } catch (error) {
          throw new Error(`Error fetching projects: ${error}`);
        }
      }
    );
  • src/index.ts:69-73 (registration)
    Top-level call to registerProjectTools during server initialization, which in turn registers the 'get_projects' tool.
    registerProjectTools({
      server,
      baseApiUrl,
      apiKey,
    });
  • The Zod schema used for input validation of the 'get_projects' tool (and others), defining pagination parameters: limit, offset, mostRecent.
    export const paginationSchema = {
      limit: z
        .number()
        .min(1)
        .max(100)
        .default(100)
        .describe("The number of items to fetch (1-100)"),
      offset: z
        .number()
        .min(0)
        .default(0)
        .describe(
          "The number of items to skip. For example, set to 100 to fetch the second page with default limit. Note: The API returns items in chronological order (oldest first) by default."
        ),
      mostRecent: z
        .boolean()
        .default(false)
        .describe(
          "When true, fetches the most recent items and returns them newest-first. When false (default), returns oldest items first."
        ),
    } as const;
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'fetches' implies a read operation, it doesn't disclose important behavioral traits like authentication requirements, rate limits, pagination behavior (implied by limit/offset parameters but not explained), error conditions, or what 'all projects' means in terms of scope or permissions.

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 with zero waste. It's appropriately sized for a simple fetch operation and front-loads the essential information about what the tool does.

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 read operation with 2 parameters, 0% schema description coverage, no annotations, and no output schema, the description is insufficient. It doesn't explain what 'projects' are in this context, how results are structured, what authentication is required, or any limitations of the fetch operation. The agent would have significant gaps in understanding how to properly use this tool.

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?

With 0% schema description coverage for both parameters, the description provides no information about the 'limit' and 'offset' parameters. However, since there are only 2 parameters and they have default values in the schema, the baseline is 3. The description doesn't compensate for the lack of parameter documentation but doesn't make the situation worse.

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 ('fetches') and resource ('all projects from the GrowthBook API'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'get_experiments' or 'get_feature_flags' that also fetch different resources from the same API.

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. There's no mention of prerequisites, when-not-to-use scenarios, or comparisons to sibling tools like 'get_experiments' or 'get_feature_flags' that fetch different data types from the same API.

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/growthbook/growthbook-mcp'

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