list_by_category
Filter and display API endpoints by functional category to organize Opentrons robot control operations.
Instructions
List all endpoints in a specific functional category
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | Yes | API category/tag to filter by |
Implementation Reference
- index.js:1337-1385 (handler)The handler function for the 'list_by_category' tool. It filters the endpoints array by tags matching the provided category (case-insensitive), groups results by exact tag, and returns a formatted markdown list of matching endpoints.listByCategory(args) { const { category } = args; const filtered = this.endpoints.filter(endpoint => endpoint.tags.some(tag => tag.toLowerCase().includes(category.toLowerCase())) ); if (filtered.length === 0) { const availableCategories = [...new Set(this.endpoints.flatMap(e => e.tags))]; return { content: [ { type: "text", text: `No endpoints found for category "${category}".\n\nAvailable categories:\n${availableCategories.map(cat => `- ${cat}`).join('\n')}` } ] }; } // Group by exact tag match const groupedByTag = {}; filtered.forEach(endpoint => { endpoint.tags.forEach(tag => { if (tag.toLowerCase().includes(category.toLowerCase())) { if (!groupedByTag[tag]) groupedByTag[tag] = []; groupedByTag[tag].push(endpoint); } }); }); let content = `**${category} API Endpoints** (${filtered.length} found):\n\n`; Object.entries(groupedByTag).forEach(([tag, endpoints]) => { content += `## ${tag}\n\n`; endpoints.forEach(endpoint => { content += `• **${endpoint.method} ${endpoint.path}** ${endpoint.deprecated ? '⚠️ DEPRECATED' : ''}\n`; content += ` ${endpoint.summary}\n\n`; }); }); return { content: [ { type: "text", text: content } ] }; }
- index.js:81-101 (schema)The tool schema definition including name, description, and inputSchema with required 'category' parameter and list of valid categories.name: "list_by_category", description: "List all endpoints in a specific functional category", inputSchema: { type: "object", properties: { category: { type: "string", description: "API category/tag to filter by", enum: [ "Health", "Networking", "Control", "Settings", "Modules", "Pipettes", "Calibration", "Run Management", "Protocol Management", "Data files Management", "Simple Commands", "Flex Deck Configuration", "Error Recovery Settings", "Attached Modules", "Attached Instruments", "Labware Offset Management", "System Control", "Client Data", "Maintenance Run Management", "Robot", "Subsystem Management" ] } }, required: ["category"] } },
- index.js:246-247 (registration)Registration of the tool handler in the CallToolRequestSchema switch statement, dispatching calls to the listByCategory method.case "list_by_category": return this.listByCategory(args);