On this page
AWS Context became generally available on 1 December 2026 in N. Virginia, Oregon and Ireland. It builds a graph from the metadata of your data sources and gives agents one MCP endpoint to search that graph, ask questions of it and run read-only SQL. The pitch is that an agent stops guessing what your tables mean.
I pointed it at a small AWS Glue Data Catalog database to see what the graph holds, what it works out for itself, how an agent reaches it over MCP, and whether table permissions are respected. Short version: the catalog arrives in the graph in minutes and stays current within a minute; SQL and question answering returned correct numbers; data access followed the IAM role I gave it. Two things did not match the pitch. Nothing in the graph related one table to another after 35 minutes, so joins were inferred by the answering model at question time. And a role that could not read a table could still see that the table exists, its columns and their descriptions.

Test Setup
One script, run from AWS CloudShell in eu-west-1 with boto3 1.44.18 (the client is named context). It writes five small Parquet tables of synthetic web shop data to S3 and registers them in a new Glue database: customers (200 rows), products (40), orders (1,000), order_items (2,454) and payments (482). Some tables and columns carry Glue descriptions and some are left bare. The column that links an order to its customer is named cust_id in orders and customer_id in customers, on purpose. Because the generator is seeded, the script knows the right answer to every question it asks.
I was signed in as the account root user, which cannot assume roles, so I tested permissions through the connection and not through the caller. Three connections point at the same database, each with its own graph:
| Connection | Data access role | Purpose |
|---|---|---|
caller | None; queries run with the caller’s credentials | Default behaviour |
full | A role that can read all five tables | Fixed role with full access |
limited | A role with no Glue or S3 access to payments | What a restricted role can query and see |
API Prerequisites
Three things stood between an empty account and a first graph when using the API, and each cost me a failed call.
Glue auto-discovery is an account setting. Glue pushes catalog metadata to AWS Context only when auto-discovery is on, and it was off in my account. The user guide describes a console switch. The API behind it is in Glue:
before = glue.get_catalog_discovery()["Mode"] # "OPTED_OUT" in my account
glue.put_catalog_discovery(Mode="OPTED_IN") # account-wide for the Region; reversibleThe scope selector has its own vocabulary. A connection to the whole catalog uses one path element, glueService = GLUE. To limit it to one database I tried the level name database and was refused; the error lists the accepted levels, and glueDatabase is the one that works. Scope matters here because auto-discovery is account-wide: without a selector, every database in the catalog is in play.
An ontology mapping is mandatory, and the documented ID did not work. CreateAgentContext rejects a connection mapping with no ontology. The built-in ontologies page says to refer to the built-in Data ontology by the ID data. With a Glue connection that returned “Custom ontologies are supported only on Bedrock Knowledge Base connections”. GetOntology for data returns an ARN with an empty account field, and passing that ARN was accepted:
made = ctx.create_connection(
name=f"{name}-limited",
dataSource={"type": "GLUE_DATA_CATALOG", "location": {"arn": f"arn:aws:glue:{REGION}:{ACCOUNT}:catalog"}},
scope={"selectors": [{"path": [{"level": "glueService", "id": "GLUE"}, {"level": "glueDatabase", "id": database}]}]},
ingestionConfig={"roleArn": ingestion_role_arn}, # Glue assumes this role to send metadata
accessConfig={"iamRole": {"roleArn": limited_role_arn}}, # omit to query with the caller's credentials
clientToken=str(uuid.uuid4()),
)
graph = ctx.create_agent_context(
name=f"{name}-limited",
connectionMappings=[{"connectionId": made["id"],
"ontologyMappings": [{"ontologyId": f"arn:aws:context:{REGION}::ontology/data"}]}],
clientToken=str(uuid.uuid4()),
)CreateConnection returns ACTIVE immediately, which the guide notes means the connection exists and not that anything has been ingested. The three graphs were ACTIVE when I checked six to seven minutes after creating them. Until then, search returns HTTP 409 with “The context graph is being allocated and is not ready yet”.
Graph Contents
About ten minutes after creation I listed every node I could reach by search and walked the edges around each table.
| Node type | Count | Source |
|---|---|---|
Database (node ID prefix glueDatabase) | 1 | The Glue database |
AWS::CONTEXT::TABLE | 5 | Glue tables, with description, database name and table ARN |
AWS::CONTEXT::COLUMN | 23 | Glue columns, with data type and description |
AWS::CONTEXT::JOB | 5 | Lineage that Glue generated itself, one per table, named glue_manual.<database>.<table> |
AWS::CONTEXT::LINEAGE_DATASET | 5 | The S3 location of each table |
The edges were HAS_TABLE, HAS_COLUMN, PRODUCES and CONSUMES. That is the catalog and its storage lineage, faithfully copied. Every description I had written in Glue was there. The summary field on each node was empty.
The first inventory was not complete. One of the three graphs was missing the five columns of orders, and all three had four HAS_TABLE edges for five tables. Ten minutes later all three were whole. A graph that reports ACTIVE can still be filling in, and I found no field that says ingestion has finished.
%%{init: {'theme':'base','themeVariables':{'primaryColor':'#FFF3E0','primaryTextColor':'#232F3E','primaryBorderColor':'#FF9900','lineColor':'#232F3E','clusterBkg':'#F8FAFC','clusterBorder':'#CBD5E1','edgeLabelBackground':'#FFFFFF','nodeTextColor':'#232F3E'}}}%%
flowchart TD
A["Glue Data Catalog
database, tables, columns"] -->|"auto-discovery pushes metadata
with the ingestion role"| B["AWS Context connection
scoped to one database"]
B --> C["Agent Context (graph)
Data ontology"]
C --> D["Nodes: database, table, column,
lineage job, lineage dataset"]
C --> E["MCP endpoint
search, traverse, retrieve, SQL"]
E -->|"ExecuteSql with the data access role
or the caller's credentials"| F["Table data in Amazon S3"]
classDef compute fill:#FFF3E0,stroke:#FF9900,stroke-width:2px,color:#232F3E
classDef db fill:#EBF8FF,stroke:#0073BB,stroke-width:2px,color:#004C74
classDef store fill:#F0FFF4,stroke:#1D8102,stroke-width:2px,color:#145202
classDef mesh fill:#F3E8FF,stroke:#7C3AED,stroke-width:2px,color:#4C1D95
class A,D db
class B,C compute
class E mesh
class F store
Inferred Relationships
This is the part I most wanted to see. The architecture page describes background enrichment that discovers join paths between tables. I checked at about 10, 20 and 35 minutes after creation, in all three graphs, by walking every edge around every table node. There was no edge between two tables and nothing with a join in it. At 35 minutes I asked the service directly whether a join between orders and customers was defined. It replied that none was, that the orders table had edges only to its columns, its schema and its lineage job, and that the likely key pair rested on column names and types. Entity resolution was enabled by default on each graph.
The answering model said the same thing in its own words. Asked which tables and columns to join for revenue by product category, it gave the right join and added: “No relationship between the two tables is defined in your context, so I inferred the join key from matching column names.” Asked which column links an order to its customer, it found cust_id by sampling the table and described the match to customer_id as its own inference from names and sample values, which it had not tested.
In this test the graph held no relationship between tables. Joins came from the answering model matching column names at question time. That worked for product_id and for cust_id on five tidy tables. I would not assume it on a warehouse where the same name means different things in different schemas. The guide does not say how long join discovery takes or what triggers it, and I did not wait longer than 35 minutes. The API can import a data dictionary and verified queries, which are the obvious place to state relationships; I did not test either.
Search and Traversal
SearchAgentContext answered in 0.2 to 0.4 seconds. Semantic search behaved well: “customer email address” returned the customers table first and the email column third. Keyword search surprised me. The query orders returned the lineage job and the S3 dataset for that table and then the payments table; the orders table node was not among the three results. On a catalog with thousands of tables, the lineage nodes that Glue adds for every table will compete with the tables themselves in keyword results, and a filter on node type is worth adding to every call.
TraverseAgentContext takes a node ID, a direction and a depth, and returns the nodes reached with the edges on the path. Node IDs are readable and built from the source, for example glueTable: followed by the URL-encoded table ARN, so an agent that knows a table ARN can go straight to its node.
Agentic Retrieval
AgenticRetrieve takes a conversation and returns an answer, the context items it used and citations into them. I asked four questions.
| Question | Time | Result |
|---|---|---|
| Which tables and columns do I join to get revenue by product category? | 14.5 s | Correct join on product_id; stated that it was inferred. 49 context items, 10 citations |
| How many orders have the status SHIPPED? | About 13 s | 250, which is correct. It ran a count on the table itself |
| Which column links an order to the customer who placed it? | 9.3 s | cust_id, found by sampling rows; match to customer_id flagged as inference |
| Which tables hold personal or payment data? | About 6 s | customers and payments, quoting my Glue column descriptions |
Two things stand out. The service does more than retrieve: for the count it queried the data and returned the number. And the last answer was only as good as the catalog. It identified personal data because a column description said “personal data”. The tables I had left without descriptions were reported as having no such markings, which is true of the metadata and says nothing about the data. Column descriptions in Glue are now input to every agent answer, and worth the effort they have rarely received.
The answers were candid about gaps. When the orders columns had not been ingested yet, the answer said it had no column details for that table and could not check it.
ExecuteSql
ExecuteSql runs one read-only statement on a built-in engine. Tables are referenced by their full Glue table ARN in double quotes, and each one must also be listed in the request. The guide gives the limits: SELECT or WITH only, 1 to 10 tables, 50,000 rows with silent truncation, 5 MiB, 30 seconds, and two concurrent queries per account.
arn = f"arn:aws:glue:{REGION}:{ACCOUNT}:table/{database}/orders"
got = ctx.execute_sql(
agentContextId=context_id, connectionId=connection_id,
query={"sql": {"statement": f'SELECT "status", COUNT(*) AS n FROM "{arn}" GROUP BY "status" ORDER BY "status"',
"tables": [{"glueTableArn": arn}]}},
)
rows = [[next(iter(v.values())) for v in r["values"]] for r in got["rows"]]| Statement | Time | Result |
|---|---|---|
| Orders by status | 0.8 to 1.0 s | 275 / 243 / 232 / 250, equal to the generator |
| Revenue by category, two-table join | 0.9 to 1.1 s | Four totals, equal to the generator to the cent |
| Count of payments | 0.8 to 0.9 s | 482, correct |
Same query with status unquoted | 0.4 s | Rejected: “Column ‘STATUS’ not found in any table; did you mean ‘status'” |
| Table used but not listed in the request | 0.4 s | Rejected: object not found |
DELETE FROM ... | 0.1 s | Rejected: “Only read-only SELECT or WITH statements are supported” |
The engine folds unquoted identifiers to upper case, and Glue column names are lower case. Every column reference needs double quotes, or the query fails with a “did you mean” error. An agent that writes SQL in the usual unquoted style will fail on its first attempt against every Glue table; put this in the tool description or system prompt.
Data Access and Metadata Visibility
Data access did what the documentation says. Through the limited connection, queries on the four permitted tables worked and both queries that touched payments were refused with a specific message: “Failed to resolve the Glue table … is not authorized to perform: glue:GetTable”. The session name in that message shows AWS Context assuming the connection’s role for the query. Through the caller connection the same queries ran with my own credentials.
Metadata is a different matter. In the graph built on the limited connection, a search for card_last4 returned the column node with its description, “Last four digits of the payment card”, and a search for payments returned the table’s lineage nodes. Asked about the payments table, the answering model listed its columns and then reported that its row count failed because of the role.
Anyone who can call the graph can see the names and descriptions of every table and column in the connection scope, whatever the data access role or their own Glue permissions allow. The documentation states this for Glue sources; the test confirms it. If table or column names are themselves sensitive, the controls are the connection scope (which databases are ingested at all) and who may call each graph. Lake Formation column and row filters were not part of this test.
MCP Endpoint
There is one endpoint per Region, https://context-mcp.eu-west-1.api.aws/mcp, speaking Streamable HTTP with SigV4 and the signing name context-mcp. I called it with plain JSON-RPC so that nothing sat between the test and the wire.
def rpc(url: str, body: dict) -> tuple[int, dict]:
data = json.dumps(body).encode()
headers = {"Content-Type": "application/json", "Accept": "application/json, text/event-stream"}
request = AWSRequest(method="POST", url=url, data=data, headers=headers)
SigV4Auth(session.get_credentials().get_frozen_credentials(), "context-mcp", REGION).add_auth(request)
try:
with urllib.request.urlopen(urllib.request.Request(url, data=data, headers=dict(request.headers), method="POST"), timeout=90) as response:
return response.status, json.loads(response.read().decode())
except urllib.error.HTTPError as error:
return error.code, {"error": error.read().decode()[:400]}The block above is the core of the function in the sample, which also handles an event-stream reply and a session header; the endpoint used neither.
| Call | Result |
|---|---|
| Unsigned request | HTTP 401, JSON-RPC error -32001 “Authentication failed” |
initialize | 0.04 s; protocol 2025-03-26; server ContextMcpGateway 1.0.0; tools capability only; plain JSON, no session ID |
tools/list, first page | 4 tools: AcceptCurationProposal, AgenticRetrieve, AgenticRetrieveStream, CreateChangeSet |
tools/list, second page | 14 more, including ExecuteSql, SearchAgentContext and TraverseAgentContext |
tools/call SearchAgentContext | 0.22 s; 2,803 characters |
tools/call AgenticRetrieve | 9.5 s; 25,148 characters in one content block |
%%{init: {'theme':'base','themeVariables':{'primaryColor':'#FFF3E0','primaryTextColor':'#232F3E','primaryBorderColor':'#FF9900','lineColor':'#232F3E','signalColor':'#0073BB','signalTextColor':'#0F172A','actorBkg':'#FFF3E0','actorBorder':'#FF9900','actorTextColor':'#232F3E','noteBkgColor':'#FFF8E7','noteBorderColor':'#FF9900','noteTextColor':'#232F3E'}}}%%
sequenceDiagram
participant A as Agent (MCP client)
participant M as Context MCP endpoint
participant G as Context graph
participant D as Glue table data
A->>M: initialize (SigV4, context-mcp)
M-->>A: Protocol 2025-03-26, tools
A->>M: tools/list
M-->>A: 4 tools and a nextCursor
A->>M: tools/list with cursor
M-->>A: 14 more tools
A->>M: tools/call AgenticRetrieve
M->>G: Search and traverse
M->>D: Read-only SQL with the data access role
M-->>A: Answer, context items, citations
Three points for anyone wiring an agent to it. The tool list is paged, and the first page holds two curation tools and no search or SQL, so a client that ignores nextCursor gets an agent that can accept curation proposals and cannot look anything up. The list includes write tools for curation; if the agent should only read, restrict it with IAM, because the endpoint lists every tool to every caller. And one AgenticRetrieve result was about 25,000 characters, most of it the context items behind the answer. That is several thousand tokens added to the conversation per question, on top of nine seconds of waiting. For simple lookups, SearchAgentContext followed by ExecuteSql is faster and far smaller.
Freshness After a Schema Change
With everything running, I added a column to customers and created a sixth table in Glue, then polled the graph every 20 seconds. The new column was searchable at the first poll, 21 seconds after the change, and the new table at the second, 41 seconds. No sync was requested. For catalog changes, the push model is as quick as I could measure.
Design Guidance
- Scope every connection. Auto-discovery is account-wide and a connection without a selector covers the whole catalog. Create one connection per data domain with a
glueDatabaseselector, and treat the list of databases in scope as a security decision. - Classify names before you connect. Table and column names and descriptions are visible to every caller of a graph. Where names reveal something (a table called
hiv_test_results, a column calledsalary), keep that database out of scope or put it in a separate graph with a short list of callers. - Decide whose permissions run the query. With no data access role, queries run as the caller, which suits a human analyst. With a role on the connection, every caller of that graph reads with that role, which suits a service agent and needs the role to be as narrow as the agent’s purpose.
- Write the descriptions. Answers about meaning came straight from Glue descriptions. An undocumented column is an unknown column to the agent.
- State the joins yourself. Until join paths appear in your own graph, supply relationships through the data dictionary or verified queries, and test with a column pair that does not share a name.
- Give the agent the SQL rules. Full table ARN in double quotes, every column in double quotes, tables declared in the request, ten tables at most, 50,000 rows without a warning.
- Check ingestion yourself.
ACTIVEdoes not mean complete. Compare node counts with the catalog before an agent depends on a new graph.
Recommendation
Use it now for what it demonstrably is: a managed, always-current copy of your Glue catalog that agents can search over MCP, with correct read-only SQL and data access governed by IAM. That alone replaces a fair amount of home-built schema retrieval. Do not yet rely on it to know how your tables relate; in this test that knowledge came from the model reading column names. Before connecting a regulated catalog, settle the metadata question, because names and descriptions are not filtered. I would start with one well-described database, a narrow data access role, and a read-only agent, and measure the token cost of AgenticRetrieve against plain search plus SQL.
A note on testing: I ran one script from AWS CloudShell in eu-west-1 on 4 December 2026 with boto3 1.44.18, signed in as the account root user. Every figure is from a single run on five small tables, so the timings show order of magnitude and nothing about scale. My first attempt to time the first search result failed because the polling call hung, so I can only say the graphs were active when I checked six to seven minutes after creation. I looked for join paths for 35 minutes and no longer. I did not test Lake Formation permissions, column or row filters, a caller with fewer permissions than the root user, S3 Tables, Amazon Redshift or document sources, custom ontologies, curation, data dictionary or verified query imports, the streaming retrieval call, the 50,000-row limit, or an MCP client library. I could not open the pricing page, so the article gives no price for retrieval; the announcement says creating and storing graphs for eligible AWS data services has no additional charge. Glue auto-discovery was off before the test and I turned it off again afterwards. The bucket, Glue database, roles, connections and graphs were deleted. Account ID and bucket name are replaced in everything shown.
The complete sample for this article is on GitHub: nithinmohantk/blog-samples-working-repo/aws-context-glue-catalog-tested. Clone it with git clone https://github.com/nithinmohantk/blog-samples-working-repo.git and open the aws-context-glue-catalog-tested folder. Its README says how to run it and what has been verified.
References & Further Reading
- → AWS Context is now generally available— The AWS announcement, 1 December 2026: Regions, what is in preview
- → Architecture layers and end-to-end flow— AWS Context User Guide
- → AWS Glue tables and S3 tables— Auto-discovery, the ingestion role and the data access role
- → Built-in ontologies— The Data, Enterprise and Business Process ontologies
- → Query tables with ExecuteSql— Statement rules and limits
- → Source-native permissions— What is and is not filtered for each source type
- → The AWS Context MCP server— Endpoint, tools and paging
- → Sample code for this article— The lab script and its recorded output
Discover more from C4: Container, Code, Cloud & Context
Subscribe to get the latest posts sent to your email.