list_schools
Retrieve the school bound to your token to confirm which school you are currently accessing before making other API calls.
Instructions
List schools accessible to the calling token. Each token is bound to exactly one school, so this returns a single-item array. Useful for the AI to confirm which school it's looking at before making other calls.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/index.ts:40-44 (handler)The handler function that executes list_schools logic: resolves token context via client.getContext(), fetches the school by its ID from /v1/schools/{schoolId}, and returns a single-item array.
async handler(_args, client) { const ctx = await client.getContext(); const school = await client.get<unknown>(`/v1/schools/${ctx.schoolId}`); return { schools: [school] }; }, - src/tools/index.ts:35-39 (schema)Input schema for list_schools — an empty object with no properties and additionalProperties set to false, since the tool takes no arguments.
inputSchema: { type: 'object', properties: {}, additionalProperties: false, }, - src/tools/index.ts:191-200 (registration)The tools array (line 193-200) registers listSchools alongside all other tools. The toolByName map (line 202) provides name-based lookup.
// ─── exports ──────────────────────────────────────────────────────── export const tools: ToolDef[] = [ listSchools, getAsset, searchAssets, getLoansForAsset, listMembers, listAssetThreads, ]; - src/api-client.ts:47-71 (helper)The ApiClient.getContext() helper used by the handler to resolve the token's bound school ID, and ApiClient.get() method used to make the HTTP GET request.
async getContext(): Promise<CallerContext> { if (this.context) return this.context; const data = await this.get<{ school_id: string; school_name: string | null; capabilities: string[]; }>('/v1/me'); this.context = { schoolId: data.school_id, schoolName: data.school_name, capabilities: data.capabilities, }; this.log.info('mcp:context:resolved', { ...this.context }); return this.context; } async get<T>(path: string, query?: Record<string, string | undefined>): Promise<T> { const url = new URL(this.cfg.apiUrl + (path.startsWith('/') ? path : '/' + path)); if (query) { for (const [k, v] of Object.entries(query)) { if (v !== undefined && v !== '') url.searchParams.set(k, v); } } return this.request<T>('GET', url); }