Skip to main content
Glama
hackle-io

hackle-mcp

Official
by hackle-io

experiment-list

Retrieve a paginated list of A/B test experiments with search functionality to filter by name, description, or experiment key, enabling streamlined data access and analysis.

Instructions

Fetches a paginated list of A/B test experiments with search functionality.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNumberNo
pageSizeNo
searchKeywordNoname, description, or experimentKey of an experiment.

Implementation Reference

  • The inline async handler function for the 'experiment-list' tool. Constructs query string with pagination and search parameters, fetches data from Hackle API using WebClient.get, JSON.stringifies the result, and returns it as tool content.
    async ({ pageNumber = 1, pageSize = 100, searchKeyword = '' }) => {
      const qs = stringify(
        {
          pageNumber,
          pageSize,
          searchKeyword,
        },
        { addQueryPrefix: true },
      );
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(await WebClient.get(`/api/v1/experiments${qs}`)),
          },
        ],
      };
    },
  • Zod input schema defining optional parameters: pageNumber (default 1), pageSize (default 100), searchKeyword.
    {
      pageNumber: z.number().optional().default(1),
      pageSize: z.number().optional().default(100),
      searchKeyword: z.string().optional().describe('name, description, or experimentKey of an experiment.'),
    },
  • src/index.ts:15-42 (registration)
    MCP server.tool registration for 'experiment-list' tool, specifying name, description, input schema, and inline handler function.
    server.tool(
      'experiment-list',
      'Fetches a paginated list of A/B test experiments with search functionality.',
      {
        pageNumber: z.number().optional().default(1),
        pageSize: z.number().optional().default(100),
        searchKeyword: z.string().optional().describe('name, description, or experimentKey of an experiment.'),
      },
      async ({ pageNumber = 1, pageSize = 100, searchKeyword = '' }) => {
        const qs = stringify(
          {
            pageNumber,
            pageSize,
            searchKeyword,
          },
          { addQueryPrefix: true },
        );
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(await WebClient.get(`/api/v1/experiments${qs}`)),
            },
          ],
        };
      },
    );

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/hackle-io/hackle-mcp'

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