Skip to main content
Glama

update_sync

Modify an existing data synchronization configuration in Polytomic by updating parameters like name, mode, field mappings, schedule, filters, or activation status.

Instructions

Update an existing sync in Polytomic.

Args: id: The sync ID to update name: Optional new name mode: Optional sync mode fields: Optional JSON array of field mappings identity: Optional JSON for identity mapping schedule: Optional JSON for schedule filters: Optional JSON array of filters filter_logic: Optional filter logic string active: Optional boolean to enable/disable sync

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
nameNo
modeNo
fieldsNo
identityNo
scheduleNo
filtersNo
filter_logicNo
activeNo

Implementation Reference

  • The `update_sync` tool function implements the update logic by fetching current sync data and performing a PUT request to update it.
    @mcp.tool()
    async def update_sync(
        id: str,
        name: str | None = None,
        mode: str | None = None,
        fields: str | None = None,
        identity: str | None = None,
        schedule: str | None = None,
        filters: str | None = None,
        filter_logic: str | None = None,
        active: bool | None = None,
    ) -> str:
        """Update an existing sync in Polytomic.
    
        Args:
            id: The sync ID to update
            name: Optional new name
            mode: Optional sync mode
            fields: Optional JSON array of field mappings
            identity: Optional JSON for identity mapping
            schedule: Optional JSON for schedule
            filters: Optional JSON array of filters
            filter_logic: Optional filter logic string
            active: Optional boolean to enable/disable sync
        """
        current = await polytomic_request(f"/syncs/{id}")
        current_data = current.get("data", current)
    
        body = {
            "name": name or current_data.get("name"),
            "mode": mode or current_data.get("mode"),
            "target": current_data.get("target"),
            "fields": json.loads(fields) if fields else current_data.get("fields"),
        }
        
        if identity:
            body["identity"] = json.loads(identity)
        elif current_data.get("identity"):
            body["identity"] = current_data.get("identity")
    
        if schedule:
            body["schedule"] = json.loads(schedule)
        elif current_data.get("schedule"):
            body["schedule"] = current_data.get("schedule")
    
        if filters:
            body["filters"] = json.loads(filters)
        elif current_data.get("filters"):
            body["filters"] = current_data.get("filters")
    
        if filter_logic is not None:
            body["filter_logic"] = filter_logic
        elif current_data.get("filter_logic"):
            body["filter_logic"] = current_data.get("filter_logic")
    
        if active is not None:
            body["active"] = active
    
        result = await polytomic_request(f"/syncs/{id}", method="PUT", body=body)
        return json.dumps(result, indent=2)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/therevenueengineer/polytomic-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server