Building an Autonomous AI Agent in Copilot Studio – Part 8: Amend Existing Agent Instructions to Use Tools

Reading Time: 4 minutes


Welcome to part 8 of this blog post series.

If you missed the previous parts, visit the links below:

In this blog post, I will return to the instructions I defined for my agent in part 3 of this blog post series and update them so the agent knows how and when to use the tools we added in Part 7 earlier.

Current Agent Instructions

Below is a reminder of the instructions I originally defined for the agent in Part 3 of this blog post series.


Purpose
– Route mentoring requests from a Microsoft Form to an appropriate mentor.

Trigger:
1. When a new mentoring request is received via the form Trainer Mentoring Request, retrieve the submission details using [Get response details] and begin processing.

Data to capture from the form
2. Extract the following details from the form submission:
– Full Name
– Email Address
– Course Selection (course code)
– Country
– Specific Areas of Concern

Mentor lookup (mentors.xlsx)
3. Retrieve the mentor list from mentors.xlsx using [List rows present in a table]
– MentorName
– MentorEmail
– Course

Send an email to the assigned mentor
4. Send an email using [Send an email (V2)] addressed to the selected mentor. Format in html so it’s clear to read. Send the email after creating the draft email.

Example: Hi “MentorName”,
A mentorship request has been assigned to you for the course “Course Code”.
Requestor Name: “MenteeFullName”
Requestor Email: “MenteeEmail”
Country: “Country”
Thanks,
Course Mentor Agent at Imran Rashid Training

Log the request (RequestLogs / Requests table)
5.Use [Add a row into table] to dynamically complete the below:
Requester Name using the Full name field from the form
Email using the Email Address field from the form
Course using Course Selection from the form
Country using the Country field from the form
Concerns using the Specific Areas of Concern field from the form Assigned Mentor from the MentorName from the Mentors excel file


Task: Add tools to instructions

  1. Select Overview
Agent18


2. Scroll down to Instructions, and click Edit

Agent12


3. In instruction number 1, remove the placeholder [Get response details]. Then type / (Forward slash) on your keyboard. A list will appear, select the tool we created earlier called Get response details, as shown in the image below.

Agent13


4. In instruction number 3, remove the place holder [List rows present in a table]. Then type / (forward slash) on your keyboard. When the list appears, select the tool we created earlier called List rows present in a table, as shown in the image below.

Agent14


5. In instruction number 4, remove the placeholder [Send an email (V2)]. Then type / (forward slash) on your keyboard. When the list appears, select the tool we created earlier called Send an email (V2), as shown in the image below.

Agent15


6. Finally, in instruction number 5, remove the placeholder [Add a row into a table]. Then type / (forward slash) on your keyboard. When the list appears, select the tool we created earlier called Add a row into a table, as shown in the image below.

Agent16


7. Click Save

Agent17

That’s it, the agent instructions have now been successfully updated to reference the tools we added in Part 7.

In the next post, I’ll test the autonomous agent by submitting the Microsoft Form we created in part 1 of this blog post series.

Click the following link to continue to final part of this blog post series: Building an Autonomous AI Agent in Copilot Studio – Part 9: Testing the Autonomous Agent – Cloud Build

How useful was this post?

Click on a star to rate it!

As you found this post useful...

Follow us on social media!

One thought on “Building an Autonomous AI Agent in Copilot Studio – Part 8: Amend Existing Agent Instructions to Use Tools

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.