Tablix exposes an HTTP MCP server for AI agents. The MCP endpoint is:
http://localhost:9102/rpc
The MCP host and port are configured in tablix.json under Rest.Hostname and Rest.McpPort.
The MCP server is intended to run in a trusted local or private environment. Current MCP tools do not require an API key.
Credential redaction is enforced on discovery tools:
Useris never returned by MCP discovery tools.Passwordis never returned by MCP discovery tools.HasUserindicates whether a username is configured.HasPasswordindicates whether a password is configured.
Model provider credentials are stored in tablix.db and managed through the REST Models API or dashboard Models page. These provider keys are not part of the MCP tool response surface and must not be stored in database context.
Dashboard Chat uses PolyPrompt 2.0.0 native tool chat, including streaming tool-chat calls for /v1/chat/stream, when a selected provider is configured for native tool calls. That provider-facing tool loop is internal to REST chat and can expose tablix_execute_query, tablix_update_database_context, and tablix_update_table_context. MCP clients continue to use the explicit MCP tools documented here; tablix_execute_query follows the same validation and AllowedQueries enforcement used by REST chat native-tool and fallback execution, and MCP context update tools use the same persisted context records as REST chat context updates.
Do not save secrets, raw query result data, access tokens, connection strings, or passwords into database or table context with any context update tool.
| Tool | Purpose |
|---|---|
tablix_discover_databases |
List configured databases with redacted metadata, crawl state, query permissions, and saved context |
tablix_list_tables |
Page through compact table summaries |
tablix_list_relationships |
Page through compact declared and optionally inferred relationship edges |
tablix_discover_table |
Retrieve full geometry for one table |
tablix_execute_query |
Execute one SQL statement against a database |
tablix_get_database_context |
Read database-level context for one database, multiple databases, or a paged set |
tablix_get_table_context |
Read table-level context for one table, multiple tables, or a paged set |
tablix_update_context |
General database/table context update tool with a scope discriminator |
tablix_update_database_context |
Persist curated database-level context |
tablix_update_table_context |
Persist curated table-level context |
tablix_discover_database |
Retrieve full database geometry, optionally paged by table |
tablix_get_database_intelligence |
Read domain entities, inferred relationships, ambiguity signals, context quality, and optionally an agent pack |
tablix_get_agent_pack |
Read MCP-ready agent instructions and starter questions for one database |
Restrict conversation to the selected database, its structure, its contents, and their relationships. Do not answer unrelated general-purpose questions through Tablix context.
- Call
tablix_discover_databases. - Select a database by
Id. - Read
Context,AllowedQueries,IsCrawled, andCrawlError. - When context quality matters, call
tablix_get_database_contextfor the selected database to retrieve the current durable database-level context explicitly. - For unknown or large schemas, call
tablix_list_tableswith a conservativemaxResults, such as50. - Continue paging by passing the previous response's
NextSkipasskipuntilEndOfResultsistrue. - Call
tablix_get_database_intelligenceortablix_get_agent_packwhen you need a compact domain brief, context quality score, ambiguity warnings, or starter questions. - Call
tablix_list_relationshipsthe same way to collect declared foreign-key edges; setincludeInferred: truewhen declared FKs are incomplete. - Before using specific tables, call
tablix_get_table_contextfor those table IDs or names to retrieve durable table-specific guidance. UseincludeEmpty: truewhen you need to know which selected tables have no table context yet. - Call
tablix_discover_tablefor every table needed for SQL generation; table context does not replace column/key/index discovery. - Ask a clarifying question before executing SQL when intelligence or the user request exposes ambiguity around active, latest, revenue, status, owner, customer, or other business definitions.
- Run
tablix_execute_queryafter confirming the statement type is listed inAllowedQuerieswhen the user asks for actual data, counts, lists, totals, computed answers, or an explicit database change. - If a query fails because of a bad or unknown column, missing column, or column type mismatch, refresh schema by re-discovering the relevant table or database before retrying.
- Use
tablix_update_database_contextortablix_update_table_contextwhen the user explicitly asks to save context, the workflow clearly requires persisted analysis, or refreshed schema proves saved context has stale column names, stale column types, or stale relationship guidance.
Use tablix_discover_database only for small databases, explicit full-schema requests, or carefully paged full-geometry retrieval.
Tablix stores context records in tablix.db with two scopes:
- Database context describes the selected database as a whole: business purpose, major domains, important tables, declared relationships, inferred relationships clearly labeled as inferred, common query patterns, and global caveats.
- Table context describes one table: table purpose, important columns, business meanings, join paths, filters, row caveats, and table-specific query patterns.
Use the most specific context that applies. Database context is useful for overall orientation. Table context is more precise when generating SQL for known tables. Context is durable guidance, not proof: verify table and column names with tablix_discover_table before executing a query.
Context read tools:
- Use
tablix_get_database_contextfor one or more database context records. - Use
tablix_get_table_contextfor one or more table context records. - Use
includeEmpty: trueontablix_get_table_contextwhen you need selected crawled tables returned even if no table context exists yet.
Context write tools:
- Prefer
tablix_update_database_contextfor database-level context. - Prefer
tablix_update_table_contextfor table-level context. tablix_update_contextremains as a general tool and acceptsscope: "Database"orscope: "Table"for compatibility and generic workflows.- All update tools accept a single top-level update or an
updatesarray for batch updates.
Only write context when the user asked you to save/update it, the workflow explicitly requires persisted analysis, or refreshed schema proves saved context is stale. Never store credentials, API keys, connection strings, raw query result rows, sensitive personal data copied from tables, or unsupported guesses.
Paginated MCP responses use these fields:
| Field | Type | Description |
|---|---|---|
Success |
boolean | Whether the request succeeded |
MaxResults |
integer | Page size after clamping to 1-1000 |
Skip |
integer | Number of records skipped |
TotalRecords |
integer | Total matching records before page slicing |
RecordsRemaining |
integer | Records remaining after this page |
EndOfResults |
boolean | true when no further page remains |
NextSkip |
integer or null | Use as skip for the next page; null on final page |
TotalMs |
number | Server-side elapsed time in milliseconds |
Objects |
array | Page objects |
Returned by tablix_discover_databases.
| Field | Type | Description |
|---|---|---|
Id |
string | Database entry ID |
Name |
string or null | Human-readable display name |
Type |
string | Sqlite, Postgresql, Mysql, or SqlServer |
Hostname |
string or null | Hostname for network databases |
Port |
integer or null | Network database port |
HasUser |
boolean | Whether a username is configured |
HasPassword |
boolean | Whether a password is configured |
DatabaseName |
string or null | Database/catalog name |
Schema |
string or null | Configured schema |
Filename |
string or null | SQLite file path |
AllowedQueries |
string[] | Allowed SQL statement types |
Context |
string or null | Saved database context |
IsCrawled |
boolean | Whether cached schema crawl succeeded |
CrawlError |
string or null | Last crawl error, if any |
Returned by tablix_get_database_context.
| Field | Type | Description |
|---|---|---|
DatabaseId |
string | Database entry ID |
Name |
string or null | Database display name |
Type |
string | Database engine type |
Context |
string or null | Saved database-level context |
Returned by tablix_list_tables.
| Field | Type | Description |
|---|---|---|
TableId |
string or null | Persisted table metadata ID used by REST table-context APIs |
SchemaName |
string or null | Schema name |
TableName |
string | Table name |
Columns |
integer | Number of discovered columns |
ForeignKeys |
integer | Number of declared foreign keys from the table |
Indexes |
integer | Number of discovered indexes |
Returned by tablix_get_table_context and table-context REST APIs.
| Field | Type | Description |
|---|---|---|
Id |
string or null | Context record ID when a persisted context row exists |
DatabaseId |
string | Database entry ID |
TableId |
string | Persisted table metadata ID |
SchemaName |
string or null | Schema name |
TableName |
string | Table name |
Context |
string or null | Saved table-level context, or null when includeEmpty returned an empty table |
Source |
string or null | Context source, such as user, model, or mcp |
UpdatedUtc |
string | Last update timestamp when persisted |
Returned by tablix_list_relationships.
| Field | Type | Description |
|---|---|---|
FromSchema |
string or null | Source schema |
FromTable |
string | Source table |
FromColumn |
string | Source column |
ToSchema |
string or null | Referenced schema, when known |
ToTable |
string | Referenced table |
ToColumn |
string | Referenced column |
ConstraintName |
string or null | Foreign-key constraint name |
Source |
string | Relationship source: declared_fk or inferred_name_match |
Confidence |
number | Confidence from 0.0 to 1.0; declared FKs use 1.0, inferred candidates use lower scores |
Returned by tablix_get_database_intelligence.
| Field | Type | Description |
|---|---|---|
Success |
boolean | Whether the response succeeded |
DatabaseId |
string | Database entry ID |
Domain |
object | Schema-to-domain summary, entities, workflows, metrics, filters, and freshness columns |
Relationships |
RelationshipDetail[] |
Declared and inferred relationship candidates |
Ambiguities |
object[] | Terms that should be clarified before executing SQL |
ContextQuality |
object | Score, label, coverage counts, relationship counts, and improvement signals |
AgentPack |
object or null | Markdown agent pack when requested |
TotalMs |
number | Server-side elapsed time |
Returned by tablix_get_agent_pack and optionally by tablix_get_database_intelligence.
| Field | Type | Description |
|---|---|---|
Success |
boolean | Whether the response succeeded |
DatabaseId |
string | Database entry ID |
GeneratedUtc |
string | Generation timestamp |
Markdown |
string | MCP-ready agent brief |
Instructions |
string[] | Short instruction bullets |
SuggestedQuestions |
string[] | Useful starter questions generated from schema |
Returned by tablix_discover_table and tablix_discover_database.
| Field | Type | Description |
|---|---|---|
TableId |
string or null | Persisted table metadata ID |
TableName |
string | Table name |
SchemaName |
string or null | Schema name |
Context |
string or null | Persisted table-level context, when present |
Columns |
ColumnDetail[] |
Column geometry |
ForeignKeys |
ForeignKeyDetail[] |
Declared foreign keys |
Indexes |
IndexDetail[] |
Index metadata |
ColumnDetail fields: ColumnName, DataType, IsNullable, IsPrimaryKey, DefaultValue, MaxLength.
ForeignKeyDetail fields: ConstraintName, ColumnName, ReferencedTable, ReferencedColumn.
IndexDetail fields: IndexName, Columns, IsUnique.
Returned by tablix_execute_query.
| Field | Type | Description |
|---|---|---|
Success |
boolean | Whether execution succeeded |
DatabaseId |
string or null | Database entry ID |
RowsReturned |
integer | Number of rows returned |
TotalMs |
number | Execution time in milliseconds |
Data |
object or null | Serializable data table with Columns and Rows |
Error |
string or null | Error message when execution fails |
Use first in every Tablix workflow. Lists configured databases with redacted metadata, query permissions, crawl state, and saved context.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
maxResults |
integer | No | 100 |
Maximum databases to return, clamped to 1-1000 |
skip |
integer | No | 0 |
Number of database records to skip |
filter |
string | No | null | Case-insensitive filter for database Id or DatabaseName |
{
"maxResults": 50,
"skip": 0,
"filter": "orders"
}Returns EnumerationResult<DatabaseSummary>.
{
"Success": true,
"MaxResults": 50,
"Skip": 0,
"TotalRecords": 1,
"RecordsRemaining": 0,
"EndOfResults": true,
"NextSkip": null,
"TotalMs": 0.4,
"Objects": [
{
"Id": "db_orders",
"Name": "Orders",
"Type": "Postgresql",
"Hostname": "pg.example.com",
"Port": 5432,
"HasUser": true,
"HasPassword": true,
"DatabaseName": "orders",
"Schema": "public",
"AllowedQueries": ["SELECT"],
"Context": "Orders database for reporting.",
"IsCrawled": true,
"CrawlError": null
}
]
}- Preserve
Contextas authoritative user-provided guidance. - Check
AllowedQueriesbefore callingtablix_execute_query. - Credentials are never returned.
- Continue paging with
NextSkipuntilEndOfResultsis true.
Preferred table-discovery tool for large databases. Returns compact table summaries, not full column geometry.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
databaseId |
string | Yes | n/a | Database entry ID |
maxResults |
integer | No | 100 |
Maximum table summaries to return, clamped to 1-1000 |
skip |
integer | No | 0 |
Number of table summaries to skip |
filter |
string | No | null | Case-insensitive filter by table or schema name |
schema |
string | No | null | Case-insensitive exact schema filter |
{
"databaseId": "db_orders",
"maxResults": 50,
"skip": 0,
"filter": "invoice",
"schema": "public"
}Returns DatabaseTableListResult, which extends EnumerationResult<TableSummary>.
{
"Success": true,
"DatabaseId": "db_orders",
"Context": "Orders database for reporting.",
"IsCrawled": true,
"TableCount": 120,
"Filter": "invoice",
"Schema": "public",
"MaxResults": 50,
"Skip": 0,
"TotalRecords": 3,
"RecordsRemaining": 0,
"EndOfResults": true,
"NextSkip": null,
"TotalMs": 0.6,
"Objects": [
{
"TableId": "tbl_db_orders_public_invoice",
"SchemaName": "public",
"TableName": "invoice",
"Columns": 12,
"ForeignKeys": 2,
"Indexes": 4
}
]
}- Do not generate SQL from table summaries alone unless the query only needs table names.
- Call
tablix_discover_tablefor every table used in a select list, join, filter, insert, update, or delete. - Continue paging with
NextSkipuntilEndOfResultsis true.
Lists compact relationship edges. Declared foreign keys are always returned. Set includeInferred to include name-based inferred relationship candidates.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
databaseId |
string | Yes | n/a | Database entry ID |
maxResults |
integer | No | 100 |
Maximum relationship edges to return, clamped to 1-1000 |
skip |
integer | No | 0 |
Number of relationship edges to skip |
filter |
string | No | null | Case-insensitive filter by table, column, schema, or constraint name |
schema |
string | No | null | Case-insensitive source or target schema filter |
includeInferred |
boolean | No | false |
Include name-based inferred relationship candidates with confidence scores |
{
"databaseId": "db_orders",
"maxResults": 100,
"skip": 0,
"filter": "customer",
"includeInferred": true
}Returns DatabaseRelationshipListResult, which extends EnumerationResult<RelationshipDetail>.
{
"Success": true,
"DatabaseId": "db_orders",
"Context": "Orders database for reporting.",
"IsCrawled": true,
"TableCount": 120,
"Filter": "customer",
"Schema": null,
"IncludeInferred": true,
"MaxResults": 100,
"Skip": 0,
"TotalRecords": 2,
"RecordsRemaining": 0,
"EndOfResults": true,
"NextSkip": null,
"TotalMs": 0.5,
"Objects": [
{
"FromSchema": "public",
"FromTable": "orders",
"FromColumn": "CustomerId",
"ToSchema": "public",
"ToTable": "customers",
"ToColumn": "Id",
"ConstraintName": "fk_orders_customers",
"Source": "declared_fk",
"Confidence": 1.0
},
{
"FromSchema": "public",
"FromTable": "orders",
"FromColumn": "customer_id",
"ToSchema": "public",
"ToTable": "customers",
"ToColumn": "id",
"Source": "inferred_name_match",
"Confidence": 0.90
}
]
}- Absence of a declared edge means no declared foreign key was discovered; it does not prove tables are unrelated.
- Treat
Source = inferred_name_matchas a candidate until saved context, schema inspection, or a user confirms it. - Clearly label inferred relationships in answers and saved context.
- Continue paging with
NextSkipuntilEndOfResultsis true.
Returns domain entities, relationship candidates, ambiguity signals, context quality, and optionally an agent pack for one database.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
databaseId |
string | Yes | n/a | Database entry ID |
includeAgentPack |
boolean | No | true |
Include markdown agent pack |
{
"databaseId": "db_orders",
"includeAgentPack": true
}Returns DatabaseIntelligenceResponse.
{
"Success": true,
"DatabaseId": "db_orders",
"Domain": {
"Summary": "Crawled 120 table(s), 84 declared relationship(s), and 36 inferred relationship candidate(s). Saved database context is available.",
"Entities": [
{
"TableId": "tbl_db_orders_public_orders",
"SchemaName": "public",
"TableName": "orders",
"Role": "entity",
"Summary": "Contains 18 column(s), 2 declared FK(s), saved context.",
"KeyColumns": ["Id", "CustomerId", "Status", "CreatedAt"],
"HasContext": true
}
],
"Metrics": ["public.orders.TotalAmount"],
"CommonFilters": ["public.orders.Status", "public.orders.CreatedAt"],
"FreshnessColumns": ["public.orders.CreatedAt"]
},
"Ambiguities": [
{
"Term": "latest",
"Reason": "Multiple timestamp columns could define latest records.",
"Question": "Which timestamp defines latest?",
"Candidates": ["public.orders.CreatedAt", "public.orders.UpdatedAt"]
}
],
"ContextQuality": {
"Score": 78,
"Label": "Good",
"TablesWithContext": 72,
"TotalTables": 120,
"DeclaredRelationships": 84,
"InferredRelationships": 36
}
}- Use this tool before generating SQL when a compact domain readout is more useful than raw schema.
- Clarify ambiguity signals before executing SQL that depends on the ambiguous term.
- Treat inferred relationship candidates as guidance, not proof, until confirmed.
Returns MCP-ready instructions and starter questions for one database.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
databaseId |
string | Yes | n/a | Database entry ID |
{
"databaseId": "db_orders"
}Returns AgentPackResponse.
{
"Success": true,
"DatabaseId": "db_orders",
"Markdown": "# Tablix Agent Pack: Orders\n...",
"Instructions": [
"Start with tablix_discover_databases and select databaseId db_orders."
],
"SuggestedQuestions": [
"How many records are in public.orders?"
]
}- Use the agent pack as a brief, not a substitute for table geometry validation.
- Preserve the selected database ID and allowed query rules when executing SQL.
Retrieves full geometry for one table.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
databaseId |
string | Yes | n/a | Database entry ID |
tableName |
string | Yes | n/a | Table name from tablix_list_tables; matching is case-insensitive |
{
"databaseId": "db_orders",
"tableName": "orders"
}{
"DatabaseId": "db_orders",
"Context": "Orders database for reporting.",
"Table": {
"TableId": "tbl_db_orders_public_orders",
"TableName": "orders",
"SchemaName": "public",
"Context": "Stores customer orders and links to customers through CustomerId.",
"Columns": [
{
"ColumnName": "Id",
"DataType": "integer",
"IsNullable": false,
"IsPrimaryKey": true,
"DefaultValue": null,
"MaxLength": null
}
],
"ForeignKeys": [
{
"ConstraintName": "fk_orders_customers",
"ColumnName": "CustomerId",
"ReferencedTable": "customers",
"ReferencedColumn": "Id"
}
],
"Indexes": [
{
"IndexName": "idx_orders_customerid",
"Columns": ["CustomerId"],
"IsUnique": false
}
]
}
}{ "Error": "databaseId is required" }{ "Error": "tableName is required" }{ "Error": "Table 'missing' not found in database 'db_orders'" }- Use before writing SQL that references a table.
- Call once for each table participating in a join.
- Combine with
tablix_list_relationshipsfor join planning.
Executes one SQL statement against a database.
Use this tool when the user asks for an answer from the data or a requested database change, not just SQL text. Requests phrased as "show me", "how many", "count", "list", "find", "total", "average", "latest", "top", "summarize", "add", "update", or "delete" should normally result in executing a permitted query after table/column validation.
Do not merely provide SQL when the user asks for a result or action and the statement type is allowed. Execute the permitted query and report the returned value, rows, or write result.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
databaseId |
string | Yes | n/a | Database entry ID |
query |
string | Yes | n/a | Single SQL statement; do not include semicolons or a trailing SQL terminator |
{
"databaseId": "db_orders",
"query": "SELECT Id, Total FROM orders LIMIT 10"
}Returns QueryResult.
{
"Success": true,
"DatabaseId": "db_orders",
"RowsReturned": 2,
"TotalMs": 12.5,
"Data": {
"Columns": [
{ "Name": "Id", "Type": "System.Int64" },
{ "Name": "Total", "Type": "System.Decimal" }
],
"Rows": [
{ "Id": 1, "Total": 10.5 },
{ "Id": 2, "Total": 20.0 }
]
},
"Error": null
}Validation and execution failures are returned as QueryResult with Success: false.
{
"Success": false,
"DatabaseId": "db_orders",
"RowsReturned": 0,
"TotalMs": 0,
"Data": null,
"Error": "Query type DELETE is not allowed."
}querymust not be empty.- A single trailing SQL terminator is removed before validation and execution.
- Multi-statement queries with embedded or repeated semicolons are rejected.
- Leading SQL comments are stripped before statement-type detection.
- The first statement keyword must appear in the database's
AllowedQueries. - This validation is a heuristic safeguard, not a database security boundary.
- Prefer
SELECTfor exploration. - Use explicit column lists instead of
SELECT *when practical. - Add sensible limits for exploratory reads.
- Aggregate queries such as
COUNT(*)do not need aLIMIT. - Do not run write statements unless the user explicitly asks and
AllowedQueriespermits the statement type. - Validate table and column names with
tablix_discover_tablefirst. - If execution fails because of a bad or unknown column, missing column, or column type mismatch, refresh schema by re-discovering the relevant table or database before retrying.
- If refreshed schema proves saved database context has wrong column names, wrong column types, or stale relationship guidance, call
tablix_update_database_contextwith corrected context. - If refreshed schema proves saved table context is stale for one or more specific tables, call
tablix_update_table_contextwith corrected table-level context.
Reads database-level context for one database, multiple databases, or a paged set of configured databases.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
databaseId |
string | No | null | Single database entry ID |
databaseIds |
string[] | No | [] |
Multiple database entry IDs |
maxResults |
integer | No | 100 |
Maximum contexts to return when listing |
skip |
integer | No | 0 |
Records to skip when listing |
filter |
string | No | null | Case-insensitive filter by database ID or name |
If databaseId or databaseIds is supplied, Tablix returns the requested databases and reports missing IDs in MissingDatabaseIds. If neither is supplied, Tablix returns a paged list.
{
"databaseIds": ["db_orders", "db_billing"]
}{
"Success": true,
"MaxResults": 100,
"Skip": 0,
"TotalRecords": 2,
"RecordsRemaining": 0,
"EndOfResults": true,
"NextSkip": null,
"TotalMs": 0.4,
"MissingDatabaseIds": [],
"Error": null,
"Objects": [
{
"DatabaseId": "db_orders",
"Name": "Orders",
"Type": "Postgresql",
"Context": "Orders database for reporting."
}
]
}- Use before SQL generation when durable database-level business context may affect table choice, relationship interpretation, or answer wording.
- Treat context as guidance, not proof. Verify table and column names with schema tools.
- Use
tablix_update_database_contextif refreshed schema proves database-level context is stale.
Reads table-level context for one table, multiple tables, or a paged set of table contexts in one database.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
databaseId |
string | Yes | n/a | Database entry ID |
tableId |
string | No | null | Single persisted table metadata ID |
tableIds |
string[] | No | [] |
Multiple persisted table metadata IDs |
tableName |
string | No | null | Single table name, optionally schema.table |
tableNames |
string[] | No | [] |
Multiple table names |
includeEmpty |
boolean | No | false |
Include crawled tables without persisted table context |
maxResults |
integer | No | 100 |
Maximum contexts to return when listing |
skip |
integer | No | 0 |
Records to skip when listing |
filter |
string | No | null | Case-insensitive filter by table, schema, or context |
schema |
string | No | null | Exact schema filter |
If table selectors are supplied, Tablix returns those tables. If no table selectors are supplied, Tablix lists persisted table contexts. Set includeEmpty to true to list crawled tables even when their Context is null.
{
"databaseId": "db_orders",
"tableIds": ["tbl_db_orders_public_orders", "tbl_db_orders_public_customers"],
"includeEmpty": true
}{
"Success": true,
"DatabaseId": "db_orders",
"MaxResults": 100,
"Skip": 0,
"TotalRecords": 2,
"RecordsRemaining": 0,
"EndOfResults": true,
"NextSkip": null,
"TotalMs": 0.5,
"MissingTableIds": [],
"MissingTableNames": [],
"Error": null,
"Objects": [
{
"Id": "ctx_012345",
"DatabaseId": "db_orders",
"TableId": "tbl_db_orders_public_orders",
"SchemaName": "public",
"TableName": "orders",
"Context": "Stores customer orders and links to customers through CustomerId.",
"Source": "mcp",
"UpdatedUtc": "2026-07-11T12:00:00Z"
}
]
}- Use table context for table-specific meaning, caveats, common filters, and join guidance.
- Prefer
tableIdvalues fromtablix_list_tables; usetableNameonly when IDs are not known. - Table context does not replace schema discovery. Call
tablix_discover_tablefor columns, keys, indexes, and data types before executing SQL. - Use
tablix_update_table_contextif refreshed schema proves table-level context is stale.
Persists database-level context for one database or multiple databases.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
databaseId |
string | No | null | Database entry ID for a single update |
context |
string | No | null | Context text for a single update |
mode |
string | No | replace |
replace or append |
updates |
object[] | No | [] |
Batch updates; each item may include databaseId, context, and mode |
{
"databaseId": "db_orders",
"context": "Orders database. Declared relationship: orders.CustomerId -> customers.Id.",
"mode": "append"
}{
"updates": [
{
"databaseId": "db_orders",
"context": "Orders database context.",
"mode": "replace"
},
{
"databaseId": "db_billing",
"context": "Billing database context.",
"mode": "replace"
}
]
}{
"Success": true,
"DatabaseId": "db_orders",
"Scope": "Database",
"Context": "Orders database. Declared relationship: orders.CustomerId -> customers.Id.",
"Mode": "append",
"TotalRecords": 1,
"Succeeded": 1,
"Failed": 0,
"Objects": [
{
"Success": true,
"Scope": "Database",
"DatabaseId": "db_orders",
"Context": "Orders database. Declared relationship: orders.CustomerId -> customers.Id.",
"Mode": "append",
"Error": null
}
],
"Error": null
}- Save database context only when asked, when the workflow requires durable context, or when refreshed schema proves current database context is stale.
- Put global database guidance here; put table-specific facts in
tablix_update_table_context. - Preserve human-provided facts and label inferred relationships clearly.
- Do not store secrets, credentials, raw query output, sensitive table data, or guesses as facts.
Persists table-level context for one table or multiple tables in one database.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
databaseId |
string | Yes unless supplied per item | null | Database entry ID |
tableId |
string | No | null | Table metadata ID for a single update |
tableName |
string | No | null | Table name for a single update when tableId is unknown |
context |
string | No | null | Context text for a single update |
mode |
string | No | replace |
replace or append |
updates |
object[] | No | [] |
Batch updates; each item may include databaseId, tableId, tableName, context, and mode |
{
"databaseId": "db_orders",
"tableId": "tbl_db_orders_public_orders",
"context": "Orders table. Important columns: Id, CustomerId, OrderDate, Status, Total.",
"mode": "replace"
}{
"databaseId": "db_orders",
"updates": [
{
"tableId": "tbl_db_orders_public_orders",
"context": "Orders table context.",
"mode": "replace"
},
{
"tableName": "customers",
"context": "Customers table context.",
"mode": "replace"
}
]
}{
"Success": true,
"Scope": "Table",
"DatabaseId": "db_orders",
"TableId": "tbl_db_orders_public_orders",
"TableName": "orders",
"Context": "Orders table. Important columns: Id, CustomerId, OrderDate, Status, Total.",
"Mode": "replace",
"TotalRecords": 1,
"Succeeded": 1,
"Failed": 0,
"Objects": [
{
"Success": true,
"Scope": "Table",
"DatabaseId": "db_orders",
"TableId": "tbl_db_orders_public_orders",
"TableName": "orders",
"Context": "Orders table. Important columns: Id, CustomerId, OrderDate, Status, Total.",
"Mode": "replace",
"Error": null
}
],
"Error": null
}- Save table context for durable table-specific facts: table purpose, important columns, business meanings, common joins, filters, row caveats, and query patterns.
- Prefer table IDs from
tablix_list_tables. - Use
appendfor incremental notes; usereplacefor complete curated context. - Do not store raw row data or unsupported guesses.
General context update tool retained for compatibility. Prefer the explicit aliases above when possible.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
scope |
string | No | Database |
Database or Table |
databaseId |
string | No | null | Database entry ID |
tableId |
string | No | null | Table metadata ID when scope is Table |
tableName |
string | No | null | Table name when scope is Table and tableId is unknown |
context |
string | No | null | Context text |
mode |
string | No | replace |
replace or append |
updates |
object[] | No | [] |
Batch updates; each item may include scope, databaseId, tableId, tableName, context, and mode |
{
"scope": "Table",
"databaseId": "db_orders",
"tableName": "orders",
"context": "Orders table context.",
"mode": "append"
}- Use this tool when a generic workflow needs a discriminator-based update path.
- Prefer
tablix_update_database_contextandtablix_update_table_contextfor clearer model behavior. - The same context quality and safety rules apply.
Returns database schema geometry. This can be very large.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
databaseId |
string | Yes | n/a | Database entry ID |
maxTables |
integer | No | null | Optional maximum full table geometry objects to return, clamped to 1-1000 |
skip |
integer | No | 0 |
Number of tables to skip when maxTables is used |
{
"databaseId": "db_orders",
"maxTables": 25,
"skip": 0
}When maxTables is omitted, the response is DatabaseDetail.
{
"DatabaseId": "db_orders",
"Type": "Postgresql",
"DatabaseName": "orders",
"Schema": "public",
"Context": "Orders database for reporting.",
"Tables": [],
"CrawledUtc": "2026-07-11T12:00:00.000Z",
"IsCrawled": true,
"CrawlError": null
}When maxTables is supplied, the response includes pagination metadata and a Tables page.
{
"DatabaseId": "db_orders",
"Type": "Postgresql",
"DatabaseName": "orders",
"Schema": "public",
"Context": "Orders database for reporting.",
"CrawledUtc": "2026-07-11T12:00:00.000Z",
"IsCrawled": true,
"CrawlError": null,
"MaxResults": 25,
"Skip": 0,
"TotalRecords": 120,
"RecordsRemaining": 95,
"EndOfResults": false,
"NextSkip": 25,
"Tables": []
}{ "Error": "databaseId is required" }{ "Error": "Database 'missing' not found" }- Avoid this tool for large databases unless using
maxTables. - Prefer
tablix_list_tables,tablix_list_relationships, andtablix_discover_tablefor high-fidelity targeted work. - If using paging, continue with
skip = NextSkipuntilEndOfResultsis true. - Do not assume a paged response is complete unless
EndOfResultsis true.
Most MCP validation failures are returned as plain JSON objects with Error or as QueryResult with Success: false.
Common examples:
{ "Error": "databaseId is required" }{ "Error": "Database 'db_missing' not found" }{
"Success": false,
"DatabaseId": "db_orders",
"Error": "Query type DELETE is not allowed."
}- Use compact tools first.
- Keep page sizes modest.
- Follow
NextSkip. - Do not ask for full-database geometry unless necessary.
- Use
filterandschemawhenever the user question narrows the domain. - Gather relationships before writing joins.
- Inspect full table geometry before writing SQL.
Good saved context includes:
- Business purpose of the database.
- Important tables and their roles.
- Declared relationships, clearly identified as declared.
- Inferred relationships, clearly identified as inferred.
- Common query patterns.
- Caveats such as degraded crawl state or absent declared foreign keys.
Do not save:
- Passwords, usernames, tokens, API keys, or connection strings.
- Raw query result rows.
- Sensitive personal data copied from tables.
- Unsupported guesses phrased as facts.