Module 5 – CRUD Operations using MCP
This module covers how to perform Create, Read, Update, Delete (CRUD) operations using Model Context Protocol (MCP) for the Attendance Tracking System.
๐ CRUD Targets
- Courses
- Semesters
- Subjects
- Staff
- Students
- Timetable
- Attendance Records
▶️ CREATE Commands
# Create a new course
mcp call academic_tracker.create '{
"id": "C3",
"name": "M.Tech – Data Science",
"semesters": 4
}'
# Create a new student
mcp call academic_tracker.create '{
"id": "STU1201",
"name": "Rahul",
"courseId": "C1",
"semesterId": "S3"
}'
๐ READ Commands
# Read all students of a semester
mcp call academic_tracker.read '{
"entity": "students",
"filter": { "semesterId": "S1" }
}'
# Get timetable for Semester 5
mcp call academic_tracker.read '{
"entity": "timetable",
"filter": { "semesterId": "S5" }
}'
♻️ UPDATE Commands
# Update a student's semester
mcp call academic_tracker.update '{
"entity": "students",
"id": "STU1201",
"data": { "semesterId": "S4" }
}'
# Change staff assigned to a subject
mcp call academic_tracker.update '{
"entity": "subjects",
"id": "SUB101",
"data": { "staffId": "T3" }
}'
๐️ DELETE Commands
# Delete a student
mcp call academic_tracker.delete '{
"entity": "students",
"id": "STU1201"
}'
# Delete subject timetable entry
mcp call academic_tracker.delete '{
"entity": "timetable",
"id": "TT1"
}'
๐งพ Sample Output (JSON Returned from MCP)
{
"status": "success",
"message": "Student updated successfully",
"data": {
"id": "STU1201",
"name": "Rahul",
"courseId": "C1",
"semesterId": "S4"
}
}
๐ Module 5 Completed!
CRUD operations are now fully operational in MCP for your attendance system.
No comments:
Post a Comment