Skip to content

Commit 50ec08f

Browse files
authored
Switching to normalized path to fix MCP fetch (#2)
1 parent fcbf48f commit 50ec08f

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/lib/mcp.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ export function createMcpServer() {
2727
const normalizedPath = normalizeDocumentationPath(decodedPath)
2828
const appleUrl = generateAppleDocUrl(normalizedPath)
2929

30-
const documentationPath = `/documentation/${decodedPath}`
31-
const jsonData = await fetchJSONData(documentationPath)
30+
const jsonData = await fetchJSONData(normalizedPath)
3231
const markdown = await renderFromJSON(jsonData, appleUrl)
3332

3433
if (!markdown || markdown.trim().length < 100) {
@@ -188,8 +187,7 @@ export function createMcpServer() {
188187
const normalizedPath = normalizeDocumentationPath(path)
189188
const appleUrl = generateAppleDocUrl(normalizedPath)
190189

191-
const documentationPath = `/documentation/${path}`
192-
const jsonData = await fetchJSONData(documentationPath)
190+
const jsonData = await fetchJSONData(normalizedPath)
193191
const markdown = await renderFromJSON(jsonData, appleUrl)
194192

195193
if (!markdown || markdown.trim().length < 100) {

0 commit comments

Comments
 (0)