Skip to main content
Glama

create_model

Create a new data model in Polytomic by specifying a name, connection ID, and configuration such as SQL queries or table references.

Instructions

Create a new data model in Polytomic.

Args: name: Name for the model connection_id: The connection ID this model uses configuration: JSON string with model config (e.g. {"query": "SELECT * FROM users"} or {"table": "users"}) identifier: Optional field name to use as unique identifier tracking_columns: Optional JSON array of column names for change tracking

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
connection_idYes
configurationYes
identifierNo
tracking_columnsNo

Implementation Reference

  • Implementation of the create_model tool handler.
    async def create_model(
        name: str,
        connection_id: str,
        configuration: str,
        identifier: str | None = None,
        tracking_columns: str | None = None,
    ) -> str:
        """Create a new data model in Polytomic.
    
        Args:
            name: Name for the model
            connection_id: The connection ID this model uses
            configuration: JSON string with model config (e.g. {"query": "SELECT * FROM users"} or {"table": "users"})
            identifier: Optional field name to use as unique identifier
            tracking_columns: Optional JSON array of column names for change tracking
        """
        body = {
            "name": name,
            "connection_id": connection_id,
            "configuration": json.loads(configuration),
        }
        if identifier:
            body["identifier"] = identifier
        if tracking_columns:
            body["tracking_columns"] = json.loads(tracking_columns)
    
        result = await polytomic_request("/models", method="POST", 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