activate_teacher
Activate a teacher by providing their ID. This tool marks the teacher as active in the Eduframe system.
Instructions
Mark teacher as active
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID of the teacher |
Implementation Reference
- src/tools/teachers.ts:72-88 (handler)The 'activate_teacher' tool handler function. It takes an 'id' input, POSTs to /teachers/{id}/activate to mark a teacher as active, logs the response, and returns the formatted teacher record.
server.registerTool( "activate_teacher", { description: "Mark teacher as active", annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true }, inputSchema: { id: z.number().int().positive().describe("ID of the teacher") }, }, async ({ id }) => { try { const record = await apiPost<EduframeRecord>(`/teachers/${id}/activate`, {}); void logResponse("activate_teacher", { id }, record); return formatShow(record, "teacher"); } catch (error) { return formatError(error); } }, ); - src/tools/teachers.ts:74-77 (schema)Input schema for 'activate_teacher' - requires a positive integer 'id' field.
{ description: "Mark teacher as active", annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true }, inputSchema: { id: z.number().int().positive().describe("ID of the teacher") }, - src/tools/teachers.ts:72-88 (registration)Registration of 'activate_teacher' tool via server.registerTool() within registerTeacherTools().
server.registerTool( "activate_teacher", { description: "Mark teacher as active", annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true }, inputSchema: { id: z.number().int().positive().describe("ID of the teacher") }, }, async ({ id }) => { try { const record = await apiPost<EduframeRecord>(`/teachers/${id}/activate`, {}); void logResponse("activate_teacher", { id }, record); return formatShow(record, "teacher"); } catch (error) { return formatError(error); } }, ); - src/tools/index.ts:129-131 (registration)Top-level registration: registerTeacherTools is called from registerAllTools() in the tools index, which iterates over all tool registration functions.
for (const register of tools) { register(server); } - src/api.ts:163-174 (helper)The apiPost helper used by the handler to POST to /teachers/{id}/activate endpoint.
export async function apiPost<T>(path: string, body: unknown): Promise<T> { const { token } = getConfig(); const url = buildUrl(path); const response = await fetch(url.toString(), { method: "POST", headers: buildHeaders(token), body: JSON.stringify(body), }); return handleResponse<T>(response); }