Context / Client / get_agent_context
get_agent_context¶
- Context.Client.get_agent_context(**kwargs)¶
Returns an agent context’s configuration and status.
See also: AWS API Documentation
Request Syntax
response = client.get_agent_context( agentContextId='string' )
- Parameters:
agentContextId (string) –
[REQUIRED]
The agent context to return, by its ID or ARN.
- Return type:
dict
- Returns:
Response Syntax
{ 'id': 'string', 'arn': 'string', 'name': 'string', 'description': 'string', 'status': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'FAILED', 'createdAt': datetime(2015, 1, 1), 'updatedAt': datetime(2015, 1, 1), 'connectionMappings': [ { 'connectionId': 'string', 'ontologyMappings': [ { 'ontologyId': 'string' }, ], 'dataFilter': { 'filters': [ { 'fileType': 'string', 'excludeTags': [ 'string', ], 'includeTags': [ 'string', ], 'updatedAfter': datetime(2015, 1, 1), 'createdAfter': datetime(2015, 1, 1), 'maxDocumentSizeBytes': 123 }, ] }, 'extractionDepth': 'string', 'pathSegments': [ { 'level': 'string', 'id': 'string' }, ], 'type': 'GLUE_DATA_CATALOG'|'BEDROCK_KNOWLEDGE_BASE'|'DATABRICKS'|'SNOWFLAKE' }, ], 'encryptionConfig': { 'encryptionMode': 'AWS_OWNED'|'CUSTOMER_MANAGED', 'keyArn': 'string' }, 'traceAnalysisConfig': { 'status': 'ENABLED'|'DISABLED', 'traceAnalysisRole': 'string', 'includeContextAgentTraces': 'ENABLED'|'DISABLED' }, 'workforceSignInConfig': { 'status': 'ENABLED'|'DISABLED', 'signInUrl': 'string' }, 'entityResolutionConfig': { 'status': 'ENABLED'|'DISABLED' }, 'mcpServerUrl': 'string', 'trustedIdentitySources': [ { 'identityStoreArn': 'string', 'identityProviderArn': 'string' }, ] }
Response Structure
(dict) –
An agent context, as returned by CreateAgentContext, GetAgentContext, and UpdateAgentContext.
id (string) –
The agent context’s opaque ID.
arn (string) –
The ARN of the agent context, in the form
arn:<partition>:context:<region>:<account-id>:agent-context/<id>.name (string) –
The name of the agent context. If you didn’t specify a name when you created it, the name is
default.description (string) –
A human-readable description, if one was set.
status (string) –
The agent context’s lifecycle status.
Valid values:
CREATING- The agent context is being created.ACTIVE- The agent context is ready to use.UPDATING- The agent context is being updated.DELETING- The agent context is being deleted.FAILED- The agent context failed.
createdAt (datetime) –
The date and time when the agent context was created.
updatedAt (datetime) –
When the resource last changed. Equal to
createdAtuntil the first update.connectionMappings (list) –
The agent context’s connection mappings.
(dict) –
A connection mapping entry on CreateAgentContext and UpdateAgentContext. Each entry binds a connection to one or more ontologies within the agent context, optionally scoped by a data filter, extraction depth, and path segments.
connectionId (string) –
The connection, by its ID (which starts with
conn-) or its full ARN. Required. AWS Context resolves an ID to an ARN in your account and the current Region.ontologyMappings (list) –
The ontology mappings for this connection mapping. Each entry identifies an ontology that this mapping targets.
BEDROCK_KNOWLEDGE_BASErejects the AWS managed Data ontology.GLUE_DATA_CATALOGrejects the AWS managed Enterprise and Business Process ontologies. AWS Context accepts a new or changed mapping to a customer-owned ontology only onBEDROCK_KNOWLEDGE_BASE. An incompatible mapping, or an ontology that isn’tPUBLISHED, fails withValidationException.(dict) –
A single ontology mapping entry within a ConnectionMapping. Contains the ontology identifier.
ontologyId (string) –
The ontology that this mapping targets, by its ID or ARN.
dataFilter (dict) –
Optional. The data filter for this connection mapping. A document matches if it matches any filter in the list. Within a filter, all conditions must match. If you omit it, every document matches.
filters (list) –
The filters. An asset matches if it matches at least one filter in the list. If the list is absent or empty, every asset matches.
(dict) –
A filter that selects documents in a connection mapping. All members are optional, and a document must match every condition in the filter. When a mapping has more than one filter, a document that matches any of them is selected.
updatedAfter,includeTags, andexcludeTagsapply to all connection types.createdAfterapplies only toBEDROCK_KNOWLEDGE_BASEconnections; for other connection types it doesn’t exclude any document.fileTypeandmaxDocumentSizeBytesapply only toBEDROCK_KNOWLEDGE_BASEconnections, and specifying either for another connection type fails withValidationException. You can’t specify bothincludeTagsandexcludeTagsin one filter.fileType (string) –
The file type to match, for example PDF or DOCX. Applies only to BEDROCK_KNOWLEDGE_BASE connections.
excludeTags (list) –
The tags to exclude: 1–25 strings, each 1–256 characters. Applies to all connection types. You can’t specify both
excludeTagsandincludeTagsin one filter.(string) –
A single tag value within a TagSet.
includeTags (list) –
The tags to include: 1–25 strings, each 1–256 characters. Applies to all connection types. You can’t specify both
includeTagsandexcludeTagsin one filter.(string) –
A single tag value within a TagSet.
updatedAfter (datetime) –
Documents updated after this time match. Applies to all connection types.
createdAfter (datetime) –
Documents created after this time match. Applies only to
BEDROCK_KNOWLEDGE_BASEconnections. For other connection types, it doesn’t exclude any document.maxDocumentSizeBytes (integer) –
The maximum document size, in bytes. Applies only to BEDROCK_KNOWLEDGE_BASE connections. Documents larger than this are filtered out. If you omit it, there is no size limit. Range: 1 to 52,428,800 bytes (50 MiB).
extractionDepth (string) –
Optional extraction depth override for BEDROCK_KNOWLEDGE_BASE connections.
pathSegments (list) –
The path segments that scope ingestion within the data source, 0–100 segments. Optional. An empty list is the same as omitting the field and matches everything. The segments name levels from one branch of the connection type’s level hierarchy. The container levels form a contiguous prefix of that branch that starts at its root, and a link can also name the table level. AWS Context rejects a link that mixes branches. The branches are the following:
GLUE_DATA_CATALOG- The native branch (glueDatabase, glueTable) and one branch for each federated AWS data source:redshiftNamespace, redshiftDatabase, redshiftSchema, redshiftTable,rdsInstance, rdsDatabase, rdsSchema, rdsTable,s3TableBucket, s3Namespace, s3Table, andsagemakerModelGroup.SNOWFLAKE-snowflakeDatabase, snowflakeSchema, snowflakeTable.DATABRICKS-databricksCatalog, databricksSchema, databricksTable.
The connection holds the source’s identity, such as the account locator or metastore ID, so it isn’t a segment. AWS Context matches IDs as opaque strings against the source’s coordinate values.
(dict) –
One segment of a resource hierarchy path: the hierarchy
level, such asdatabaseortable, and theidof the resource at that level. Both are required.In a
GLUE_DATA_CATALOGconnection’s scope, the levelglueServicenames a service instead of a resource. Itsidis one of the following:GLUE- AWS Glue databases and tables.SAGEMAKER_AI- Amazon SageMaker AI resources.REDSHIFT- Amazon Redshift resources.RDS- Amazon RDS resources.MSK- Amazon Managed Streaming for Apache Kafka (Amazon MSK) resources.KINESIS- Amazon Kinesis Data Streams resources.FIREHOSE- Amazon Data Firehose resources.DYNAMODB- Amazon DynamoDB resources.KEYSPACES- Amazon Keyspaces (for Apache Cassandra) resources.ELASTICACHE- Amazon ElastiCache resources.OPENSEARCH- Amazon OpenSearch Service resources.NEPTUNE- Amazon Neptune resources.TIMESTREAM- Amazon Timestream resources.ATHENA- Amazon Athena resources.GLUE_SCHEMA_REGISTRY- AWS Glue Schema Registry resources.S3- Amazon S3 resources.S3_VECTORS- Amazon S3 Vectors resources.
Every later segment of the selector must name a level of that service. Any other value, a second
glueServicesegment, or aglueServicesegment in any other position returnsValidationException. A resource path never containsglueService.level (string) –
The hierarchy level name for this segment (for example, “database”, “table”). Non-blank, no whitespace.
id (string) –
The ID of the resource at this level. Non-blank. Can contain spaces, backticks, and
%(it is a resource name), but no control characters. AWS Context matches it exactly.
type (string) –
The connection’s data source type. AWS Context sets it from the referenced connection’s data source type when you create or update the mapping. Read-only.
Valid values:
GLUE_DATA_CATALOG- An AWS Glue Data Catalog, or an AWS Glue connection that fronts a federated AWS data source.BEDROCK_KNOWLEDGE_BASE- An Amazon Bedrock knowledge base.DATABRICKS- A Databricks third-party catalog.SNOWFLAKE- A Snowflake third-party catalog.
encryptionConfig (dict) –
The agent context’s encryption settings.
encryptionMode (string) –
How the agent context’s stored data is encrypted. Always present on the resource.
Valid values:
AWS_OWNED- Encrypted with an AWS owned key.CUSTOMER_MANAGED- Encrypted with the AWS KMS customer managed key thatkeyArnspecifies.
keyArn (string) –
The ARN of the AWS KMS customer managed key that encrypts the agent context when
encryptionModeisCUSTOMER_MANAGED. Absent forAWS_OWNED.
traceAnalysisConfig (dict) –
The agent context’s trace analysis settings.
status (string) –
Specifies whether you allow AWS Context to use
traceAnalysisRoleto analyze this agent context’s agent traces, and to capture its own agents’ traces asincludeContextAgentTracesspecifies. Defaults toENABLEDwhen you settraceAnalysisConfigon CreateAgentContext. Setting it toENABLEDrequirestraceAnalysisRole. Setting it toDISABLEDremoves the role. An agent context that has never set it readsENABLEDwhen it has atraceAnalysisRole, andDISABLEDotherwise.traceAnalysisRole (string) –
The IAM role that AWS Context assumes to access the agent context’s connected source data when it analyzes agent traces. The role must be in the same account as the agent context. Its trust policy must allow the AWS Context service principal, with
aws:SourceArnset to the agent context’s ARN andaws:SourceAccountset to its account. You must haveiam:PassRolepermission on the role to pass it to AWS Context. Otherwise, the request fails withAccessDeniedException. Required to setstatustoENABLED. You can’t set it whilestatusisDISABLED.includeContextAgentTraces (string) –
Specifies whether trace analysis includes traces from the agents built into AWS Context, such as the retrieval agent. Uses
traceAnalysisRoleand takes effect only whilestatusisENABLED. An agent context that has never set it readsENABLED.
workforceSignInConfig (dict) –
How your employees sign in to this agent context’s MCP server through your identity provider (workforce sign-in).
statusreads ENABLED while a sign-in URL is stored, DISABLED otherwise.status (string) –
Whether workforce sign-in is on. Reads ENABLED while a
signInUrlis stored, DISABLED otherwise. On Create, a config with asignInUrldefaults to ENABLED. On Update, DISABLED removes the storedsignInUrl. ENABLED requires asignInUrl, supplied in the same request or already stored on the resource.signInUrl (string) –
The URL that starts a sign-in to your AWS application at the identity provider. For example, an Okta application link, a Microsoft Entra My Apps link, or an IAM Identity Center access portal URL. HTTPS only, a single line with no whitespace, 9 to 2048 characters. Sent alone, it replaces the stored URL and turns sign-in ENABLED. It cannot be sent together with
statusDISABLED in the same request.
entityResolutionConfig (dict) –
The agent context’s entity resolution settings. Populated on every response path that returns the resource.
status (string) –
Specifies whether entity resolution and AWS Glue Data Catalog grounding run. A resource that has never set it reads ENABLED. DISABLED stops new runs. A run already started finishes its current step, and a grounding pass that spans several steps stops at the next one.
mcpServerUrl (string) –
The Model Context Protocol (MCP) server URL to give your employees while workforce sign-in is
ENABLED. The URL is the agent context’s MCP endpoint, withworkforceSignInConfig.signInUrlas itslogin_hintquery parameter and the ID that AWS Context assigns to that sign-in URL as itstenantIdquery parameter. Absent while workforce sign-in isDISABLED.trustedIdentitySources (list) –
Identity sources this agent context trusts in addition to its owner’s account. Absent or empty: only the owner’s account is trusted.
(dict) –
An identity source to trust. Set exactly one member. An ARN of any other resource type is a ValidationException.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set:
identityStoreArn,identityProviderArn. If a client receives an unknown member it will setSDK_UNKNOWN_MEMBERas the top level key, which maps to the name or tag of the unknown member. The structure ofSDK_UNKNOWN_MEMBERis as follows:'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
identityStoreArn (string) –
An IAM Identity Center identity store ARN, for example
arn:aws:identitystore::111122223333:identitystore/d-1234567890. IAM Identity Center DescribeInstance returns it asIdentityStoreArn.identityProviderArn (string) –
An IAM OIDC or SAML identity provider ARN, for example
arn:aws:iam::111122223333:oidc-provider/example.com.
Exceptions