Skip to content

Commit 937216e

Browse files
committed
use format function
1 parent 6a23b9c commit 937216e

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

packages/mcp-server/src/mcp/handlers/tools/get-documentation.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { SvelteMcp } from '../../index.js';
22
import * as v from 'valibot';
3-
import { get_sections, fetch_with_timeout } from '../../utils.js';
3+
import { get_sections, fetch_with_timeout, format_sections_list } from '../../utils.js';
44
import { SECTIONS_LIST_INTRO, SECTIONS_LIST_OUTRO } from './prompts.js';
55

66
export function get_documentation(server: SvelteMcp) {
@@ -97,12 +97,7 @@ export function get_documentation(server: SvelteMcp) {
9797
let final_text = results.map((r) => r.content).join('\n\n---\n\n');
9898

9999
if (!has_any_success) {
100-
const formatted_sections = available_sections
101-
.map(
102-
(section) =>
103-
`* title: ${section.title}, use_cases: ${section.use_cases}, path: ${section.url}`,
104-
)
105-
.join('\n');
100+
const formatted_sections = await format_sections_list();
106101

107102
final_text += `\n\n---\n\n${SECTIONS_LIST_INTRO}\n\n${formatted_sections}\n\n${SECTIONS_LIST_OUTRO}`;
108103
}

0 commit comments

Comments
 (0)