Skip to main content
Glama
hackle-io

hackle-mcp

Official
by hackle-io

in-app-message-list

Retrieve a paginated list of in-app messages with search functionality to locate messages by name, description, or campaign key, enabling efficient management of A/B test messages.

Instructions

Fetches a paginated list of in-app messages with search functionality.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNumberNo
pageSizeNo
searchKeywordNoname, description, or campaignKey of an in-app message.

Implementation Reference

  • The handler function for the 'in-app-message-list' tool. It constructs query parameters for pagination and search, fetches the list from the Hackle API using WebClient.get, stringifies the JSON response, and returns it as text 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/in-app-messages${qs}`)),
            },
          ],
        };
      },
    );
  • Zod input schema defining optional pagination (pageNumber, pageSize) and searchKeyword parameters for the tool.
    {
      pageNumber: z.number().optional().default(1),
      pageSize: z.number().optional().default(100),
      searchKeyword: z.string().optional().describe('name, description, or campaignKey of an in-app message.'),
    },
  • src/index.ts:64-91 (registration)
    The complete server.tool registration for the 'in-app-message-list' tool, including name, description, input schema, and inline handler function.
    server.tool(
      'in-app-message-list',
      'Fetches a paginated list of in-app messages with search functionality.',
      {
        pageNumber: z.number().optional().default(1),
        pageSize: z.number().optional().default(100),
        searchKeyword: z.string().optional().describe('name, description, or campaignKey of an in-app message.'),
      },
      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/in-app-messages${qs}`)),
            },
          ],
        };
      },
    );
  • The WebClient.get method used by the tool handler to perform the HTTP GET request to the Hackle API.
    public static async get<T = unknown>(path: string, options?: Omit<RequestInit, 'method'>): Promise<T> {
      return this.request<T>('GET', path, options);
    }

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