Skip to main content
Glama
growthbook

GrowthBook MCP Server

Official
by growthbook

get_sdk_connections

Retrieve SDK connections to enable apps to fetch features and experiments via a public client key. Specify project, limit, and offset for targeted results.

Instructions

Get all SDK connections, which are how GrowthBook connects to an app. Importantly, users need the key, which is a public client key that allows the app to fetch features and experiments the API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo
projectNo

Implementation Reference

  • The handler function that executes the get_sdk_connections tool logic: constructs query params with optional project filter and pagination, fetches from GrowthBook API, handles response, and returns JSON data.
    async ({ limit, offset, project }) => {
      try {
        const queryParams = new URLSearchParams({
          limit: limit?.toString(),
          offset: offset?.toString(),
        });
    
        if (project) {
          queryParams.append("projectId", project);
        }
    
        const res = await fetch(
          `${baseApiUrl}/api/v1/sdk-connections?${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 sdk connections: ${error}`);
      }
    }
  • Input schema using Zod: optional project ID and pagination parameters (limit, offset).
    {
      project: z
        .string()
        .describe("The ID of the project to filter SDK connections by")
        .optional(),
      ...paginationSchema,
    },
  • Direct registration of the get_sdk_connections tool on the MCP server, including description, input schema, options, and inline handler function.
    server.tool(
      "get_sdk_connections",
      "Get all SDK connections. SDK connections are how GrowthBook connects to an app. Users need the client key to fetch features and experiments from the API.",
      {
        project: z
          .string()
          .describe("The ID of the project to filter SDK connections by")
          .optional(),
        ...paginationSchema,
      },
      {
        readOnlyHint: true,
      },
      async ({ limit, offset, project }) => {
        try {
          const queryParams = new URLSearchParams({
            limit: limit?.toString(),
            offset: offset?.toString(),
          });
    
          if (project) {
            queryParams.append("projectId", project);
          }
    
          const res = await fetch(
            `${baseApiUrl}/api/v1/sdk-connections?${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 sdk connections: ${error}`);
        }
      }
    );
  • src/index.ts:75-79 (registration)
    Top-level call to registerSdkConnectionTools in the main index.ts, which registers the get_sdk_connections tool among others.
    registerSdkConnectionTools({
      server,
      baseApiUrl,
      apiKey,
    });
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 that users need the key and explains its purpose, which adds some context. However, it doesn't describe important behaviors like whether this is a read-only operation, if it requires authentication, how results are returned (e.g., pagination), or any rate limits. For a tool with no annotation coverage, this leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is reasonably concise with three sentences, but the structure could be improved. The first sentence states the purpose clearly, but the following sentences focus on explaining SDK connections and the key's purpose rather than front-loading critical usage information. Some sentences feel tangential rather than essential for tool selection.

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?

Given the complexity (3 parameters, no annotations, no output schema), the description is incomplete. It explains what SDK connections are but misses crucial details: parameter meanings, behavioral traits (like read-only status), output format, and differentiation from siblings. For a tool that retrieves potentially sensitive connection data, this leaves too many unanswered questions for an AI agent.

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

Parameters2/5

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

The schema description coverage is 0%, so the description must compensate for undocumented parameters. The description mentions nothing about the three parameters (limit, offset, project) or their purposes. It doesn't explain what 'project' filters, how pagination works with limit/offset, or default values. With zero parameter information in the description, it fails to compensate for the schema gap.

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: 'Get all SDK connections' (verb+resource). It explains that SDK connections are 'how GrowthBook connects to an app' and mentions the key's purpose, which provides useful context. However, it doesn't explicitly differentiate this from sibling tools like 'create_sdk_connection' or 'get_projects', keeping it from a perfect score.

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. It doesn't mention when this tool is appropriate compared to other get_* tools (like get_feature_flags or get_projects) or when to use create_sdk_connection instead. The mention of the key's purpose is informative but doesn't constitute usage guidance.

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