list_by_category
Filter and list all API endpoints by a specific functional category in the Opentrons MCP Server, enabling organized access to robot control, protocol management, and health monitoring.
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 main handler function for the 'list_by_category' tool. Filters the pre-loaded endpoints array by tags matching the input category (case-insensitive), groups results by exact tag matches, formats as Markdown, and returns structured content or available categories if no matches.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:83-99 (schema)Input schema definition for the tool, specifying an object with required 'category' string property and predefined enum values for Opentrons API categories.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:81-101 (registration)Tool registration in the ListToolsRequestSchema handler, defining name, description, and inputSchema for discovery.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)Handler dispatch registration in the CallToolRequestSchema switch statement, mapping tool name to listByCategory method call.case "list_by_category": return this.listByCategory(args);