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
.describe(`The git revision to search in (e.g., 'main', 'HEAD', 'v1.0.0', 'a1b2c3d'). If not provided, defaults to the default branch (usually 'main' or 'master').`)
55
55
.optional(),
56
-
since: z
57
-
.string()
58
-
.describe(`Filter repositories by when they were last indexed by Sourcebot (NOT by commit time). Only searches in repos indexed after this date. Supports ISO 8601 (e.g., '2024-01-01') or relative formats (e.g., '30 days ago', 'last week', 'yesterday').`)
59
-
.optional(),
60
-
until: z
61
-
.string()
62
-
.describe(`Filter repositories by when they were last indexed by Sourcebot (NOT by commit time). Only searches in repos indexed before this date. Supports ISO 8601 (e.g., '2024-12-31') or relative formats (e.g., 'yesterday').`)
63
-
.optional(),
64
56
maxTokens: numberSchema
65
57
.describe(`The maximum number of tokens to return (default: ${env.DEFAULT_MINIMUM_TOKENS}). Higher values provide more context but consume more tokens. Values less than ${env.DEFAULT_MINIMUM_TOKENS} will be ignored.`)
query+=` ( repo:${repoIds.map(id=>escapeStringRegexp(id)).join(' or repo:')} )`;
@@ -85,16 +75,17 @@ server.tool(
85
75
query+=` ( lang:${languages.join(' or lang:')} )`;
86
76
}
87
77
78
+
if(gitRevision){
79
+
query+=` ( rev:${gitRevision} )`;
80
+
}
81
+
88
82
constresponse=awaitsearch({
89
83
query,
90
84
matches: env.DEFAULT_MATCHES,
91
85
contextLines: env.DEFAULT_CONTEXT_LINES,
92
86
isRegexEnabled: true,
93
87
isCaseSensitivityEnabled: caseSensitive,
94
88
source: 'mcp',
95
-
gitRevision,
96
-
since,
97
-
until,
98
89
});
99
90
100
91
if(isServiceError(response)){
@@ -182,21 +173,9 @@ server.tool(
182
173
183
174
server.tool(
184
175
"search_commits",
185
-
`Searches for commits in a specific repository based on actual commit time (NOT index time).
186
-
187
-
**Requirements**: The repository must be cloned on the Sourcebot server disk. Sourcebot automatically clones repositories during indexing, but the cloning process may not be finished when this query is executed. If the repository is not found on the server disk, an error will be returned asking you to try again later.
188
-
189
-
**Date Formats**: Supports ISO 8601 (e.g., "2024-01-01") or relative formats (e.g., "30 days ago", "last week", "yesterday").
190
-
191
-
**YOU MUST** call 'list_repos' first to obtain the exact repository ID.
192
-
193
-
If you receive an error that indicates that you're not authenticated, please inform the user to set the SOURCEBOT_API_KEY environment variable.`,
176
+
`Searches for commits in a specific repository based on actual commit time. If you receive an error that indicates that you're not authenticated, please inform the user to set the SOURCEBOT_API_KEY environment variable.`,
194
177
{
195
-
repoId: z.union([z.number(),z.string()]).describe(`Repository identifier. Can be either:
196
-
- Numeric database ID (e.g., 123)
197
-
- Full repository name (e.g., "github.com/owner/repo") as returned by 'list_repos'
198
-
199
-
**YOU MUST** call 'list_repos' first to obtain the repository identifier.`),
178
+
repoId: z.string().describe(`The repository to search commits in. This is the Sourcebot compatible repository ID as returned by 'list_repos'.`),
200
179
query: z.string().describe(`Search query to filter commits by message content (case-insensitive).`).optional(),
201
180
since: z.string().describe(`Show commits more recent than this date. Filters by actual commit time. Supports ISO 8601 (e.g., '2024-01-01') or relative formats (e.g., '30 days ago', 'last week').`).optional(),
202
181
until: z.string().describe(`Show commits older than this date. Filters by actual commit time. Supports ISO 8601 (e.g., '2024-12-31') or relative formats (e.g., 'yesterday').`).optional(),
`Lists repositories in the organization with optional filtering and pagination.
232
-
233
-
**Temporal Filtering**: When using 'activeAfter' or 'activeBefore', only repositories indexed within the specified timeframe are returned. This filters by when Sourcebot last indexed the repository (indexedAt), NOT by git commit dates. For commit-time filtering, use 'search_commits'. When temporal filters are applied, the output includes a 'lastIndexed' field showing when each repository was last indexed.
234
-
235
-
**Date Formats**: Supports ISO 8601 (e.g., "2024-01-01") and relative dates (e.g., "30 days ago", "last week", "yesterday").
236
-
237
-
If you receive an error that indicates that you're not authenticated, please inform the user to set the SOURCEBOT_API_KEY environment variable.`,
238
-
{
239
-
query: z
240
-
.string()
241
-
.describe("Filter repositories by name (case-insensitive).")
242
-
.optional(),
243
-
pageNumber: z
244
-
.number()
245
-
.int()
246
-
.positive()
247
-
.describe("Page number (1-indexed, default: 1)")
248
-
.default(1),
249
-
limit: z
250
-
.number()
251
-
.int()
252
-
.positive()
253
-
.describe("Number of repositories per page (default: 50)")
254
-
.default(50),
255
-
activeAfter: z
256
-
.string()
257
-
.describe("Only return repositories indexed after this date (filters by indexedAt). Supports ISO 8601 (e.g., '2024-01-01') or relative formats (e.g., '30 days ago', 'last week').")
258
-
.optional(),
259
-
activeBefore: z
260
-
.string()
261
-
.describe("Only return repositories indexed before this date (filters by indexedAt). Supports ISO 8601 (e.g., '2024-12-31') or relative formats (e.g., 'yesterday').")
`Lists repositories in the organization with optional filtering and pagination. If you receive an error that indicates that you're not authenticated, please inform the user to set the SOURCEBOT_API_KEY environment variable.`,
whole: z.boolean().optional(),// Whether to return the whole file as part of the response.
28
28
isRegexEnabled: z.boolean().optional(),// Whether to enable regular expression search.
29
29
isCaseSensitivityEnabled: z.boolean().optional(),// Whether to enable case sensitivity.
30
-
gitRevision: z.string().optional(),// Filter by git branch/revision.
31
-
since: z.string().optional(),// Filter repositories by indexed date (start). Filters by when the repo was last indexed by Sourcebot, not by commit time.
32
-
until: z.string().optional(),// Filter repositories by indexed date (end). Filters by when the repo was last indexed by Sourcebot, not by commit time.
0 commit comments