search_manuals
Find robot manuals by searching filenames to access documentation for Waferlock Robot services through secure API access.
Instructions
Search for manuals by filename
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query for manual filenames |
Implementation Reference
- src/services/mcpService.ts:244-273 (registration)Registration of the 'search_manuals' tool using this.server.registerTool, including inline schema and handler.this.server.registerTool( 'search_manuals', { description: 'Search manuals by filename (returns basic info only, no download)', inputSchema: { query: z.string() }, }, async (args) => { const allManuals = await this.manualProvider.listManuals(); const filtered = allManuals.filter((m: any) => m.originalName?.toLowerCase().includes(args.query.toLowerCase()) || m.filename?.toLowerCase().includes(args.query.toLowerCase()) ); const serialised = filtered.map(serialiseManual); return { content: [ { type: 'text', text: serialised.length > 0 ? `Found ${serialised.length} manuals matching "${args.query}":\n\n${formatManualList(filtered)}` : `No manuals found matching "${args.query}".`, }, ], structuredContent: { manuals: serialised, }, }; } );
- src/services/mcpService.ts:250-272 (handler)The core handler function that fetches all manuals via manualProvider, filters by query matching filename or originalName (case-insensitive), serializes results, and returns formatted text content and structured manuals list.async (args) => { const allManuals = await this.manualProvider.listManuals(); const filtered = allManuals.filter((m: any) => m.originalName?.toLowerCase().includes(args.query.toLowerCase()) || m.filename?.toLowerCase().includes(args.query.toLowerCase()) ); const serialised = filtered.map(serialiseManual); return { content: [ { type: 'text', text: serialised.length > 0 ? `Found ${serialised.length} manuals matching "${args.query}":\n\n${formatManualList(filtered)}` : `No manuals found matching "${args.query}".`, }, ], structuredContent: { manuals: serialised, }, }; }
- src/services/mcpService.ts:246-249 (schema)Tool schema defining the description and inputSchema with a required 'query' string parameter using Zod validation.{ description: 'Search manuals by filename (returns basic info only, no download)', inputSchema: { query: z.string() }, },
- src/services/mcpService.ts:22-29 (helper)Helper function to serialize UploadedFile objects, converting dates to ISO strings and handling optional index timestamps.function serialiseManual(manual: UploadedFile) { return { ...manual, uploadedAt: manual.uploadedAt instanceof Date ? manual.uploadedAt.toISOString() : manual.uploadedAt, indexStartedAt: manual.indexStartedAt || null, indexCompletedAt: manual.indexCompletedAt || null, }; }
- src/services/mcpService.ts:35-37 (helper)Helper function to format a list of manuals as a pretty-printed JSON string of serialized manuals, used in the response text.function formatManualList(manuals: UploadedFile[]): string { return JSON.stringify(manuals.map(serialiseManual), null, 2); }