remote-config-create
Generate an empty remote configuration to manage feature targeting and values in Hackle. Specify key, data type, and user criteria for precise control over A/B testing parameters.
Instructions
Creates an empty remote config. It is recommended to update an existing RC first if there is an associated RC with the one you want to create since the total number of RC is limited.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes |
Implementation Reference
- src/index.ts:369-396 (registration)Registration of the 'remote-config-create' tool using McpServer.tool, including inline schema and handler.server.tool( 'remote-config-create', 'Creates an empty remote config. It is recommended to update an existing RC first if there is an associated RC with the one you want to create since the total number of RC is limited.', { body: z.object({ key: z.string().nonempty().describe("Remote config's name."), description: z.string().optional(), dataType: z.enum(['STRING', 'JSON', 'NUMBER', 'BOOLEAN']).describe("Type of Remote Config's value."), userIdentifierCriteria: z .string() .optional() .default('$deviceId') .describe( 'User identifier criteria for targeting. You can use criteria provided by Hackle($deviceId, $userId) or your own criteria created at Hackle dashboard website.', ), }), }, async ({ body }) => { return { content: [ { type: 'text', text: JSON.stringify(await WebClient.post(`/api/v1/remote-configs`, body)), }, ], }; }, );
- src/index.ts:386-395 (handler)Handler function that performs the POST request to create a remote config via WebClient.post and returns the JSON response as text content.async ({ body }) => { return { content: [ { type: 'text', text: JSON.stringify(await WebClient.post(`/api/v1/remote-configs`, body)), }, ], }; },
- src/index.ts:372-385 (schema)Input schema using Zod, validating the body object with fields: key (required string), description (optional string), dataType (enum), userIdentifierCriteria (optional string default '$deviceId').{ body: z.object({ key: z.string().nonempty().describe("Remote config's name."), description: z.string().optional(), dataType: z.enum(['STRING', 'JSON', 'NUMBER', 'BOOLEAN']).describe("Type of Remote Config's value."), userIdentifierCriteria: z .string() .optional() .default('$deviceId') .describe( 'User identifier criteria for targeting. You can use criteria provided by Hackle($deviceId, $userId) or your own criteria created at Hackle dashboard website.', ), }), },
- src/WebClient.ts:74-86 (helper)WebClient.post static method, which handles the HTTP POST request to the Hackle API endpoint, used by the tool handler.public static async post<T = unknown>( path: string, body?: unknown, options?: Omit<RequestInit, 'method' | 'body'>, ): Promise<T> { return this.request<T>('POST', path, { ...options, body: JSON.stringify(body), headers: { ...options?.headers, }, }); }