Skip to content
Help center

Datasets and SQL

Turn raw synced data into named datasets that people and AI assistants can rely on.

What a view is

A view is a saved SQL query over your synced data, stored as its own table and refreshed on the schedule you choose. Where the raw data is every invoice line from your accounting system, a view is the monthly revenue, with a description of what it counts.

Views are what AI assistants work from. A published view comes with its AI context and column notes, so an assistant answers from a few documented rows instead of guessing at raw tables. Only published views are listed to AI assistants, which decides what they work from. An assistant can still read the raw synced tables its MCP connection covers through SQL. In the dashboard, admins and above create and publish views; members can read them. Anyone using a Read/write MCP connection can also have Claude create and publish views within that connection's scope.

Three ways to make a view

  • Ask Claude. An MCP connection is how AI assistants such as Claude connect to Gatlas. With a Read/write MCP connection, describe the view you want and Claude creates and publishes it, usually in under a minute. The view-builder skill on the Skills page gives it a step by step procedure to follow.
  • Build it in Views. Go to Views in the sidebar and choose Create view. The steps are below.
  • Save a query. In the SQL workspace, write a query, choose Run to check the result, then Save as... to keep it as a view or a draft.

Whichever you choose, the view catalog holds ready-made views for each source, to add as they are or to start from.

Create a view

1

Name and describe it

Fill in View name and Description. The description is what people and assistants see in the list of views, so say what the view contains in a sentence or two.

2

Say where it is stored

Target schema comes filled in; keep it. Target table is the name of the table the view is written to, in lowercase with underscores, such as monthly_revenue.

3

Define the data

Use the Visual builder tab to pick a table, columns and filters, or the SQL editor tab to write the query yourself. With several companies, a view can combine tables from any of the ones you have access to.

4

Choose how often it refreshes

Under Refresh schedule, choose Hourly, Daily or Weekly, or keep Manual refresh only.

5

Document it for AI

Open AI & MCP settings. Turn on Publish to MCP when the view is ready for assistants, and write the AI context, the Column documentation and the Related entities, as described below.

6

Create it

Choose Create view. It appears under Views marked Published if you turned on Publish to MCP, or Saved if you did not.

Writing for AI

Three things decide how well an assistant uses a view:

  • AI context: what the view contains, what it is for, and anything that would trip up a reader, such as whether amounts are signed or which currency they are in. Gatlas calls it the single highest-leverage field: every assistant query and skill that touches the view starts with this text.
  • Column documentation: one line per column on what it means, its unit and its edge cases. For example, that revenue is in USD, includes refunds and excludes tax.
  • Related entities: the company the view describes, your business or, with several, each one it covers. An MCP connection limited to certain companies only sees the views tagged with them.

Tip

A vague AI context gets vague answers. Time spent here pays back on every question anyone asks about the view.

Publishing

To publish or unpublish an existing view, open it under Views, switch Published to MCP, then choose Save changes. A published view is visible to every MCP connection whose scope includes it; see Agent connections for how a connection's scope is set.

SQL workspace

The SQL workspace, under Views in the sidebar, is where you explore the synced data directly. Browse the tables your sources produced, write a query, choose Run to see the result, and export it as CSV. When a query is worth keeping, Save as... turns it into a view or a draft.

Verify a reverse sync webhook

A reverse sync can send a view to a webhook. When its destination has a webhook secret, every delivery carries two headers. Gatlas-Timestamp is the time of the send in Unix seconds. Gatlas-Signature is v1= followed by the hex HMAC-SHA256, keyed by the secret, of the timestamp, a period and the exact request body. A delivery without a secret carries neither header, and a Slack destination is never signed.

To check a delivery, compute the same signature over the raw body before parsing it, compare the two in constant time, and reject a timestamp more than 5 minutes from your clock, so an old delivery cannot be replayed. In Python:

import hashlib, hmac, time

def verify(secret: str, body: bytes, timestamp: str, signature: str) -> bool:
    try:
        if abs(time.time() - int(timestamp)) > 300:
            return False
    except ValueError:
        return False
    expected = hmac.new(secret.encode(), timestamp.encode() + b"." + body, hashlib.sha256)
    return hmac.compare_digest(("v1=" + expected.hexdigest()).encode(), signature.encode())