isCSVOutputTool reports whether the given tool should have its handler wrapped to honor the csv_output feature flag. Wrapping happens at slice construction time, before the per-request feature-flag filter chooses which variant of a flag-gated tool to register, so flag-gated list_* tools are included
(tool inventory.ServerTool)
| 62 | // variant of a flag-gated tool to register, so flag-gated list_* tools are |
| 63 | // included on equal footing — only the live variant ever runs at request time. |
| 64 | func isCSVOutputTool(tool inventory.ServerTool) bool { |
| 65 | if !tool.Toolset.Default { |
| 66 | return false |
| 67 | } |
| 68 | return strings.HasPrefix(tool.Tool.Name, "list_") |
| 69 | } |
| 70 | |
| 71 | func wrapHandlerWithCSVOutput(next inventory.HandlerFunc) inventory.HandlerFunc { |
| 72 | return func(deps any) mcp.ToolHandler { |