Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Canvas Student declarative agent with API Plugin

Summary

The Canvas Student agent is an AI-powered assistant integrating Microsoft 365 Copilot or Copilot Chat and the Canvas Learning Management System (LMS). It enables learners to combine information in Canvas with unique M365 apps capabilities. Learners can retrieve courses, modules, assignments, pages, announcements, and discussions from Canvas, and leverage features in M365 apps like BizChat, Word, and PowerPoint. Learners can search through course content, generate ideas for learning, and improve the overall learning experience.

Canvas LM Student

Version history

Version Date Comments
1.0 June 23, 2025 Initial release

Features

  • List enrolled courses
  • View course content and structure, including modules and assignments
  • Find activities of a certain type, including discussions, announcements, and pages
  • Create study plan and quizzes for courses, modules, and assignments
  • Interact with Canvas content in all M365 apps that support agents, including BizChat, Word, and PowerPoint
  • Search Course Content, empowering learners to plan their study more effectively, giving them access to information in Canvas
  • Content Creation, helping in creating course content, including study plans, quizzes, and other resources

Data access

  • This agent can access and retrieve Canvas data about

    • Courses
    • Modules
    • Assignments
    • Announcements
    • Discussions
    • Pages
  • This agent requires user authentication and respects user permissions in Canvas

  • This agent can only retrieve (GET) data from Canvas, not update any data in Canvas

  • The agent uses Canvas information as an input to Copilot across M365 apps, for example:

    • Show me the most engaged discussion in Canvas; based on that discussion create a lesson plan in Word
    • Show me this announcement in Canvas, generate slides in PowerPoint to help address those questions in class

Evaluation

  • All response generation features of this agent were tested, measured, and validated internally
  • How declarative agents are evaluated?
  • It's important to keep in mind that the output this agent provides can be inaccurate, incorrect, or out of date

Prerequisites

The agent requires a working Canvas environment and access to Copilot Chat:

Minimal path to awesome

1. Create API Developer Key in Canvas

  1. Follow the steps to create a developer API key for Canvas LMS (Note: The key name will show on the user sign in window.)
  2. Enable the Enforce Scopes toggle and select the following scopes for the agent to have GET access:
    • url:GET|/api/v1/courses
    • url:GET|/api/v1/courses/:course_id/modules
    • url:GET|/api/v1/courses/:course_id/modules/:module_id/items
    • url:GET|/api/v1/courses/:course_id/smartsearch
    • url:GET|/api/v1/users/:id
  3. In the Redirect URIs field, add https://teams.microsoft.com/api/platform/v1.0/oAuthRedirect

Saving will generate the id and key values that will be used for creating the OAuth registration in Microsoft Teams Developer Portal. Microsoft 365 Copilot will use these values to authenticate the agent with Canvas.

2. Add Canvas environment to agent

  1. Clone this repository (or download this solution as a .ZIP file then unzip it)
  2. Open the da-CanvasStudent folder in VS Code
  3. In the env folder, open .env.dev file. Update the CANVAS_BASE_URL environment variable with the URL of your Canvas instance.

3. Provision and test the agent

In VS Code:

  1. Select the Microsoft 365 Agents Toolkit icon on the left toolbar
  2. In the Lifecycle section, select Provision
  3. If prompted, sign in with your Microsoft 365 account and follow the prompts. Return to VS Code after signing in.
  4. Enter the id generated in Step 1 for the OAuth Client ID
  5. Enter the key generated in Step 1 for the OAuth Client Secret

Note

The Canvas LMS client ID and client secret are stored locally in env/.env.dev and env/.env.dev.user files. The client secret is encrypted by Agents Toolkit and is not stored in the source code.

  1. Once the provisioning is complete, you will see a message in the output window that the agent has been provisioned successfully.
  2. Launch the agent in a new browser window by pressing F5.

In Microsoft 365 Copilot:

  • Select any conversation starter, or ask about courses, modules, assignments, discussions, or announcements.
  • Send your message to the agent.

Tip

This step only installs the agent for you, move to the next section to distribute it across your institution

Optional configuration

1. Deploy the agent to your organization

This step is only needed if you want to distribute the agent across your institution.

  1. Select the Microsoft 365 Agents Toolkit icon on the left in the VS Code toolbar
  2. In the Utility section, click Zip Teams App Package to download the file.
  3. Open a browser and naviagte to the Microsoft 365 Admin Center. Go to Settings , select Integrate apps, and select Upload custom apps.
  4. Define which users or groups will have access to the agent, accept permissions and deploy

2. Add capabilities and knowledge sources

This step is only needed if you want to add other capabilities and knowledge sources to your agent.

  • Customize the agent with capabilities and knowledge sources to address your needs, including:
    • Code interpreter
    • Image generator
    • Web search
    • Scoped web search
    • Copilot connectors
    • SharePoint and OneDrive as knowledge
  • Add your capabilities and knowledge sources to the Capabilities object in the declarativeAgent.json file
  • Check the capabilities and knowledge sources for the latest capabilities

3. Setup Microsoft SSO in Canvas

This step is only needed if you want to enable your users to be automatically signed-in to Canvas with their Microsoft Entra accounts.

Known limitations

  • Limited to M365 apps that support declarative agents
  • Limited to English (EN-US)
  • Limited to only retrieve information from Canvas (read-only)
  • Limited to return only 10 items from each endpoint
  • Limited to return only info about the authenticated user, not bringing anything from any other user
  • No capabilities or knowledge sources have been enabled in this sample
  • OpenAPI limitations for API plugins

Resources and customization

The following folders are provided for this agent.

Folder Contents
.vscode VSCode files for debugging
appPackage Templates for the app manifest, the plugin manifest and the API specification
env Environment files

The following files can be customized and demonstrate an example implementation to get you started.

File Contents
appPackage/instruction.txt Instructions that define the behaviour of your agent. The file contents is included in the declarativeAgent.json file during provisioning.
appPackage/declarativeAgent.json Defines the configuration of the declarative agent
appPackage/ai-plugin.json Defines the configuration and capabilities of the AI plugin used by Microsoft 365 COpilot to issue requests to the Canvas LMS API.
appPackage/manifest.json App manifest that describes how your app integrates into Microsoft 365

The following are Microsoft 365 Agents Toolkit specific project files. You can visit a complete guide on Github to understand how Microsoft 365 Agents Toolkit works.

File Contents
m365agents.yml This is the main Microsoft 365 Agents Toolkit project file. It contains the tasks which was executed when the agent is provisioned to Microsoft 365 Copilot.

Help

We do not support samples, but this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues.

You can try looking at issues related to this sample to see if anybody else is having the same issues.

If you encounter any issues using this sample, create a new issue.

Finally, if you have an idea for improvement, make a suggestion.

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.