fluentcrm_create_smart_link
Create smart links in FluentCRM that track clicks and automatically manage contact tags and lists based on user interactions.
Instructions
Tworzy nowy Smart Link (może nie być dostępne w obecnej wersji)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Nazwa Smart Link (np. "AW-Link-Webinar-Mail") | |
| slug | No | Slug (np. "aw-link-webinar-mail") | |
| target_url | Yes | Docelowy URL | |
| apply_tags | No | ID tagów do dodania po kliknięciu | |
| apply_lists | No | ID list do dodania po kliknięciu | |
| remove_tags | No | ID tagów do usunięcia po kliknięciu | |
| remove_lists | No | ID list do usunięcia po kliknięciu | |
| auto_login | No | Czy automatycznie logować użytkownika |
Implementation Reference
- src/fluentcrm-mcp-server.ts:359-382 (handler)Core handler function in FluentCRMClient that attempts to create a Smart Link via POST /smart-links, with graceful 404 handling indicating feature unavailability.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:842-858 (registration)Tool registration in MCP server's tools list, including name, description, and detailed input schema.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 server request handler switch case that invokes the client.createSmartLink 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:844-857 (schema)Input schema definition for the tool, specifying parameters and validation rules.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:426-449 (helper)Supporting validation method for Smart Link data used by related tools.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 }; }