buildMCPEmptyNote returns the system-prompt note shown to the model when MCP is configured but no tool is usable yet — either still starting or every server failed to start. Returns empty string when no server is configured at all (so callers can append unconditionally).
(statuses []mcp.ServerStatus)
| 3197 | // starting or every server failed to start. Returns empty string when |
| 3198 | // no server is configured at all (so callers can append unconditionally). |
| 3199 | func buildMCPEmptyNote(statuses []mcp.ServerStatus) string { |
| 3200 | if len(statuses) == 0 { |
| 3201 | return "" |
| 3202 | } |
| 3203 | for _, s := range statuses { |
| 3204 | if s.Starting { |
| 3205 | return i18n.T("agent.mcp.note_starting") + "\n" |
| 3206 | } |
| 3207 | } |
| 3208 | return i18n.T("agent.mcp.note_unavailable") + "\n" |
| 3209 | } |
| 3210 | |
| 3211 | // mcpToolHasRequiredParams reports whether a JSON schema declares any |
| 3212 | // required input parameter. Used to distinguish a tool that legitimately |