push-message-list
Retrieve paginated push message lists with search functionality to filter by name, description, or campaign key. Simplifies fetching and managing A/B test data in Hackle MCP.
Instructions
Fetches a paginated list of push messages with search functionality.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pageNumber | No | ||
| pageSize | No | ||
| searchKeyword | No | name, description, or campaignKey of a push message. |
Implementation Reference
- src/index.ts:121-139 (handler)Handler function that builds a query string from input parameters and fetches the paginated list of push messages via WebClient.get API call, returning JSON stringified response 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/push-messages${qs}`)), }, ], }; },
- src/index.ts:116-120 (schema)Input schema using Zod for validating optional parameters: pageNumber (default 1), pageSize (default 100), and searchKeyword.{ pageNumber: z.number().optional().default(1), pageSize: z.number().optional().default(100), searchKeyword: z.string().optional().describe('name, description, or campaignKey of a push message.'), },
- src/index.ts:113-140 (registration)Registration of the 'push-message-list' tool using server.tool, including description, input schema, and inline handler function.server.tool( 'push-message-list', 'Fetches a paginated list of push 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 a push 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/push-messages${qs}`)), }, ], }; }, );