UiPath Documentation
getting-started
latest
false
Getting started developer guide
  • Overview
    • Overview
  • Getting Started with UiPath Agents
  • Getting Started with UiPath Agents using LangGraph
  • Building a Low-Code Agent in Studio Web
  • Adding Tools to Your UiPath Agent
    • Introduction
    • Build the API workflow
    • Connect to your agent
    • Test end-to-end

Connect to your agent

Register the API Workflow as a tool in your Monster Selector agent and update the agent's input schema.

With the workflow published, it is available in the agent builder as a connectable tool.

Step 2 - Open the Monster Selector agent

In Studio Web, navigate to your MonsterSelector solution and open it in the agent builder.

Take a moment to orient on its current state before making changes:

  • Input: questDescription (string) and monsters (array of candidates passed in by the caller)
  • Output: monsterIndex (string): the slug of the chosen monster
  • System prompt: instructs the agent to pick the best match from the provided list

In this lab you remove the monsters input and the requirement to pre-populate candidates. The agent fetches them itself using the tool you just built.


Step 3 - Connect the API workflow as a tool

Add the tool

Make sure you are on the Canvas view: use the Canvas / Form toggle at the top of the agent builder. The + button under Tools is only visible in Canvas view.

  1. On the agent canvas, select + under Tools.
  2. From the Toolbox panel, select API workflow.
  3. From the Available resources panel, select the workflow you created in Step 1.
Note:

Available resources is empty? The workflow must be published before it appears here. Return to Step 1 and complete the Publish to your feed sub-step, then come back and try again.

Configure the tool description

Give the tool a name and description. The description is what the agent reads at runtime to decide when and how to call the tool; write it as an instruction to the agent, not a label for humans:

  • Name: Monster Query
  • Description: Searches the D&D 5e SRD for monsters matching a name or creature type. Returns up to 10 candidates with name, type, CR, size, alignment, and description. Call this tool when you need to find monster candidates for a quest.
Note:

The description drives tool selection. The agent reads this description — not the tool name — to decide when and how to call the tool. A vague description produces vague tool use. Be specific about what the tool returns and when to use it.


Step 4 - Update the agent contract

With the tool connected, update the agent definition to reflect the new contract: the agent no longer needs a pre-populated monster list, and it now returns structured monster data including its own reasoning.

The three changes in this step work together: removing monsters ends the agent's dependency on the caller for data; the output schema declares what the agent commits to returning; the updated prompt tells the agent how to use its new capability. None of the three works without the others.

To edit the agent definition, select the agent node on the canvas to open the definition panel on the right.

Remove monsters from the input

In the agent definition, remove the monsters property from the input schema. The updated input should have only questDescription.

To remove the monsters property:

  1. Within the agent, open the Data Manager by selecting the Open Data Manager icon along the left navbar (it looks like a clipboard).
  2. The Data Manager panel has three groupings: Inputs, Outputs, and Variables; monsters should be in the Inputs list.
  3. Point to monsters to reveal the edit and delete icons to the right of the label: a pencil icon (edit) and a trashcan icon (delete).
  4. Select the delete icon to remove monsters.

You should now only have one input: questDescription:

FieldTypeRequiredDescription
questDescriptionstringYesDescription of the quest

Add the output schema

Add an output schema with the five fields from the design table at What you are building.

Within the same Data Manager panel:

  1. Point to the Outputs header to reveal the Add property icon (+).
  2. Select Add Property to add each of the fields below:
FieldType
monsterIndexstring
monsterNamestring
monsterTypestring
monsterCrstring
monsterReasoningstring
Note:

monsterReasoning is agent-generated, not from the API. The agent writes this field itself: it is the agent's explanation of why the selected monster fits the quest. Unlike the other four fields (which come from the tool's results), monsterReasoning reflects the agent's own judgment.

Update the system prompt

To open the Properties panel, select the agent on the canvas or select the wrench icon in the upper-right corner. Replace the system message with:

You are a quest classifier for an adventurer's guild. Given a quest description, your job is to find the most thematically appropriate monster from the D&D 5e SRD and to return information about that monster.

When given a quest description:
1. Analyze the quest to determine what kind of creature fits the context - consider creature type, challenge rating, environment, and theme.
2. Call the Monster Query tool with a search term that targets that creature type.
3. Review the returned candidates and select the best fit for the quest.
4. Return the selected monster's key fields and a monsterReasoning that explains why this monster fits the quest.

Always call the Monster Query tool before selecting a monster. Do not guess monster details from memory.
You are a quest classifier for an adventurer's guild. Given a quest description, your job is to find the most thematically appropriate monster from the D&D 5e SRD and to return information about that monster.

When given a quest description:
1. Analyze the quest to determine what kind of creature fits the context - consider creature type, challenge rating, environment, and theme.
2. Call the Monster Query tool with a search term that targets that creature type.
3. Review the returned candidates and select the best fit for the quest.
4. Return the selected monster's key fields and a monsterReasoning that explains why this monster fits the quest.

Always call the Monster Query tool before selecting a monster. Do not guess monster details from memory.
Important:

Coding agents are non-deterministic. Your prompt will produce different results than the example above; that is expected. What matters is that the agent calls the tool, reasons over the candidates, and returns all five required output fields.


With the tool connected and the agent contract updated, you are ready to test the full pipeline in the next section.

Was this page helpful?

Connect

Need help? Support

Want to learn? UiPath Academy

Have questions? UiPath Forum

Stay updated