8 - Add Subagent to Convert Currency Using MCP Server
Create a subagent that connects to an MCP server with currency conversion tool, and then add that agent to our shipment agent.
Overview
You will learn
- How to create a subagent
- How to connect to an MCP server
Prerequisites
Prerequisites
- You have completed the previous tutorial in the Joule Studio CodeJam Mission, Test the shipping agent.
Steps
Intro
In this tutorial we will explore two additional features of agents:
You can create subagents to be called from another agent, so you can better structure your projects. A subagent is built the same way as any other agent, just that it is added as a tool in another agent. For now, once an agent is used as a tool in another agent, it cannot be called directly.
You can connect your agent to an MCP server and use its tools as part of that agent.
You will create an agent that uses an MCP server for converting currencies, and then use that agent within your logistics agent.
We probably could have just added the MCP server to the first agent, but we wanted to show the subagent feature as well π.
Select the Overview tab.
Click Create, and choose Joule Agent.

New agent In the Create Joule Agent dialog, enter the following details:
Field Value Name Agent for Converting CurrenciesDescription An agent for converting currencies and show the value of one currency in another currencyClick Create.

Name agent Once the Joule skill is created, you are taken to the skill builder.
In the agent builder, enter the following for the Expertise section:
TextConverts currency amount to a different currency, and takes precedence over any other way to convert currenciesEnter the following for the Instructions section:
TextWhen asked to convert currency, use the get_latest_base_currency skill from the MCP serverEnter the following for the Additional Context section:
TextPlease show the currency conversion in a table, with the column headers with the currency abbreviations and the row values the currency amounts.

We have created an MCP server for converting currencies, and created a destination so the MCP server is available to Joule Studio and to be added to agents.
In your agent, click Add MCP Server.

Add MCP Server In the Add MCP Server dialog, enter the following details:
Field Value Name Currency ConversionsDescription for Agent Use this MCP server for converting currenciesDestination Select cap-mcp-convert-currency 
Configure MCP server Once you select the destination, scroll down and you should see a list of tools in that MCP server.

New tools Click Add Server.
You will see the MCP server added, plus an indication of how many tools are exposed through that server.

Server added Click Save (upper right).
Open your Agent for Logistics agent.

Open agent Click Add Tool > Joule Agent.

Add agent Select Agent for Converting Currencies agent.
Click Add.

Select agent Click Save (upper right).
Now we have to instuct the agent to use the tool when someone asks for currency conversion.
In the instructions of the Agent for Logistics agent, replace the first paragraph under Suggest Carrier Options with this one.

If the user asks for carrier suggestions, use the document βCarrier Selection Guide.docxβ to present all
available carrier options. Display the list of carriers for the user to view as a simple table, displaying only
the name of the carrier and the price. If the user asks for the prices in a currency not USD, use the "Convert
currencies" agent tool to get the currency conversions and show 2 columns, one for USD and one for the
converted currency.
Click Save (upper right).
Click Test.

Start test In the Test Project dialog, enter the following:
Field Value Environment Select the private environment for your user’s email address PostToGTT Select gttwriteservice GetFromGTT Select gttGetService Click Continue.

Test variables A test Joule interface will open up, letting you talk with your skills and agents in the project.
Ask Joule for suggested carriers and prices by entering the following:
ShellSuggest the best carriers from SFO to NYC, and show prices in eurosResult: Joule proposes the carriers based on the carrier rates document from our document grounding, and converts the prices to euros.

Results If you click on UPS, you will see the details and the price, in euros converted to up-to-date exchange rate returned by the MCP server.

Results euros Feel free to check the current exchange rate, to make sure the value is live, and not old and taken from the LLM’s memory.
Here’s a link to exchange rate for euro on Yahoo Finance.

Euro to USD Explore the logs.
First find Joule list message and expand the node. Here you will find information on how Joule and the agent responded to your prompt.
Click Joule selected a scenario to execute, and on the right you will see that it selected the agent to respond with.

Logs Open the Agent node, and click Plan and you can see that it figured out to check document grounding for carriers and then to use convert currencies agent to convert the currencies.

Logs 2 If you scroll down and click MCP Server, you will see on the right that the MCP server was called and returned currency conversions for today.

Logs 3 Click Stop Testing.

Stop Testing
What is the advantage of subagents?
What is the disadvantage of subagents the way they currently are designed? That is, what can I not do with subagents?
Did we need a subagent in this use case? Why or why not?
Resources
Discussion
Share feedback on this tutorial or join the conversation in SAP Community.