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
Copy file name to clipboardExpand all lines: docs/docs/features/mcp-server.mdx
+14-4Lines changed: 14 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -206,15 +206,25 @@ Parameters:
206
206
|`perPage`| no | Results per page for pagination (min 1, max 100, default: 50). |
207
207
208
208
209
+
### `list_language_models`
210
+
211
+
Lists the available language models configured on the Sourcebot instance. Use this to discover which models can be specified when calling `ask_codebase`.
212
+
213
+
Parameters:
214
+
215
+
This tool takes no parameters.
216
+
217
+
209
218
### `ask_codebase`
210
219
211
220
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. Returns a detailed answer in markdown format with code references, plus a link to view the full research session in the Sourcebot web UI.
|`query`| yes | The query to ask about the codebase. |
226
+
|`repos`| no | The repositories that are accessible to the agent during the chat. If not provided, all repositories are accessible. |
227
+
|`languageModel`| no | The language model to use for answering the question. Object with `provider` and `model`. If not provided, defaults to the first model in the config. Use `list_language_models` to see available options. |
Copy file name to clipboardExpand all lines: packages/mcp/README.md
+16-4Lines changed: 16 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -234,17 +234,29 @@ Get a list of commits for a given repository.
234
234
235
235
</details>
236
236
237
+
### list_language_models
238
+
239
+
Lists the available language models configured on the Sourcebot instance. Use this to discover which models can be specified when calling `ask_codebase`.
240
+
241
+
<details>
242
+
<summary>Parameters</summary>
243
+
244
+
This tool takes no parameters.
245
+
246
+
</details>
247
+
237
248
### ask_codebase
238
249
239
250
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. Returns a detailed answer in markdown format with code references, plus a link to view the full research session in the Sourcebot web UI.
| `query` | yes | The query to ask about the codebase. |
258
+
| `repos` | no | The repositories that are accessible to the agent during the chat. If not provided, all repositories are accessible. |
259
+
| `languageModel` | no | The language model to use for answering the question. Object with `provider` and `model`. If not provided, defaults to the first model in the config. Use `list_language_models` to see available options. |
dedent`Lists the available language models configured on the Sourcebot instance. Use this to discover which models can be specified when calling ask_codebase.`,
244
+
{},
245
+
async()=>{
246
+
constmodels=awaitlistLanguageModels();
247
+
248
+
return{
249
+
content: [{
250
+
type: "text",
251
+
text: JSON.stringify(models),
252
+
}],
253
+
};
254
+
}
255
+
);
256
+
241
257
server.tool(
242
258
"ask_codebase",
243
259
dedent`
@@ -262,6 +278,7 @@ server.tool(
262
278
263
279
---
264
280
**View full research session:** ${response.chatUrl}
.describe("The repositories that are accessible to the agent during the chat. If not provided, all repositories are accessible."),
292
+
languageModel: languageModelInfoSchema
293
+
.omit({displayName: true})
294
+
.optional()
295
+
.describe("The language model to use for answering the question. If not provided, defaults to the first model in the config. Use list_language_models to see available options."),
message: "No language models are configured. Please configure at least one language model.",
77
+
message: "No language models are configured. Please configure at least one language model. See: https://docs.sourcebot.dev/docs/configuration/language-model-providers",
74
78
}satisfiesServiceError;
75
79
}
76
80
77
-
// @todo: we should probably have a option of passing the language model
78
-
// into the request body. For now, just use the first configured model.
79
-
constlanguageModelConfig=configuredModels[0];
81
+
// Use the requested language model if provided, otherwise default to the first configured model
0 commit comments