Skip to content

get_agent_card

get_agent_card(
    agent_runtime_arn: str,
    *,
    config_overrides: Optional[BedrockAgentCoreClientConfig] = None,
    runtime_session_id: Optional[SessionType] = None,
    qualifier: Optional[str] = None,
) -> GetAgentCardResponse

Retrieves the A2A agent card associated with an AgentCore Runtime agent.

Parameters:

  • runtime_session_id (Optional[SessionType], default: None ) –

    The session ID that the AgentCore Runtime agent is using.

  • agent_runtime_arn (str) –

    The ARN of the AgentCore Runtime agent for which you want to get the A2A agent card.

  • qualifier (Optional[str], default: None ) –

    Optional qualifier to specify an agent alias, such as prodcode> or dev. If you don't provide a value, the DEFAULT alias is used.

Raises:

  • AccessDeniedException –

    The exception that occurs when you do not have sufficient permissions to perform an action. Verify that your IAM policy includes the necessary permissions for the operation you are trying to perform.

  • InternalServerException –

    The exception that occurs when the service encounters an unexpected internal error. This is a temporary condition that will resolve itself with retries. We recommend implementing exponential backoff retry logic in your application.

  • ResourceNotFoundException –

    The exception that occurs when the specified resource does not exist. This can happen when using an invalid identifier or when trying to access a resource that has been deleted.

  • RetryableConflictException –

    The exception that occurs when there is a retryable conflict performing an operation. This is a temporary condition that may resolve itself with retries. We recommend implementing exponential backoff retry logic in your application.

  • RuntimeClientError –

    The exception that occurs when there is an error in the runtime client. This can happen due to network issues, invalid configuration, or other client-side problems. Check the error message for specific details about the error.

  • ServiceQuotaExceededException –

    The exception that occurs when the request would cause a service quota to be exceeded. Review your service quotas and either reduce your request rate or request a quota increase.

  • ThrottlingException –

    The exception that occurs when the request was denied due to request throttling. This happens when you exceed the allowed request rate for an operation. Reduce the frequency of requests or implement exponential backoff retry logic in your application.

  • ValidationException –

    The exception that occurs when the input fails to satisfy the constraints specified by the service. Check the error message for details about which input parameter is invalid and correct your request.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_bedrock_agentcore/_services/bedrock_agent_core.py
def get_agent_card(
    self,
    agent_runtime_arn: str,
    *,
    config_overrides: Optional[BedrockAgentCoreClientConfig] = None,
    runtime_session_id: Optional[
        "capo_bedrock_agentcore.types.session_type.SessionType"
    ] = None,
    qualifier: Optional[str] = None,
) -> "capo_bedrock_agentcore.types.get_agent_card_response.GetAgentCardResponse":
    """<p>Retrieves the A2A agent card associated with an AgentCore Runtime agent.</p>

    Args:
        runtime_session_id: <p>The session ID that the AgentCore Runtime agent is using. </p>
        agent_runtime_arn: <p>The ARN of the AgentCore Runtime agent for which you want to get the A2A agent card.</p>
        qualifier: <p>Optional qualifier to specify an agent alias, such as <code>prod</code>code&gt; or <code>dev</code>. If you don't provide a value, the DEFAULT alias is used. </p>

    Raises:
        capo_bedrock_agentcore.errors.access_denied_exception.AccessDeniedException: <p>The exception that occurs when you do not have sufficient permissions to perform an action. Verify that your IAM policy includes the necessary permissions for the operation you are trying to perform.</p>
        capo_bedrock_agentcore.errors.internal_server_exception.InternalServerException: <p>The exception that occurs when the service encounters an unexpected internal error. This is a temporary condition that will resolve itself with retries. We recommend implementing exponential backoff retry logic in your application.</p>
        capo_bedrock_agentcore.errors.resource_not_found_exception.ResourceNotFoundException: <p>The exception that occurs when the specified resource does not exist. This can happen when using an invalid identifier or when trying to access a resource that has been deleted.</p>
        capo_bedrock_agentcore.errors.retryable_conflict_exception.RetryableConflictException: <p>The exception that occurs when there is a retryable conflict performing an operation. This is a temporary condition that may resolve itself with retries. We recommend implementing exponential backoff retry logic in your application.</p>
        capo_bedrock_agentcore.errors.runtime_client_error.RuntimeClientError: <p>The exception that occurs when there is an error in the runtime client. This can happen due to network issues, invalid configuration, or other client-side problems. Check the error message for specific details about the error.</p>
        capo_bedrock_agentcore.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The exception that occurs when the request would cause a service quota to be exceeded. Review your service quotas and either reduce your request rate or request a quota increase.</p>
        capo_bedrock_agentcore.errors.throttling_exception.ThrottlingException: <p>The exception that occurs when the request was denied due to request throttling. This happens when you exceed the allowed request rate for an operation. Reduce the frequency of requests or implement exponential backoff retry logic in your application.</p>
        capo_bedrock_agentcore.errors.validation_exception.ValidationException: <p>The exception that occurs when the input fails to satisfy the constraints specified by the service. Check the error message for details about which input parameter is invalid and correct your request.</p>
        capo_bedrock_agentcore.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_bedrock_agentcore.types.get_agent_card_request.GetAgentCardRequest]",
    ) -> OperationResponse[
        "capo_bedrock_agentcore.types.get_agent_card_response.GetAgentCardResponse"
    ]:
        import capo_bedrock_agentcore._operations.amazon_bedrock_agent_core.get_agent_card

        output, http_response = (
            capo_bedrock_agentcore._operations.amazon_bedrock_agent_core.get_agent_card.get_agent_card(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetAgentCard")
    )
    input_: capo_bedrock_agentcore.types.get_agent_card_request.GetAgentCardRequest = {
        "agent_runtime_arn": agent_runtime_arn
    }
    if runtime_session_id is None:
        runtime_session_id = str(uuid.uuid4())
    input_["runtime_session_id"] = runtime_session_id
    if qualifier is not None:
        input_["qualifier"] = qualifier

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output