Fetch neighboring countries using Tool Calling Snaps

This pipeline demonstrates how to generate a function, invoke the tool, and retrieve results to identify India's neighboring countries.

  1. Configure the JSON Generator Snap with the prompt in the Edit JSON field as follows:

    JSON Generator Snap configuration

  2. Configure the Amazon Bedrock Function Generator Snap to define a function and provide the description as follows:

    Amazon Bedrock Function Generator configuration

  3. Configure the Amazon Bedrock Converse API Tool Calling (Not Recommended) Snap as follows to fetch the get_borders tool:

    On validation, the Snap displays the toolUseID and the invoked tool in the second output.

    Amazon Bedrock Converse API Tool Calling (Not Recommended) configuration Amazon Bedrock Converse API Tool Calling (Not Recommended) output

    Amazon Bedrock Converse API Tool Calling (Not Recommended) configuration


    Amazon Bedrock Converse API Tool Calling (Not Recommended) output

  4. Configure the HTTP Client Snap to fetch country data from the Restcountries API using the specified URL.

    On validation, the Snap displays the related information for India.

    HTTP Client Snap configuration HTTP Client Snap output

    HTTP Client Snap configuration


    HTTP Client Snap output

  5. Configure the Amazon Bedrock Function Result Generator (Not Recommended) Snap to fetch the results with the required tool.

    On validation, the Snap displays the neighboring countries of India.

    Amazon Bedrock Function Result Generator (Not Recommended) Snap configuration Amazon Bedrock Function Result Generator (Not Recommended) Snap output

    Amazon Bedrock Function Result Generator (Not Recommended) Snap configuration


    Amazon Bedrock Function Result Generator (Not Recommended) Snap output

To reuse the example pipelines:
  1. Download and import the SLP file into your Environment.
  2. Configure Snap accounts.
  3. Provide Pipeline parameters, if any.