Tool: create_course_work
Creates a new assignment, question, or material in a course. Requires a teacher role in the course. Coursework is always created as a DRAFT that students cannot see; if scheduleDate is set, it is published automatically on that date. Otherwise, tell the user to publish it in Classroom, because this tool cannot publish coursework.
Classroom has no web link to a single draft item. To link the user to the new coursework, use the Classwork page, https://classroom.google.com/w/{course_id}/t/all, where the teacher can find the draft and select Edit to review or publish it. Use IDs exactly as returned; never guess or modify them.
The following code sample shows how to use curl to call the create_course_work 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": "create_course_work", "arguments": { // Provide these details according to the MCP tool specification. } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
Request to create a coursework item.
CreateCourseWorkRequest
| JSON representation |
|---|
{ "courseId": string, "courseWorkType": enum ( |
| Fields | |
|---|---|
courseId |
Required. Identifier of the course. |
courseWorkType |
Required. Type of course work to create. |
title |
Required. Title of the course work. |
instructions |
Optional. Instructions for the course work. |
topicId |
Optional. Identifier of the topic to put the course work in, from list_topics. |
choices[] |
Optional. Choices of a |
assigneeIds[] |
Optional. Identifiers of the students to assign the course work to, from get_course_roster. Empty means all students. |
materials[] |
Optional. Materials to attach. At most 20. |
scheduleDate |
Optional. Date to publish the course work automatically (YYYY-MM-DD). Time defaults to 8am in the user's timezone and is editable in the UI. |
dueDate |
Optional. Due date (YYYY-MM-DD). Time defaults to 11:59pm and is editable in the UI. Not supported for |
learningGoalIds[] |
Optional. Identifiers of the learning standards to tag the course work with ( |
timeZone |
Required. The user's IANA timezone (e.g. |
maxPoints |
Optional. Maximum points achievable, as a non-negative whole number. Omit it to create ungraded course work; 0 makes it graded out of 0 points. Not supported for |
MaterialInput
| JSON representation |
|---|
{ "driveFile": { object ( |
| Fields | |
|---|---|
Union field content. The attachment content. content can be only one of the following: |
|
driveFile |
Google Drive file to attach. |
youtubeVideoId |
Identifier of the YouTube video to attach (e.g. |
linkUrl |
URL of the web page to attach. |
formUrl |
URL of the Google Form to attach. |
notebook |
Gemini Notebook to attach. |
DriveFileInput
| JSON representation |
|---|
{
"id": string,
"shareMode": enum ( |
| Fields | |
|---|---|
id |
Required. Identifier of the Drive file. |
shareMode |
Required. How students get the file: VIEW (read only), EDIT (everyone edits the same file), or COPY (each student gets their own copy). |
GeminiNotebook
| JSON representation |
|---|
{ "id": string, "title": string } |
| Fields | |
|---|---|
id |
Required. Identifier of the Notebook. |
title |
Title of the Notebook. |
Type
Type of course work.
| Enums | |
|---|---|
TYPE_UNSPECIFIED |
Unspecified type. |
ASSIGNMENT |
Standard coursework assignment. |
SHORT_ANSWER_QUESTION |
Short answer question coursework. |
MULTIPLE_CHOICE_QUESTION |
Multiple choice question coursework. |
MATERIAL |
Material coursework. |
Sharing settings for the Drive file.
| Enums | |
|---|---|
SHARE_MODE_UNSPECIFIED |
Unspecified sharing mode. |
VIEW |
Students can view the shared file. |
EDIT |
Students can edit the shared file. |
COPY |
Students get a personal copy of the shared file. |
Output Schema
Detailed metadata of a coursework item.
CourseWork
| JSON representation |
|---|
{ "id": string, "courseWorkType": enum ( |
| Fields | |
|---|---|
id |
Identifier. Identifier for the course work. |
courseWorkType |
Type of course work. |
choices[] |
Answer choices. Only set for |
assigneeIds[] |
List of student IDs this work is assigned to (unset means all students). |
materials[] |
Materials attached to this coursework item. |
publishDate |
Output only. Date the course work was published (YYYY-MM-DD). |
state |
Output only. State of the course work item. |
learningGoals[] |
Learning goals attached to this coursework item. |
title |
Title of the course work. |
topicId |
Identifier of the topic this course work belongs to (if any). |
topicTitle |
Output only. Title of the topic this course work belongs to. Only returned by get_course_work, and omitted if it couldn't be looked up. |
instructions |
Instructions for the coursework. |
maxPoints |
Maximum points achievable for this work, as a non-negative whole number. Not allowed for |
scheduleDate |
Date the course work is scheduled to be published (YYYY-MM-DD). Time defaults to 8am in the user's timezone and is editable in the UI. |
dueDate |
Due date of the course work (YYYY-MM-DD). Time defaults to 11:59pm and is editable in the UI. Not allowed for |
Material
| JSON representation |
|---|
{ "id": string, "sharedDriveFile": { object ( |
| Fields | |
|---|---|
id |
Output only. Identifier of the material. Use it to remove the material with |
Union field content. The attachment content. content can be only one of the following: |
|
sharedDriveFile |
Google Drive file attachment. |
youtubeVideo |
YouTube video attachment. |
link |
URL link attachment. |
form |
Google Forms attachment. |
notebook |
Gemini Notebook attachment. |
| JSON representation |
|---|
{ "file": { object ( |
| Fields | |
|---|---|
file |
Drive file details. |
shareMode |
Required. How students get the file: VIEW (read only), EDIT (everyone edits the same file), or COPY (each student gets their own copy). |
DriveFile
| JSON representation |
|---|
{ "id": string, "title": string, "url": string } |
| Fields | |
|---|---|
id |
Required. Identifier of the Drive file. |
title |
Output only. Title of the Drive file. |
url |
Output only. URL of the Drive file. |
YouTubeVideo
| JSON representation |
|---|
{ "id": string, "title": string } |
| Fields | |
|---|---|
id |
Required. YouTube video ID. |
title |
Output only. Title of the YouTube video. |
Link
| JSON representation |
|---|
{ "url": string, "title": string } |
| Fields | |
|---|---|
url |
Required. URL of the link. |
title |
Output only. Title of the link. |
Form
| JSON representation |
|---|
{ "formUrl": string, "title": string, "responseUrl": string } |
| Fields | |
|---|---|
formUrl |
Required. URL of the form. |
title |
Output only. Title of the form. |
responseUrl |
Output only. URL of the form response. Only set if responses have been recorded and only when the requesting user is an editor of the form. |
GeminiNotebook
| JSON representation |
|---|
{ "id": string, "title": string } |
| Fields | |
|---|---|
id |
Required. Identifier of the Notebook. |
title |
Title of the Notebook. |
LearningGoal
| JSON representation |
|---|
{
"id": string,
"type": enum ( |
| Fields | |
|---|---|
id |
Output only. ID of the learning goal. To attach a standard, use an |
type |
Output only. The type of learning goal. |
standardCode |
Output only. Standard code (e.g. "NY-2.NBT.4"). Only populated for standards. |
title |
Output only. Statement description for standards, or human-readable title for skills. |
documentTitle |
Output only. Curriculum document name. Only populated for standards. |
Type
Type of course work.
| Enums | |
|---|---|
TYPE_UNSPECIFIED |
Unspecified type. |
ASSIGNMENT |
Standard coursework assignment. |
SHORT_ANSWER_QUESTION |
Short answer question coursework. |
MULTIPLE_CHOICE_QUESTION |
Multiple choice question coursework. |
MATERIAL |
Material coursework. |
Sharing settings for the Drive file.
| Enums | |
|---|---|
SHARE_MODE_UNSPECIFIED |
Unspecified sharing mode. |
VIEW |
Students can view the shared file. |
EDIT |
Students can edit the shared file. |
COPY |
Students get a personal copy of the shared file. |
State
States of a course work item.
| Enums | |
|---|---|
STATE_UNSPECIFIED |
Unspecified state. |
PUBLISHED |
Course work is published and visible to students. |
DRAFT |
Course work is a draft. |
Type
The type of learning goal.
| Enums | |
|---|---|
TYPE_UNSPECIFIED |
Unspecified learning goal type. |
STANDARD |
A learning standard from an academic curriculum. |
SKILL |
A skill representing an educational concept or competency. Only a teacher can add or remove skills, in Classroom. |
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.coursework.students