search_assets
Search school assets by free-text query or filters on class, category, or status. Returns up to 50 matches per page with pagination support.
Instructions
Search the school's assets by free-text query and/or filters. Returns up to 50 matches per page. Use the cursor field from the response to fetch the next page.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | No | Free-text query (matches name, model, serial). | |
| item_class | No | Filter by class: 'instrument', 'equipment', 'consumable', etc. | |
| category | No | Domain category (e.g. 'brass', 'percussion', 'av'). | |
| status | No | Lifecycle: 'active', 'retired', 'in_repair', etc. | |
| cursor | No | Opaque pagination cursor from a prior response. |
Implementation Reference
- src/tools/index.ts:98-108 (handler)The async handler function that executes the 'search_assets' tool logic. It calls the API endpoint /v1/schools/{schoolId}/gear with optional query parameters (q, item_class, category, status, cursor) and a limit of 50.
async handler(args, client) { const ctx = await client.getContext(); return client.get<unknown>(`/v1/schools/${ctx.schoolId}/gear`, { q: typeof args.q === 'string' ? args.q : undefined, item_class: typeof args.item_class === 'string' ? args.item_class : undefined, category: typeof args.category === 'string' ? args.category : undefined, status: typeof args.status === 'string' ? args.status : undefined, cursor: typeof args.cursor === 'string' ? args.cursor : undefined, limit: '50', }); }, - src/tools/index.ts:78-97 (schema)Input schema for the search_assets tool. Defines the 'q' (free-text query), 'item_class', 'category', 'status', and 'cursor' (pagination) parameters with descriptions.
inputSchema: { type: 'object', properties: { q: { type: 'string', description: 'Free-text query (matches name, model, serial).' }, item_class: { type: 'string', description: "Filter by class: 'instrument', 'equipment', 'consumable', etc.", }, category: { type: 'string', description: "Domain category (e.g. 'brass', 'percussion', 'av').", }, status: { type: 'string', description: "Lifecycle: 'active', 'retired', 'in_repair', etc.", }, cursor: { type: 'string', description: 'Opaque pagination cursor from a prior response.' }, }, additionalProperties: false, }, - src/tools/index.ts:74-109 (registration)Tool definition for 'search_assets' including name, description, input schema, and handler. Exported via the 'tools' array and 'toolByName' map at lines 193-202.
const searchAssets: ToolDef = { name: 'search_assets', description: "Search the school's assets by free-text query and/or filters. Returns up to 50 matches per page. Use the `cursor` field from the response to fetch the next page.", inputSchema: { type: 'object', properties: { q: { type: 'string', description: 'Free-text query (matches name, model, serial).' }, item_class: { type: 'string', description: "Filter by class: 'instrument', 'equipment', 'consumable', etc.", }, category: { type: 'string', description: "Domain category (e.g. 'brass', 'percussion', 'av').", }, status: { type: 'string', description: "Lifecycle: 'active', 'retired', 'in_repair', etc.", }, cursor: { type: 'string', description: 'Opaque pagination cursor from a prior response.' }, }, additionalProperties: false, }, async handler(args, client) { const ctx = await client.getContext(); return client.get<unknown>(`/v1/schools/${ctx.schoolId}/gear`, { q: typeof args.q === 'string' ? args.q : undefined, item_class: typeof args.item_class === 'string' ? args.item_class : undefined, category: typeof args.category === 'string' ? args.category : undefined, status: typeof args.status === 'string' ? args.status : undefined, cursor: typeof args.cursor === 'string' ? args.cursor : undefined, limit: '50', }); }, }; - src/tools/index.ts:193-202 (registration)The tools array and toolByName map that register all tools including search_assets for use by the MCP server.
export const tools: ToolDef[] = [ listSchools, getAsset, searchAssets, getLoansForAsset, listMembers, listAssetThreads, ]; export const toolByName = new Map(tools.map((t) => [t.name, t]));