Tool: list_courses
Lists the user's courses with their details (section, room, subject, grade levels, description, state, and the user's role). Use this as the primary entry point to discover courses and retrieve their IDs. Courses often share a title, so use section to tell them apart. Returns only ACTIVE courses unless courseState is set (e.g. ARCHIVED).
To link the user to a course in the Classroom web app, use https://classroom.google.com/c/{course_id} (stream) or https://classroom.google.com/w/{course_id}/t/all (Classwork page). Use IDs exactly as returned; never guess or modify them.
The following code sample shows how to use curl to call the list_courses MCP tool.
| Curl Request |
|---|
curl --location 'https://classroommcp.googleapis.com/mcp/v1' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "list_courses", "arguments": { // Provide these details according to the MCP tool specification. } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
Request to list courses.
ListCoursesRequest
| JSON representation |
|---|
{ "courseState": enum ( |
| Fields | |
|---|---|
courseState |
Optional. Filter by course state. Defaults to |
createdDateRange |
Optional. Filter by range of creation dates. |
timeZone |
Required. The user's IANA timezone (e.g. |
titleContains |
Optional. Filter title by case-insensitive substring. |
pageSize |
Optional. Controls page size. Defaults to 10; max 50. |
pageToken |
Optional. Token for pagination. |
DateRange
| JSON representation |
|---|
{ "startDate": string, "endDate": string } |
| Fields | |
|---|---|
startDate |
Inclusive start of the range (format: YYYY-MM-DD). |
endDate |
Inclusive end of the range (format: YYYY-MM-DD). |
State
States of a course.
| Enums | |
|---|---|
STATE_UNSPECIFIED |
Unspecified state. |
ACTIVE |
Active state. |
ARCHIVED |
Archived state. |
PROVISIONED |
Provisioned state. |
Output Schema
Response to list courses.
ListCoursesResponse
| JSON representation |
|---|
{
"courses": [
{
object ( |
| Fields | |
|---|---|
courses[] |
The list of courses. |
nextPageToken |
The next page token. |
Course
| JSON representation |
|---|
{ "id": string, "title": string, "role": enum ( |
| Fields | |
|---|---|
id |
Identifier. Identifier for this course. |
title |
Title of the course. |
role |
Role of the user in this course. |
creationDate |
Creation date of the course (format: YYYY-MM-DD). Empty if the creation date isn't known. |
state |
Output only. State of the course. |
section |
Optional. Section of the course. |
room |
Optional. Room of the course. |
subject |
Optional. Subject of the course. |
gradeLevels |
Optional. Grade levels of the course. |
description |
Optional. Description of the course. |
Role
Roles of a user in a course.
| Enums | |
|---|---|
ROLE_UNSPECIFIED |
Unspecified role. |
TEACHER |
Teacher role. |
COTEACHER |
Co-teacher role. |
STUDENT |
Student role. |
INVITED_OR_INACTIVE |
Invited or inactive role. |
State
States of a course.
| Enums | |
|---|---|
STATE_UNSPECIFIED |
Unspecified state. |
ACTIVE |
Active state. |
ARCHIVED |
Archived state. |
PROVISIONED |
Provisioned state. |
Tool Annotations
Tool annotations are sent to MCP clients to describe the basic risk of a given tool. Most clients treat these hints as untrusted, but they can be used to decide when a confirmation prompt might be sent to a user.
Along with the title string, the following boolean hints are defined as follows:
readOnlyHint: If true, the tool doesn't modify its environment. Default: false.destructiveHint: If true, then the tool can perform destructive actions. If false, then the tool can only perform additive actions. Default: true.idempotentHint: If true, then calling the tool repeatedly with the same arguments will have no additional effect on its environment. Default: false.openWorldHint: If true, then the tool can interact with an 'open world' of external entities. If false, then the tool can only interact with internal entities. For example, a web search tool would be open world, while a memory tool would not be open world.
Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ❌
Authorization Scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/classroom.courses.readonlyhttps://www.googleapis.com/auth/classroom.rosters.readonly