Skip to content

McpToolsFormat ​

Category: Commands

Source: mcp_tools_format.dart

Shared formatter for glue mcp tools (CLI) and /mcp tools (slash): renders a grouped, human-readable listing of tools by MCP server.

Pure: takes simple value objects so it's unit-testable without spinning up a real McpClientPool.

Enums ​

McpServerListingStatus ​

ValueDescription
connected
connecting
reconnecting
disconnected
needsAuth
dead
disabled

Classes ​

McpToolEntry ​

Constructor ​

dart
const McpToolEntry({required this.name, this.description = ''})

Properties ​

PropertyTypeDescription
nameString
descriptionString

McpServerToolListing ​

Constructor ​

dart
const McpServerToolListing({
    required this.id,
    required this.status,
    this.tools = const [],
    this.error,
  })

Properties ​

PropertyTypeDescription
idString
statusMcpServerListingStatus
toolsList<McpToolEntry>
errorString?

Functions ​

`String formatMcpToolsByServer( ​

Iterable<McpServerToolListing> servers, { bool? ansiEnabled, })`

McpServerToolListing listingFromSnapshot(McpServerSnapshot s) ​

Project an [McpServerSnapshot] into the simple value object the formatter takes. Keeps the pool's runtime types out of the formatter.

Released under the MIT License.