Skip to main content

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

ParameterTypeRequiredDescription
table_namestringYesFully qualified table name (DB.SCHEMA.TABLE). Case-insensitive.

Output Schema

Returns a single governance context object:

FieldTypeDescription
table_namestringFully qualified table name as stored in governance tables
sensitivitystringTable-level sensitivity: public, internal, confidential, or restricted
enforcement_modestringHow policies are enforced: enforced, advisory, or mixed
policy_summaryobjectAggregate policy counts
policy_summary.totalintegerTotal number of policies applied
policy_summary.enforceableintegerPolicies with enforcement mode enforced
policy_summary.advisoryintegerPolicies with enforcement mode advisory
business_contextobjectBusiness metadata
business_context.ownerstringData owner or owning team
business_context.stewardstringData steward responsible for governance
business_context.domainstringBusiness domain
business_context.purposestringDescription of the table's purpose
lineageobjectData lineage information
lineage.upstreamarrayTables that feed into this table
lineage.downstreamarrayTables that consume from this table
complianceobjectCompliance metadata
compliance.regulationsarrayApplicable regulations (e.g., ["GDPR", "CCPA"])
compliance.certificationsarrayCertifications the table falls under (e.g., ["SOC2"])
retentionobjectRetention policy
retention.periodstringRetention duration (e.g., "7 years")
retention.triggerstringWhat starts the retention clock (e.g., "record_creation")
retention.actionstringWhat happens at expiry (e.g., "delete", "archive")
tagsobjectKey-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.