You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(mcp): hide ask_codebase tool when no LLM providers configured
- Modified web MCP server to check configured language models before
registering the ask_codebase tool
- Made createMcpServer() async to support awaiting the config check
- Updated standalone MCP package to check /api/models before registering
ask_codebase tool
- Tool is now only visible when at least one language model is configured
Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
Searches for code that matches the provided search query as a substring by default, or as a regular expression if useRegex is true. Useful for exploring remote repositories by searching for exact symbols, functions, variables, or specific code patterns. To determine if a repository is indexed, use the \`list_repos\` tool. By default, searches are global and will search the default branch of all repositories. Searches can be scoped to specific repositories, languages, and branches. When referencing code outputted by this tool, always include the file's external URL as a link. This makes it easier for the user to view the file, even if they don't have it locally checked out.
@@ -413,46 +407,58 @@ server.tool(
413
407
}
414
408
);
415
409
416
-
server.tool(
417
-
"ask_codebase",
418
-
dedent`
419
-
Ask a natural language question about the codebase. This tool uses an AI agent to autonomously search code, read files, and find symbol references/definitions to answer your question.
410
+
if(hasLanguageModels){
411
+
server.tool(
412
+
"ask_codebase",
413
+
dedent`
414
+
Ask a natural language question about the codebase. This tool uses an AI agent to autonomously search code, read files, and find symbol references/definitions to answer your question.
420
415
421
-
The agent will:
422
-
- Analyze your question and determine what context it needs
423
-
- Search the codebase using multiple strategies (code search, symbol lookup, file reading)
424
-
- Synthesize findings into a comprehensive answer with code references
416
+
The agent will:
417
+
- Analyze your question and determine what context it needs
418
+
- Search the codebase using multiple strategies (code search, symbol lookup, file reading)
419
+
- Synthesize findings into a comprehensive answer with code references
425
420
426
-
Returns a detailed answer in markdown format with code references, plus a link to view the full research session (including all tool calls and reasoning) in the Sourcebot web UI.
421
+
Returns a detailed answer in markdown format with code references, plus a link to view the full research session (including all tool calls and reasoning) in the Sourcebot web UI.
427
422
428
-
When using this in shared environments (e.g., Slack), you can set the visibility parameter to 'PUBLIC' to ensure everyone can access the chat link.
423
+
When using this in shared environments (e.g., Slack), you can set the visibility parameter to 'PUBLIC' to ensure everyone can access the chat link.
429
424
430
-
This is a blocking operation that may take 30-60+ seconds for complex questions as the agent researches the codebase.
431
-
`,
432
-
askCodebaseRequestSchema.shape,
433
-
{readOnlyHint: true},
434
-
async(request: AskCodebaseRequest)=>{
435
-
constresponse=awaitaskCodebase(request);
425
+
This is a blocking operation that may take 30-60+ seconds for complex questions as the agent researches the codebase.
426
+
`,
427
+
askCodebaseRequestSchema.shape,
428
+
{readOnlyHint: true},
429
+
async(request: AskCodebaseRequest)=>{
430
+
constresponse=awaitaskCodebase(request);
436
431
437
-
// Format the response with the answer and a link to the chat
438
-
constformattedResponse=dedent`
439
-
${response.answer}
432
+
// Format the response with the answer and a link to the chat
433
+
constformattedResponse=dedent`
434
+
${response.answer}
440
435
441
-
---
442
-
**View full research session:** ${response.chatUrl}
443
-
**Model used:** ${response.languageModel.model}
444
-
`;
436
+
---
437
+
**View full research session:** ${response.chatUrl}
0 commit comments