Get Decision Context
Type: Function
Retrieve the complete governance context for a single table. This returns everything an AI agent needs to understand the rules governing a table: policy summaries, business context, compliance requirements, retention rules, lineage, and tags.
Use Cases
- An AI agent needs to understand what rules apply to a table before generating a query
- A data steward reviews the full governance posture of a table during an audit
- An automated workflow checks compliance requirements before scheduling a data pipeline
- An agent explains to a user why certain restrictions exist on a table
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
table_name | string | Yes | Fully qualified table name (DB.SCHEMA.TABLE). Case-insensitive. |
Output Schema
Returns a single governance context object:
| Field | Type | Description |
|---|---|---|
table_name | string | Fully qualified table name as stored in governance tables |
sensitivity | string | Table-level sensitivity: public, internal, confidential, or restricted |
enforcement_mode | string | How policies are enforced: enforced, advisory, or mixed |
policy_summary | object | Aggregate policy counts |
policy_summary.total | integer | Total number of policies applied |
policy_summary.enforceable | integer | Policies with enforcement mode enforced |
policy_summary.advisory | integer | Policies with enforcement mode advisory |
business_context | object | Business metadata |
business_context.owner | string | Data owner or owning team |
business_context.steward | string | Data steward responsible for governance |
business_context.domain | string | Business domain |
business_context.purpose | string | Description of the table's purpose |
lineage | object | Data lineage information |
lineage.upstream | array | Tables that feed into this table |
lineage.downstream | array | Tables that consume from this table |
compliance | object | Compliance metadata |
compliance.regulations | array | Applicable regulations (e.g., ["GDPR", "CCPA"]) |
compliance.certifications | array | Certifications the table falls under (e.g., ["SOC2"]) |
retention | object | Retention policy |
retention.period | string | Retention duration (e.g., "7 years") |
retention.trigger | string | What starts the retention clock (e.g., "record_creation") |
retention.action | string | What happens at expiry (e.g., "delete", "archive") |
tags | object | Key-value tag pairs applied to the table |
Example Response
{
"status": "success",
"data": {
"table_name": "ANALYTICS_DB.CORE.CUSTOMERS",
"sensitivity": "confidential",
"enforcement_mode": "enforced",
"policy_summary": {
"total": 3,
"enforceable": 2,
"advisory": 1
},
"business_context": {
"owner": "data_engineering",
"steward": "jane.doe@company.com",
"domain": "customer_data",
"purpose": "Master customer record for analytics and CRM integrations"
},
"lineage": {
"upstream": ["RAW_DB.INGESTION.CRM_CUSTOMERS"],
"downstream": ["ANALYTICS_DB.REPORTING.CUSTOMER_METRICS"]
},
"compliance": {
"regulations": ["GDPR", "CCPA"],
"certifications": ["SOC2", "ISO27001"]
},
"retention": {
"period": "7 years",
"trigger": "record_creation",
"action": "archive"
},
"tags": {
"cost_center": "CC-1234",
"data_product": "customer_360"
}
},
"errors": []
}
SQL Examples
Get governance context for a table
SELECT METATATE_APP.CORE.GET_GOVERNANCE_CONTEXT(
OBJECT_CONSTRUCT('table_name', 'ANALYTICS_DB.CORE.CUSTOMERS')
);
Parse specific fields from the response
SELECT
result:data:sensitivity::STRING AS sensitivity,
result:data:policy_summary:total::INT AS total_policies,
result:data:compliance:regulations AS regulations
FROM (
SELECT METATATE_APP.CORE.GET_GOVERNANCE_CONTEXT(
OBJECT_CONSTRUCT('table_name', 'ANALYTICS_DB.CORE.CUSTOMERS')
) AS result
);
JSON Request / Response (API)
Request:
{
"method": "tools/call",
"params": {
"name": "get-decision-context",
"arguments": {
"table_name": "ANALYTICS_DB.CORE.CUSTOMERS"
}
}
}
Response:
{
"content": [
{
"type": "text",
"text": "{\"status\":\"success\",\"data\":{\"table_name\":\"ANALYTICS_DB.CORE.CUSTOMERS\",\"sensitivity\":\"confidential\",\"enforcement_mode\":\"enforced\",\"policy_summary\":{\"total\":3,\"enforceable\":2,\"advisory\":1},\"business_context\":{\"owner\":\"data_engineering\",\"steward\":\"jane.doe@company.com\",\"domain\":\"customer_data\",\"purpose\":\"Master customer record for analytics and CRM integrations\"},\"lineage\":{\"upstream\":[\"RAW_DB.INGESTION.CRM_CUSTOMERS\"],\"downstream\":[\"ANALYTICS_DB.REPORTING.CUSTOMER_METRICS\"]},\"compliance\":{\"regulations\":[\"GDPR\",\"CCPA\"],\"certifications\":[\"SOC2\",\"ISO27001\"]},\"retention\":{\"period\":\"7 years\",\"trigger\":\"record_creation\",\"action\":\"archive\"},\"tags\":{\"cost_center\":\"CC-1234\",\"data_product\":\"customer_360\"}},\"errors\":[]}"
}
]
}
Try it in the app
Open Metatate and navigate to the Test Tools tab to run get-decision-context interactively. Enter a fully qualified table name and see the full governance context rendered as formatted JSON.