fluentcrm_create_smart_link
Create smart links in FluentCRM that automatically apply tags, add to lists, and manage user actions when clicked for targeted marketing automation.
Instructions
Tworzy nowy Smart Link (może nie być dostępne w obecnej wersji)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apply_lists | No | ID list do dodania po kliknięciu | |
| apply_tags | No | ID tagów do dodania po kliknięciu | |
| auto_login | No | Czy automatycznie logować użytkownika | |
| remove_lists | No | ID list do usunięcia po kliknięciu | |
| remove_tags | No | ID tagów do usunięcia po kliknięciu | |
| slug | No | Slug (np. "aw-link-webinar-mail") | |
| target_url | Yes | Docelowy URL | |
| title | Yes | Nazwa Smart Link (np. "AW-Link-Webinar-Mail") |
Implementation Reference
- src/fluentcrm-mcp-server.ts:359-382 (handler)Main handler function that attempts to create a Smart Link via the FluentCRM /smart-links API endpoint, with graceful fallback handling when the endpoint is unavailable.async createSmartLink(data: { title: string; slug?: string; target_url: string; apply_tags?: number[]; apply_lists?: number[]; remove_tags?: number[]; remove_lists?: number[]; auto_login?: boolean; }) { try { const response = await this.apiClient.post('/smart-links', data); return response.data; } catch (error: any) { if (error.response?.status === 404) { return { success: false, message: "Smart Links API endpoint not available yet in FluentCRM", suggestion: "Create Smart Link manually in FluentCRM admin panel", recommended_data: data }; } throw error; }
- src/fluentcrm-mcp-server.ts:841-858 (registration)Tool registration in ListTools response, including name, description, and input schema definition.{ name: 'fluentcrm_create_smart_link', description: 'Tworzy nowy Smart Link (może nie być dostępne w obecnej wersji)', inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'Nazwa Smart Link (np. "AW-Link-Webinar-Mail")' }, slug: { type: 'string', description: 'Slug (np. "aw-link-webinar-mail")' }, target_url: { type: 'string', description: 'Docelowy URL' }, apply_tags: { type: 'array', items: { type: 'number' }, description: 'ID tagów do dodania po kliknięciu' }, apply_lists: { type: 'array', items: { type: 'number' }, description: 'ID list do dodania po kliknięciu' }, remove_tags: { type: 'array', items: { type: 'number' }, description: 'ID tagów do usunięcia po kliknięciu' }, remove_lists: { type: 'array', items: { type: 'number' }, description: 'ID list do usunięcia po kliknięciu' }, auto_login: { type: 'boolean', description: 'Czy automatycznie logować użytkownika' }, }, required: ['title', 'target_url'], }, },
- src/fluentcrm-mcp-server.ts:1009-1010 (handler)MCP CallToolRequestSchema switch case handler that invokes the createSmartLink client method with tool arguments.case 'fluentcrm_create_smart_link': return { content: [{ type: 'text', text: JSON.stringify(await client.createSmartLink(args as any), null, 2) }] };
- src/fluentcrm-mcp-server.ts:426-449 (helper)Supporting validation utility for Smart Link data, matching the input schema requirements.validateSmartLinkData(data: any): { valid: boolean; errors: string[] } { const errors: string[] = []; if (!data.title || typeof data.title !== 'string') { errors.push('Title is required and must be a string'); } if (!data.target_url || typeof data.target_url !== 'string') { errors.push('Target URL is required and must be a string'); } if (data.target_url && !data.target_url.startsWith('http')) { errors.push('Target URL must start with http:// or https://'); } if (data.slug && !/^[a-z0-9-]+$/.test(data.slug)) { errors.push('Slug must contain only lowercase letters, numbers, and hyphens'); } return { valid: errors.length === 0, errors }; }