Schema Discovery
How conexor.io reads your database structure and automatically generates a typed MCP tool for every query pattern.
What gets discovered
When you click Sync Schema, the agent queries your database's information schema. It collects:
- Tables and views — names, schemas, and estimated row counts
- Columns — names, data types, nullability, and default values
- Primary keys — used to generate lookup-by-id tools
- Foreign keys — used to infer relationships and join patterns
- Indexes — used to suggest efficient filter columns
How tools are generated
For each table, conexor.io generates a set of MCP tools based on the column types and index structure. A typical table produces 2–4 tools:
Example: users table
CREATE TABLE users (
id UUID PRIMARY KEY,
email VARCHAR(255) UNIQUE NOT NULL,
name VARCHAR(100),
created_at TIMESTAMPTZ DEFAULT now(),
org_id UUID REFERENCES organizations(id)
);Generated tools:
query_usersFilter users by any column combination. Returns paginated rows.
params: email?, name?, org_id?, limit?, offset?
query_users_by_idLook up a single user by primary key.
params: id (required)
query_users_by_emailLook up a user by unique email.
params: email (required)
count_usersCount users matching optional filters.
params: org_id?, created_after?, created_before?
Relationship-aware tools
When foreign keys are detected, conexor.io generates join-aware tools that let Claude query across related tables without needing to issue multiple queries:
# FK: orders.user_id → users.id # FK: orders.product_id → products.id Generated: query_orders_with_user — JOIN orders + users query_orders_with_product — JOIN orders + products query_user_orders — Get all orders for a user_id
Performance on large schemas
Discovery is optimised to run in a single batch against the information schema. For databases with 1000+ tables, the process typically takes 10–30 seconds. Tables are streamed back incrementally — you can see progress in the dashboard as it runs.
Excluding tables
You can exclude specific tables or schemas from discovery using patterns in the data source settings. This is useful for excluding internal audit tables, migration tables, or schemas you don't want AI models to query.
# Exclusion patterns (glob syntax) migrations.* # Exclude all tables in migrations schema *_audit # Exclude any table ending in _audit internal.secrets # Exclude a specific table
Keeping schema in sync
Schema discovery does not run continuously — it is triggered manually or via the API. If you add new tables or columns to your database, click Sync Schema again to update the MCP tools. The old tools are replaced atomically — there is no downtime during re-sync.
© 2026 conexor.io