-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubscription.json
More file actions
112 lines (112 loc) · 4.66 KB
/
subscription.json
File metadata and controls
112 lines (112 loc) · 4.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{
"name": "Subscription",
"access": {
"anon": "Can see the subscription entry but cannot directly create a subscription.",
"user": "Can only manage their own section subscription relationships.",
"admin": "Does not manage personal subscriptions on behalf of users through ordinary pages.",
"agent": "After OAuth authorization, can manage the current user's own subscription relationships; REST and MCP both support the same semantic operations."
},
"rules": {
"subscription-language": "Copy may use 'subscribe to section' or 'follow section'; must not write 'enroll in course'.",
"user-scoped": "Subscription relationships belong only to the current user and determine the display scope for home page, calendar, homework, and exam."
},
"capabilities": {
"subscribe-from-section": {
"title": "Subscribe from Section Detail",
"auth": "user",
"links": {
"models": ["User", "Section"],
"ui": ["Detail Hero"]
},
"web": {
"pages": ["/sections/[jwId]"]
},
"rest": "unavailable",
"mcp": {
"tools": [
{
"name": "subscribe_section_by_jw_id",
"returns": "{ success: Boolean, action: String, sectionJwId: Int, subscription }",
"notes": [
"Default/summary responses return a compact subscription update result instead of the full subscribed section list.",
"Request full mode only when the caller explicitly needs the full CalendarSubscription with sections[]."
]
},
{
"name": "unsubscribe_section_by_jw_id",
"returns": "{ success: Boolean, action: String, sectionJwId: Int, subscription }",
"notes": [
"Default/summary responses return a compact subscription update result instead of the full subscribed section list.",
"Request full mode only when the caller explicitly needs the full CalendarSubscription with sections[]."
]
}
]
},
"display": {
"fields": [
"Subscribe/unsubscribe icon button state",
"Subscription disclaimer copy"
]
}
},
"batch-subscribe-by-codes": {
"title": "Batch Subscribe by Course Codes",
"auth": "user",
"links": {
"models": ["Section", "User"]
},
"web": {
"pages": ["/?tab=subscriptions"]
},
"rest": {
"routes": [
{
"path": "/api/sections/match-codes",
"method": "POST",
"returns": "{ semester: Semester, matchedCodes: String[], unmatchedCodes: String[], sections: Section[], total: Int }"
},
{
"path": "/api/calendar-subscriptions",
"method": "POST",
"returns": "{ subscription: CalendarSubscription }",
"notes": [
"subscription.sections[] is the user's new set of subscribed sections."
]
}
]
},
"mcp": {
"tools": [
{
"name": "match_section_codes",
"returns": "{ semester: Semester, matchedCodes: String[], unmatchedCodes: String[], suggestions?: Record<String, String[]>, sections: Section[], total: Int }",
"rest_equivalent": "POST /api/sections/match-codes",
"notes": [
"Returns suggestions for unmatched inputs when close section codes in the selected semester share a strong code-prefix or edit-distance match; unrelated section codes should be filtered out.",
"Prefer this read-only preview before subscribe_my_sections_by_codes when the caller needs confirmation or typo recovery."
]
},
{
"name": "subscribe_my_sections_by_codes",
"returns": "{ success: Boolean, semester, matchedCodes, unmatchedCodes, addedCount, alreadySubscribedCount, subscription }",
"rest_equivalent": "POST /api/calendar-subscriptions",
"notes": [
"Convenience mutation that combines matching with subscription update.",
"Use match_section_codes first when the caller needs a dry-run style preview.",
"Default/summary responses return the subscription totals plus feed link information, not the entire subscribed section list.",
"Request full mode only when the caller explicitly needs the full CalendarSubscription with sections[]."
]
}
]
},
"display": {
"fields": [
"Course/section code input",
"Bulk subscribe button",
"Matched section cards with course, code, semester, campus, teachers",
"Unmatched codes"
]
}
}
}
}