list_members
Retrieve a filtered list of school members including id, role, status, and external_id without personal identifiers. Supports filtering by role and status with pagination.
Instructions
List the school's members. Returns id, role, status, external_id only — no PII (email/phone are intentionally excluded from the public API).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| role | No | Filter by role: 'student', 'teacher', 'staff', etc. | |
| status | No | Lifecycle: 'active', 'inactive'. | |
| cursor | No | Opaque pagination cursor. |
Implementation Reference
- src/tools/index.ts:142-163 (handler)Handler function for list_members tool. Calls GET /v1/schools/{schoolId}/members with optional role, status, and cursor query parameters.
const listMembers: ToolDef = { name: 'list_members', description: "List the school's members. Returns id, role, status, external_id only — no PII (email/phone are intentionally excluded from the public API).", inputSchema: { type: 'object', properties: { role: { type: 'string', description: "Filter by role: 'student', 'teacher', 'staff', etc." }, status: { type: 'string', description: "Lifecycle: 'active', 'inactive'." }, cursor: { type: 'string', description: 'Opaque pagination cursor.' }, }, additionalProperties: false, }, async handler(args, client) { const ctx = await client.getContext(); return client.get<unknown>(`/v1/schools/${ctx.schoolId}/members`, { role: typeof args.role === 'string' ? args.role : undefined, status: typeof args.status === 'string' ? args.status : undefined, cursor: typeof args.cursor === 'string' ? args.cursor : undefined, }); }, }; - src/tools/index.ts:146-154 (schema)Input schema for list_members: optional role (string), status (string), cursor (string) filters.
inputSchema: { type: 'object', properties: { role: { type: 'string', description: "Filter by role: 'student', 'teacher', 'staff', etc." }, status: { type: 'string', description: "Lifecycle: 'active', 'inactive'." }, cursor: { type: 'string', description: 'Opaque pagination cursor.' }, }, additionalProperties: false, }, - src/tools/index.ts:193-202 (registration)Tool registration in the tools array and toolByName map, making list_members available for dispatch.
export const tools: ToolDef[] = [ listSchools, getAsset, searchAssets, getLoansForAsset, listMembers, listAssetThreads, ]; export const toolByName = new Map(tools.map((t) => [t.name, t])); - src/server.ts:40-50 (registration)MCP server dispatch in src/server.ts — tools/call handler looks up the tool by name from toolByName map and calls its handler.
// tools/call — dispatch by name; let errors bubble up as protocol // errors (the SDK serializes them appropriately). server.setRequestHandler(CallToolRequestSchema, async (req) => { const { name, arguments: args } = req.params; const tool = toolByName.get(name); if (!tool) { throw new Error(`Unknown tool: ${name}`); } try { const result = await tool.handler((args ?? {}) as Record<string, unknown>, client);