infinitecampus-mcp 2.7.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/dist/bundle.js +567 -176
- package/dist/index.js +1 -1
- package/dist/tools/_shared.js +3 -3
- package/dist/tools/assessments.js +3 -3
- package/dist/tools/assignments.js +3 -3
- package/dist/tools/attendance.js +3 -3
- package/dist/tools/attendance_events.js +3 -3
- package/dist/tools/behavior.js +3 -3
- package/dist/tools/calendar.js +3 -3
- package/dist/tools/districts.js +6 -3
- package/dist/tools/documents.js +6 -5
- package/dist/tools/features.js +3 -3
- package/dist/tools/fees.js +3 -3
- package/dist/tools/foodservice.js +3 -3
- package/dist/tools/grades.js +3 -3
- package/dist/tools/messages.js +5 -5
- package/dist/tools/recent_grades.js +3 -3
- package/dist/tools/schedule.js +3 -3
- package/dist/tools/students.js +3 -3
- package/dist/tools/teachers.js +3 -3
- package/dist/view.js +37 -0
- package/package.json +2 -2
- package/server.json +2 -2
package/dist/index.js
CHANGED
|
@@ -58,7 +58,7 @@ catch (e) {
|
|
|
58
58
|
// actionable stderr message (banner) instead of a crash loop.
|
|
59
59
|
const COMMON = {
|
|
60
60
|
name: 'infinitecampus',
|
|
61
|
-
version: '2.
|
|
61
|
+
version: '2.8.0', // x-release-please-version
|
|
62
62
|
};
|
|
63
63
|
// Shared with the healthcheck so it can report the SAME state the tools see,
|
|
64
64
|
// including on the unconfigured path where there are no tools at all.
|
package/dist/tools/_shared.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { minifiedResult } from '@chrischall/mcp-utils';
|
|
2
2
|
/** Detect "IC 404 ..." errors thrown by ICClient.request for endpoints that don't exist. */
|
|
3
3
|
export function is404(e) {
|
|
4
4
|
return e instanceof Error && e.message.startsWith('IC 404 ');
|
|
5
5
|
}
|
|
6
6
|
/** Build a FeatureDisabled warning content block. */
|
|
7
7
|
export function featureDisabled(feature, district, data = []) {
|
|
8
|
-
return
|
|
8
|
+
return minifiedResult({ warning: 'FeatureDisabled', feature, district, data });
|
|
9
9
|
}
|
|
10
10
|
/** Fetch the students list and find the one matching studentId. Returns null if not found. */
|
|
11
11
|
export async function findStudent(client, district, studentId) {
|
|
@@ -14,7 +14,7 @@ export async function findStudent(client, district, studentId) {
|
|
|
14
14
|
}
|
|
15
15
|
/** Standard error content block for when studentId doesn't match any student. */
|
|
16
16
|
export function studentNotFound(studentId) {
|
|
17
|
-
return
|
|
17
|
+
return minifiedResult({ error: 'StudentNotFound', studentId });
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Check a feature flag via the district's displayOptions allow-list for the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { viewArg, viewResponse } from '../view.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { findStudent, studentNotFound, featureDisabled, is404, toArray, checkFeatureDisabled } from './_shared.js';
|
|
4
4
|
const argsSchema = z.object({
|
|
@@ -9,7 +9,7 @@ export function registerAssessmentTools(server, client) {
|
|
|
9
9
|
server.registerTool('ic_list_assessments', {
|
|
10
10
|
description: "List a student's standardized test scores (state, national, district tests). Auto-resolves calendarID from each of the student's enrollments and returns one entry per enrollment. The shape of individual test records varies by district and test type — fields are passed through unchanged.",
|
|
11
11
|
annotations: { readOnlyHint: true },
|
|
12
|
-
inputSchema: argsSchema.shape,
|
|
12
|
+
inputSchema: { ...argsSchema.shape, view: viewArg() },
|
|
13
13
|
}, async (rawArgs) => {
|
|
14
14
|
const args = argsSchema.parse(rawArgs);
|
|
15
15
|
const student = await findStudent(client, args.district, args.studentId);
|
|
@@ -49,6 +49,6 @@ export function registerAssessmentTools(server, client) {
|
|
|
49
49
|
if (feature404 && result.length === 0) {
|
|
50
50
|
return featureDisabled('assessments', args.district);
|
|
51
51
|
}
|
|
52
|
-
return
|
|
52
|
+
return viewResponse(rawArgs.view, result);
|
|
53
53
|
});
|
|
54
54
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { viewArg, viewResponse } from '../view.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
const argsSchema = z.object({
|
|
4
4
|
district: z.string(),
|
|
@@ -12,7 +12,7 @@ export function registerAssignmentTools(server, client) {
|
|
|
12
12
|
server.registerTool('ic_list_assignments', {
|
|
13
13
|
description: "List a student's assignments. The IC endpoint returns the full term history (~hundreds of items); date and missing filters are applied client-side. For a single course, pass courseId (the sectionID from ic_get_schedule).",
|
|
14
14
|
annotations: { readOnlyHint: true },
|
|
15
|
-
inputSchema: argsSchema.shape,
|
|
15
|
+
inputSchema: { ...argsSchema.shape, view: viewArg() },
|
|
16
16
|
}, async (rawArgs) => {
|
|
17
17
|
const args = argsSchema.parse(rawArgs);
|
|
18
18
|
// Only sectionID is accepted server-side; startDate/endDate are ignored by the IC endpoint.
|
|
@@ -33,6 +33,6 @@ export function registerAssignmentTools(server, client) {
|
|
|
33
33
|
if (args.missingOnly) {
|
|
34
34
|
data = data.filter((a) => a.missing);
|
|
35
35
|
}
|
|
36
|
-
return
|
|
36
|
+
return viewResponse(rawArgs.view, data);
|
|
37
37
|
});
|
|
38
38
|
}
|
package/dist/tools/attendance.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { viewArg, viewResponse } from '../view.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { is404, featureDisabled, findStudent, studentNotFound, toArray, checkFeatureDisabled } from './_shared.js';
|
|
4
4
|
const argsSchema = z.object({
|
|
@@ -42,7 +42,7 @@ export function registerAttendanceTools(server, client) {
|
|
|
42
42
|
server.registerTool('ic_list_attendance', {
|
|
43
43
|
description: "List a student's absences and tardies (per-course summary grouped by term). Auto-resolves enrollmentID from the student record.",
|
|
44
44
|
annotations: { readOnlyHint: true },
|
|
45
|
-
inputSchema: argsSchema.shape,
|
|
45
|
+
inputSchema: { ...argsSchema.shape, view: viewArg() },
|
|
46
46
|
}, async (rawArgs) => {
|
|
47
47
|
const args = argsSchema.parse(rawArgs);
|
|
48
48
|
const student = await findStudent(client, args.district, args.studentId);
|
|
@@ -71,7 +71,7 @@ export function registerAttendanceTools(server, client) {
|
|
|
71
71
|
results.push({ ...entry, terms: trimmedTerms });
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
return
|
|
74
|
+
return viewResponse(rawArgs.view, results);
|
|
75
75
|
}
|
|
76
76
|
catch (e) {
|
|
77
77
|
if (is404(e))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { viewArg, viewResponse } from '../view.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { is404, featureDisabled, findStudent, studentNotFound, toArray, checkFeatureDisabled } from './_shared.js';
|
|
4
4
|
const argsSchema = z.object({
|
|
@@ -43,7 +43,7 @@ export function registerAttendanceEventsTools(server, client) {
|
|
|
43
43
|
server.registerTool('ic_list_attendance_events', {
|
|
44
44
|
description: "List individual attendance events (absences, tardies, early releases) for a student. Each event has a code, description, excuse reason, and optional human-readable comments. Auto-resolves enrollmentID from the student record. Use since/until to filter by date and excusedOnly to show only excused events.",
|
|
45
45
|
annotations: { readOnlyHint: true },
|
|
46
|
-
inputSchema: argsSchema.shape,
|
|
46
|
+
inputSchema: { ...argsSchema.shape, view: viewArg() },
|
|
47
47
|
}, async (rawArgs) => {
|
|
48
48
|
const args = argsSchema.parse(rawArgs);
|
|
49
49
|
const student = await findStudent(client, args.district, args.studentId);
|
|
@@ -79,7 +79,7 @@ export function registerAttendanceEventsTools(server, client) {
|
|
|
79
79
|
results.push(trimmed);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
return
|
|
82
|
+
return viewResponse(rawArgs.view, results);
|
|
83
83
|
}
|
|
84
84
|
catch (e) {
|
|
85
85
|
if (is404(e))
|
package/dist/tools/behavior.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { viewArg, viewResponse } from '../view.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { is404, featureDisabled, findStudent, studentNotFound, checkFeatureDisabled } from './_shared.js';
|
|
4
4
|
const argsSchema = z.object({
|
|
@@ -11,7 +11,7 @@ export function registerBehaviorTools(server, client) {
|
|
|
11
11
|
server.registerTool('ic_list_behavior', {
|
|
12
12
|
description: "List a student's behavior events / referrals. Returns FeatureDisabled if the district has the behavior module turned off (detected via displayOptions or a 404 backstop).",
|
|
13
13
|
annotations: { readOnlyHint: true },
|
|
14
|
-
inputSchema: argsSchema.shape,
|
|
14
|
+
inputSchema: { ...argsSchema.shape, view: viewArg() },
|
|
15
15
|
}, async (rawArgs) => {
|
|
16
16
|
const args = argsSchema.parse(rawArgs);
|
|
17
17
|
const student = await findStudent(client, args.district, args.studentId);
|
|
@@ -27,7 +27,7 @@ export function registerBehaviorTools(server, client) {
|
|
|
27
27
|
params.set('endDate', args.until);
|
|
28
28
|
try {
|
|
29
29
|
const data = await client.request(args.district, `/campus/resources/portal/behavior?${params}`);
|
|
30
|
-
return
|
|
30
|
+
return viewResponse(rawArgs.view, data);
|
|
31
31
|
}
|
|
32
32
|
catch (e) {
|
|
33
33
|
if (is404(e))
|
package/dist/tools/calendar.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { viewArg, viewResponse } from '../view.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { findStudent, studentNotFound, toArray } from './_shared.js';
|
|
4
4
|
const argsSchema = z.object({
|
|
@@ -11,7 +11,7 @@ export function registerCalendarTools(server, client) {
|
|
|
11
11
|
server.registerTool('ic_list_school_days', {
|
|
12
12
|
description: "List a student's school days (instructional calendar) grouped by term. Returns one entry per enrollment, with term boundaries (Q1-Q4 start/end dates) and the school days inside each term — including comments like 'Teacher Workday' or 'Spring Break'. Use since/until to narrow the range.",
|
|
13
13
|
annotations: { readOnlyHint: true },
|
|
14
|
-
inputSchema: argsSchema.shape,
|
|
14
|
+
inputSchema: { ...argsSchema.shape, view: viewArg() },
|
|
15
15
|
}, async (rawArgs) => {
|
|
16
16
|
const args = argsSchema.parse(rawArgs);
|
|
17
17
|
// 1. Get student to find their enrollment(s) → calendarID + structureID
|
|
@@ -64,6 +64,6 @@ export function registerCalendarTools(server, client) {
|
|
|
64
64
|
terms: trimmedTerms,
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
return
|
|
67
|
+
return viewResponse(rawArgs.view, result);
|
|
68
68
|
});
|
|
69
69
|
}
|
package/dist/tools/districts.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { viewArg, viewResponse } from '../view.js';
|
|
2
2
|
export function registerDistrictTools(server, client) {
|
|
3
3
|
server.registerTool('ic_list_districts', {
|
|
4
4
|
description: 'List Infinite Campus districts configured for this MCP server. Returns names + base URLs (no credentials).',
|
|
5
|
+
inputSchema: {
|
|
6
|
+
view: viewArg(),
|
|
7
|
+
},
|
|
5
8
|
annotations: { readOnlyHint: true },
|
|
6
|
-
}, async () => {
|
|
9
|
+
}, async ({ view }) => {
|
|
7
10
|
await client.ensureDiscovery();
|
|
8
11
|
const data = client.listDistricts();
|
|
9
|
-
return
|
|
12
|
+
return viewResponse(view, data);
|
|
10
13
|
});
|
|
11
14
|
}
|
package/dist/tools/documents.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { minifiedResult } from '@chrischall/mcp-utils';
|
|
2
|
+
import { viewArg, viewResponse } from '../view.js';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { is404, featureDisabled, toArray, findStudent, studentNotFound, checkFeatureDisabled } from './_shared.js';
|
|
4
5
|
const listArgs = z.object({
|
|
@@ -15,7 +16,7 @@ export function registerDocumentTools(server, client) {
|
|
|
15
16
|
server.registerTool('ic_list_documents', {
|
|
16
17
|
description: "List a student's available documents (report cards, transcripts, schedules). Returns metadata only — use ic_download_document to fetch the file. Returns FeatureDisabled if the district has the module turned off.",
|
|
17
18
|
annotations: { readOnlyHint: true },
|
|
18
|
-
inputSchema: listArgs.shape,
|
|
19
|
+
inputSchema: { ...listArgs.shape, view: viewArg() },
|
|
19
20
|
}, async (rawArgs) => {
|
|
20
21
|
const args = listArgs.parse(rawArgs);
|
|
21
22
|
const student = await findStudent(client, args.district, args.studentId);
|
|
@@ -40,7 +41,7 @@ export function registerDocumentTools(server, client) {
|
|
|
40
41
|
out.endYear = d.endYear;
|
|
41
42
|
return out;
|
|
42
43
|
});
|
|
43
|
-
return
|
|
44
|
+
return viewResponse(rawArgs.view, trimmed);
|
|
44
45
|
}
|
|
45
46
|
catch (e) {
|
|
46
47
|
if (is404(e))
|
|
@@ -58,11 +59,11 @@ export function registerDocumentTools(server, client) {
|
|
|
58
59
|
const meta = await client.download(args.district, args.documentId, args.destinationPath, {
|
|
59
60
|
overwrite: args.overwrite ?? false,
|
|
60
61
|
});
|
|
61
|
-
return
|
|
62
|
+
return minifiedResult(meta);
|
|
62
63
|
}
|
|
63
64
|
catch (e) {
|
|
64
65
|
if (e instanceof Error && e.message.startsWith('IC download 404')) {
|
|
65
|
-
return
|
|
66
|
+
return minifiedResult({ warning: 'FeatureDisabled', feature: 'documents', district: args.district });
|
|
66
67
|
}
|
|
67
68
|
throw e;
|
|
68
69
|
}
|
package/dist/tools/features.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { viewArg, viewResponse } from '../view.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { findStudent, studentNotFound } from './_shared.js';
|
|
4
4
|
const argsSchema = z.object({
|
|
@@ -9,7 +9,7 @@ export function registerFeaturesTools(server, client) {
|
|
|
9
9
|
server.registerTool('ic_get_features', {
|
|
10
10
|
description: "List the district's displayOptions feature-flag allow-list for each of a student's enrollments. Each enrollment's `features` object is a map of ~90 flag names (attendance, behavior, assessment, documents, grades, schedule, etc.) to booleans. A `false` value means the district has that feature disabled for this enrollment; `true` or missing means it's available. Used internally by other tools to short-circuit disabled features, but exposed here so the LLM can answer capability questions directly.",
|
|
11
11
|
annotations: { readOnlyHint: true },
|
|
12
|
-
inputSchema: argsSchema.shape,
|
|
12
|
+
inputSchema: { ...argsSchema.shape, view: viewArg() },
|
|
13
13
|
}, async (rawArgs) => {
|
|
14
14
|
const args = argsSchema.parse(rawArgs);
|
|
15
15
|
const student = await findStudent(client, args.district, args.studentId);
|
|
@@ -25,6 +25,6 @@ export function registerFeaturesTools(server, client) {
|
|
|
25
25
|
features,
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
-
return
|
|
28
|
+
return viewResponse(rawArgs.view, result);
|
|
29
29
|
});
|
|
30
30
|
}
|
package/dist/tools/fees.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { viewArg, viewResponse } from '../view.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { is404, featureDisabled } from './_shared.js';
|
|
4
4
|
const argsSchema = z.object({
|
|
@@ -9,7 +9,7 @@ export function registerFeeTools(server, client) {
|
|
|
9
9
|
server.registerTool('ic_list_fees', {
|
|
10
10
|
description: "List a student's fee assignments (charges owed) and running balance/surplus. Combines two endpoints: fee assignments and totalSurplus. Returns FeatureDisabled only if both endpoints 404; if only one works, returns that side with warning: 'PartialSuccess' and an issues[] explaining which endpoint failed.",
|
|
11
11
|
annotations: { readOnlyHint: true },
|
|
12
|
-
inputSchema: argsSchema.shape,
|
|
12
|
+
inputSchema: { ...argsSchema.shape, view: viewArg() },
|
|
13
13
|
}, async (rawArgs) => {
|
|
14
14
|
const args = argsSchema.parse(rawArgs);
|
|
15
15
|
const personIDEnc = encodeURIComponent(args.studentId);
|
|
@@ -39,6 +39,6 @@ export function registerFeeTools(server, client) {
|
|
|
39
39
|
feeAssignments: assignments.ok ? assignments.value : [],
|
|
40
40
|
...(issues.length > 0 ? { issues } : {}),
|
|
41
41
|
};
|
|
42
|
-
return
|
|
42
|
+
return viewResponse(rawArgs.view, response);
|
|
43
43
|
});
|
|
44
44
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { viewArg, viewResponse } from '../view.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { is404, featureDisabled, findStudent, studentNotFound, checkFeatureDisabled } from './_shared.js';
|
|
4
4
|
const argsSchema = z.object({
|
|
@@ -12,7 +12,7 @@ export function registerFoodServiceTools(server, client) {
|
|
|
12
12
|
server.registerTool('ic_list_food_service', {
|
|
13
13
|
description: "List a student's lunch balance and recent food-service transactions. Returns FeatureDisabled if the district has the module turned off (detected via displayOptions or a 404 backstop).",
|
|
14
14
|
annotations: { readOnlyHint: true },
|
|
15
|
-
inputSchema: argsSchema.shape,
|
|
15
|
+
inputSchema: { ...argsSchema.shape, view: viewArg() },
|
|
16
16
|
}, async (rawArgs) => {
|
|
17
17
|
const args = argsSchema.parse(rawArgs);
|
|
18
18
|
const student = await findStudent(client, args.district, args.studentId);
|
|
@@ -28,7 +28,7 @@ export function registerFoodServiceTools(server, client) {
|
|
|
28
28
|
params.set('endDate', args.until);
|
|
29
29
|
try {
|
|
30
30
|
const data = await client.request(args.district, `/campus/resources/portal/foodService?${params}`);
|
|
31
|
-
return
|
|
31
|
+
return viewResponse(rawArgs.view, data);
|
|
32
32
|
}
|
|
33
33
|
catch (e) {
|
|
34
34
|
if (is404(e))
|
package/dist/tools/grades.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { viewArg, viewResponse } from '../view.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
const argsSchema = z.object({
|
|
4
4
|
district: z.string(),
|
|
@@ -9,13 +9,13 @@ export function registerGradeTools(server, client) {
|
|
|
9
9
|
server.registerTool('ic_list_grades', {
|
|
10
10
|
description: "List a student's term grades and in-progress course grades.",
|
|
11
11
|
annotations: { readOnlyHint: true },
|
|
12
|
-
inputSchema: argsSchema.shape,
|
|
12
|
+
inputSchema: { ...argsSchema.shape, view: viewArg() },
|
|
13
13
|
}, async (rawArgs) => {
|
|
14
14
|
const args = argsSchema.parse(rawArgs);
|
|
15
15
|
const params = new URLSearchParams({ personID: args.studentId });
|
|
16
16
|
if (args.termId)
|
|
17
17
|
params.set('termID', args.termId);
|
|
18
18
|
const data = await client.request(args.district, `/campus/resources/portal/grades?${params}`);
|
|
19
|
-
return
|
|
19
|
+
return viewResponse(rawArgs.view, data);
|
|
20
20
|
});
|
|
21
21
|
}
|
package/dist/tools/messages.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { viewArg, viewResponse } from '../view.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { extractPlainTextFromHtml } from '@chrischall/mcp-utils/html';
|
|
4
4
|
import { toArray } from './_shared.js';
|
|
@@ -72,7 +72,7 @@ export function registerMessageTools(server, client) {
|
|
|
72
72
|
server.registerTool('ic_list_messages', {
|
|
73
73
|
description: "List all parent-visible messages from three IC sources combined: (1) prism notifications (assignment alerts, grade postings, attendance alerts), (2) Messenger 2.0 inbox (teacher messages, district announcements with newMessage/actionRequired flags), and (3) portal userNotice announcements. Each section has its own count and items; if any source errors, that section contains an error field and the others still return normally. The `limit` arg caps the prism notifications only (the high-volume source). Note: listing inbox messages does not mark them as read in normal portal behavior, but some district configurations may update read-tracking; use ic_get_message for the full HTML body.",
|
|
74
74
|
annotations: { readOnlyHint: true },
|
|
75
|
-
inputSchema: listArgs.shape,
|
|
75
|
+
inputSchema: { ...listArgs.shape, view: viewArg() },
|
|
76
76
|
}, async (rawArgs) => {
|
|
77
77
|
const args = listArgs.parse(rawArgs);
|
|
78
78
|
const limit = args.limit ?? 20;
|
|
@@ -96,17 +96,17 @@ export function registerMessageTools(server, client) {
|
|
|
96
96
|
return { count: 0, items: [], error: e instanceof Error ? e.message : String(e) };
|
|
97
97
|
});
|
|
98
98
|
const [notifications, inbox, announcements] = await Promise.all([prismPromise, inboxPromise, noticePromise]);
|
|
99
|
-
return
|
|
99
|
+
return viewResponse(rawArgs.view, { notifications, inbox, announcements });
|
|
100
100
|
});
|
|
101
101
|
server.registerTool('ic_get_message', {
|
|
102
102
|
description: "Fetch the HTML body of an inbox message and return it parsed into { subject, date, body, url }. Takes a `messageUrl` which is the `url` field from an item returned by ic_list_messages' inbox section (e.g. 'portal/messageView.xsl?x=messenger.MessengerEngine-getMessageRecipientView&messageID=...'). Relative and /campus/-prefixed URLs are both accepted. Note: fetching the HTML body may mark the message as read on some district configurations; probe against an empty inbox could not confirm the side effect.",
|
|
103
103
|
annotations: { readOnlyHint: true },
|
|
104
|
-
inputSchema: getArgs.shape,
|
|
104
|
+
inputSchema: { ...getArgs.shape, view: viewArg() },
|
|
105
105
|
}, async (rawArgs) => {
|
|
106
106
|
const args = getArgs.parse(rawArgs);
|
|
107
107
|
const path = normalizeMessageUrl(args.messageUrl);
|
|
108
108
|
const html = await client.request(args.district, path, { responseType: 'text' });
|
|
109
109
|
const parsed = parseMessageHtml(html ?? '', path);
|
|
110
|
-
return
|
|
110
|
+
return viewResponse(rawArgs.view, parsed);
|
|
111
111
|
});
|
|
112
112
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { viewArg, viewResponse } from '../view.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
const argsSchema = z.object({
|
|
4
4
|
district: z.string(),
|
|
@@ -19,7 +19,7 @@ export function registerRecentGradesTools(server, client) {
|
|
|
19
19
|
server.registerTool('ic_list_recent_grades', {
|
|
20
20
|
description: "List recently-graded assignments for a student. Server-side filtered by scoreModifiedDate. Pass since=YYYY-MM-DD to set the cutoff; defaults to 14 days ago.",
|
|
21
21
|
annotations: { readOnlyHint: true },
|
|
22
|
-
inputSchema: argsSchema.shape,
|
|
22
|
+
inputSchema: { ...argsSchema.shape, view: viewArg() },
|
|
23
23
|
}, async (rawArgs) => {
|
|
24
24
|
const args = argsSchema.parse(rawArgs);
|
|
25
25
|
const sinceDate = args.since ?? defaultSinceDate(new Date());
|
|
@@ -34,6 +34,6 @@ export function registerRecentGradesTools(server, client) {
|
|
|
34
34
|
}
|
|
35
35
|
return out;
|
|
36
36
|
});
|
|
37
|
-
return
|
|
37
|
+
return viewResponse(rawArgs.view, trimmed);
|
|
38
38
|
});
|
|
39
39
|
}
|
package/dist/tools/schedule.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { viewArg, viewResponse } from '../view.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
const argsSchema = z.object({
|
|
4
4
|
district: z.string().describe('District name from ic_list_districts'),
|
|
@@ -10,11 +10,11 @@ export function registerScheduleTools(server, client) {
|
|
|
10
10
|
server.registerTool('ic_get_schedule', {
|
|
11
11
|
description: "Get a student's class schedule for a given date (default: today).",
|
|
12
12
|
annotations: { readOnlyHint: true },
|
|
13
|
-
inputSchema: argsSchema.shape,
|
|
13
|
+
inputSchema: { ...argsSchema.shape, view: viewArg() },
|
|
14
14
|
}, async (rawArgs) => {
|
|
15
15
|
const args = argsSchema.parse(rawArgs);
|
|
16
16
|
const params = new URLSearchParams({ personID: args.studentId });
|
|
17
17
|
const data = await client.request(args.district, `/campus/resources/portal/roster?${params}`);
|
|
18
|
-
return
|
|
18
|
+
return viewResponse(rawArgs.view, data);
|
|
19
19
|
});
|
|
20
20
|
}
|
package/dist/tools/students.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { viewArg, viewResponse } from '../view.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
const argsSchema = z.object({
|
|
4
4
|
district: z.string().describe('District name from ic_list_districts'),
|
|
@@ -7,10 +7,10 @@ export function registerStudentTools(server, client) {
|
|
|
7
7
|
server.registerTool('ic_list_students', {
|
|
8
8
|
description: 'List students enrolled under the parent account for a given district.',
|
|
9
9
|
annotations: { readOnlyHint: true },
|
|
10
|
-
inputSchema: argsSchema.shape,
|
|
10
|
+
inputSchema: { ...argsSchema.shape, view: viewArg() },
|
|
11
11
|
}, async (rawArgs) => {
|
|
12
12
|
const args = argsSchema.parse(rawArgs);
|
|
13
13
|
const data = await client.request(args.district, '/campus/api/portal/students');
|
|
14
|
-
return
|
|
14
|
+
return viewResponse(rawArgs.view, data);
|
|
15
15
|
});
|
|
16
16
|
}
|
package/dist/tools/teachers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { viewArg, viewResponse } from '../view.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { is404, toArray } from './_shared.js';
|
|
4
4
|
const argsSchema = z.object({
|
|
@@ -25,7 +25,7 @@ export function registerTeacherTools(server, client) {
|
|
|
25
25
|
server.registerTool('ic_list_teachers', {
|
|
26
26
|
description: "List a student's teachers (per enrolled section) and assigned counselor(s). Combines two endpoints (section/contacts and studentCounselor/byUser). Response field shapes may vary slightly by district — core fields (firstName, lastName, email) are consistent; additional fields are passed through.",
|
|
27
27
|
annotations: { readOnlyHint: true },
|
|
28
|
-
inputSchema: argsSchema.shape,
|
|
28
|
+
inputSchema: { ...argsSchema.shape, view: viewArg() },
|
|
29
29
|
}, async (rawArgs) => {
|
|
30
30
|
const args = argsSchema.parse(rawArgs);
|
|
31
31
|
const personID = encodeURIComponent(args.studentId);
|
|
@@ -42,6 +42,6 @@ export function registerTeacherTools(server, client) {
|
|
|
42
42
|
const [teachersRaw, counselorsRaw] = await Promise.all([teachersPromise, counselorsPromise]);
|
|
43
43
|
const teachers = toArray(teachersRaw).map((t) => trimRecord(t));
|
|
44
44
|
const counselors = toArray(counselorsRaw).map((c) => trimRecord(c));
|
|
45
|
-
return
|
|
45
|
+
return viewResponse(rawArgs.view, { counselors, teachers });
|
|
46
46
|
});
|
|
47
47
|
}
|
package/dist/view.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { minifiedResult, resolveView, stripMediaUrls, viewParam } from '@chrischall/mcp-utils';
|
|
2
|
+
/**
|
|
3
|
+
* The rungs this server honours (`@chrischall/mcp-utils`' `view` vocabulary;
|
|
4
|
+
* `chrischall/workflows` `docs/fleet-conventions.md`, "Response shape").
|
|
5
|
+
*
|
|
6
|
+
* **What compact does here, and what it deliberately does NOT do.**
|
|
7
|
+
*
|
|
8
|
+
* The read tools in this server hand back Infinite Campus's payload close to
|
|
9
|
+
* verbatim, and the repo holds no verified record of what those payloads
|
|
10
|
+
* contain — no captured fixture, no documented field list. So nothing here can
|
|
11
|
+
* honestly say which of Infinite Campus's fields matter and which are noise.
|
|
12
|
+
*
|
|
13
|
+
* Compact therefore does the one projection that needs no such knowledge: it
|
|
14
|
+
* strips image and avatar URLs. That is SUBTRACTIVE, so it cannot lose a field
|
|
15
|
+
* nobody knew about — the failure an invented field list would risk, where a
|
|
16
|
+
* record comes back with holes in it and reads like a verified answer.
|
|
17
|
+
*
|
|
18
|
+
* When a real payload can be captured, a field projection belongs here beside
|
|
19
|
+
* this one and will save considerably more. Until then this is the honest
|
|
20
|
+
* ceiling, and this docblock says so rather than implying a shape was checked.
|
|
21
|
+
*/
|
|
22
|
+
export const IC_VIEWS = ['compact', 'full'];
|
|
23
|
+
const NOTE = 'compact strips image/avatar URLs from the response; "full" returns Infinite Campus\'s payload untouched. ' +
|
|
24
|
+
'No field projection: this server has no verified record of which Infinite Campus fields matter, and inventing ' +
|
|
25
|
+
'one would risk dropping a field a caller needs.';
|
|
26
|
+
/** The `view` parameter every read tool in this server takes. */
|
|
27
|
+
export const viewArg = () => viewParam(IC_VIEWS, { note: NOTE });
|
|
28
|
+
/**
|
|
29
|
+
* Answer in the requested rung.
|
|
30
|
+
*
|
|
31
|
+
* Only ever called from a READ tool. A write's response is a receipt — an id,
|
|
32
|
+
* a status — with nothing to strip and everything to keep.
|
|
33
|
+
*/
|
|
34
|
+
export function viewResponse(view, data) {
|
|
35
|
+
const rung = resolveView(view, IC_VIEWS);
|
|
36
|
+
return minifiedResult(rung === 'compact' ? stripMediaUrls(data) : data);
|
|
37
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "infinitecampus-mcp",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"mcpName": "io.github.chrischall/infinitecampus-mcp",
|
|
5
5
|
"description": "Infinite Campus (Campus Parent) MCP server — multi-district read + message/document write",
|
|
6
6
|
"author": "Claude Code (AI) <https://www.anthropic.com/claude>",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@chrischall/mcp-utils": "^0.
|
|
48
|
+
"@chrischall/mcp-utils": "^0.23.2",
|
|
49
49
|
"@fetchproxy/bootstrap": "^2.2.0",
|
|
50
50
|
"@fetchproxy/server": "^2.2.0",
|
|
51
51
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
package/server.json
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"url": "https://github.com/chrischall/infinitecampus-mcp",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "2.
|
|
9
|
+
"version": "2.8.0",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "infinitecampus-mcp",
|
|
14
|
-
"version": "2.
|
|
14
|
+
"version": "2.8.0",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
},
|