MCPcopy Create free account
hub / github.com/MicrosoftDocs/mcp / formatDoctorText

Function formatDoctorText

cli/src/utils/text.ts:7–29  ·  view source on GitHub ↗
(report: DoctorReport)

Source from the content-addressed store, hash-verified

5}
6
7export function formatDoctorText(report: DoctorReport): string {
8 const lines = [
9 `Overall: ${report.ok ? 'ok' : 'failed'}`,
10 `Runtime: Node ${report.runtime.version} (${report.runtime.supported ? 'supported' : 'unsupported'})`,
11 `Endpoint: ${report.endpoint}`,
12 `Reachability: ${report.reachability.ok ? 'ok' : 'failed'} (${report.reachability.detail})`,
13 `MCP connect: ${report.mcp.connected ? 'ok' : 'failed'}`,
14 `Tool discovery: ${report.mcp.discovered ? 'ok' : 'failed'}`,
15 'Mapped tools:',
16 ` search: ${report.tools.docsSearch ?? 'missing'}`,
17 ` fetch: ${report.tools.docsFetch ?? 'missing'}`,
18 ` code-search: ${report.tools.codeSearch ?? 'missing'}`,
19 ];
20
21 if (report.errors.length > 0) {
22 lines.push('Errors:');
23 for (const error of report.errors) {
24 lines.push(` - ${error}`);
25 }
26 }
27
28 return ensureTrailingNewline(lines.join('\n'));
29}

Callers 1

registerDoctorCommandFunction · 0.85

Calls 1

ensureTrailingNewlineFunction · 0.85

Tested by

no test coverage detected