fluentcrm_validate_smart_link_data
Validate Smart Link data before creation in FluentCRM to ensure proper configuration and prevent errors.
Instructions
Waliduje dane Smart Link przed utworzeniem
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Nazwa Smart Link | |
| slug | No | Slug | |
| target_url | Yes | Docelowy URL | |
| apply_tags | No | ||
| apply_lists | No | ||
| remove_tags | No | ||
| remove_lists | No | ||
| auto_login | No |
Implementation Reference
- src/fluentcrm-mcp-server.ts:426-449 (handler)Core handler function implementing the Smart Link data validation logic in the FluentCRMClient class. Validates title, target_url (required string, http protocol), and optional slug format.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 }; }
- src/fluentcrm-mcp-server.ts:900-917 (registration)Tool registration in the MCP server's ListToolsRequestSchema handler, defining name, description, and input schema.{ name: 'fluentcrm_validate_smart_link_data', description: 'Waliduje dane Smart Link przed utworzeniem', inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'Nazwa Smart Link' }, slug: { type: 'string', description: 'Slug' }, target_url: { type: 'string', description: 'Docelowy URL' }, apply_tags: { type: 'array', items: { type: 'number' } }, apply_lists: { type: 'array', items: { type: 'number' } }, remove_tags: { type: 'array', items: { type: 'number' } }, remove_lists: { type: 'array', items: { type: 'number' } }, auto_login: { type: 'boolean' }, }, required: ['title', 'target_url'], }, },
- src/fluentcrm-mcp-server.ts:903-916 (schema)Input schema definition for the tool, specifying properties and required fields.inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'Nazwa Smart Link' }, slug: { type: 'string', description: 'Slug' }, target_url: { type: 'string', description: 'Docelowy URL' }, apply_tags: { type: 'array', items: { type: 'number' } }, apply_lists: { type: 'array', items: { type: 'number' } }, remove_tags: { type: 'array', items: { type: 'number' } }, remove_lists: { type: 'array', items: { type: 'number' } }, auto_login: { type: 'boolean' }, }, required: ['title', 'target_url'], },
- src/fluentcrm-mcp-server.ts:1017-1018 (handler)MCP server dispatch handler for the tool call, invoking the client.validateSmartLinkData method.case 'fluentcrm_validate_smart_link_data': return { content: [{ type: 'text', text: JSON.stringify(client.validateSmartLinkData(args as any), null, 2) }] };
- src/fluentcrm-mcp-server.ts:425-425 (helper)Comment indicating the validateSmartLinkData is a helper utility.// Helper method to validate Smart Link data