Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/mcp/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ server.tool(
(acc, chunk) => acc + chunk.matchRanges.length,
0,
);
let text = `file: ${file.webUrl}\nnum_matches: ${numMatches}\nrepository: ${file.repository}\nlanguage: ${file.language}`;
const fileIdentifier = file.webUrl ?? file.fileName.text;
let text = `file: ${fileIdentifier}\nnum_matches: ${numMatches}\nrepository: ${file.repository}\nlanguage: ${file.language}`;

if (includeCodeSnippets) {
const snippets = file.chunks.map(chunk => {
Expand Down Expand Up @@ -200,9 +201,10 @@ server.tool(

// Format output
const content: TextContent[] = paginated.map(repo => {
const repoUrl = repo.webUrl ?? repo.repoCloneUrl;
return {
type: "text",
text: `id: ${repo.repoName}\nurl: ${repo.webUrl}`,
text: `id: ${repo.repoName}\nurl: ${repoUrl}`,
}
});

Expand Down