Title: [FR] Add timeframe/temporal query parameters to MCP tools for trend analysis · Issue #511 · sourcebot-dev/sourcebot · GitHub
Open Graph Title: [FR] Add timeframe/temporal query parameters to MCP tools for trend analysis · Issue #511 · sourcebot-dev/sourcebot
X Title: [FR] Add timeframe/temporal query parameters to MCP tools for trend analysis · Issue #511 · sourcebot-dev/sourcebot
Description: Problem Statement Currently, Sourcebot's MCP tools (search_code, list_repos, get_file_source) only provide access to the current state of the codebase. This limitation prevents AI language models from performing meaningful temporal analy...
Open Graph Description: Problem Statement Currently, Sourcebot's MCP tools (search_code, list_repos, get_file_source) only provide access to the current state of the codebase. This limitation prevents AI language models f...
X Description: Problem Statement Currently, Sourcebot's MCP tools (search_code, list_repos, get_file_source) only provide access to the current state of the codebase. This limitation prevents AI language mode...
Opengraph URL: https://github.com/sourcebot-dev/sourcebot/issues/511
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[FR] Add timeframe/temporal query parameters to MCP tools for trend analysis","articleBody":"## Problem Statement\n\nCurrently, Sourcebot's MCP tools (`search_code`, `list_repos`, `get_file_source`) only provide access to the current state of the codebase. This limitation prevents AI language models from performing meaningful temporal analysis, trend reporting, or historical insights when using the Sourcebot MCP server.\n\n## Use Case\n\nWhen LLMs attempt to analyze code evolution, track changes over time, or provide trend analysis, they are unable to do so effectively because the MCP tools lack timeframe filtering capabilities. This results in responses like \"I cannot analyze trends over time with the available tools\" or incomplete analysis based only on current code state.\n\n### Real-World Examples:\n- **Trend Analysis**: \"Show me how the usage of async/await has evolved in our codebase over the last year\"\n- **Historical Search**: \"Find all instances where deprecated function X was removed between March and June\"\n- **Evolution Tracking**: \"Compare the error handling patterns used 6 months ago vs today\"\n- **Regression Analysis**: \"Identify when specific security patterns were introduced across repositories\"\n\n## Proposed Solution\n\nAdd temporal/timeframe parameters to existing MCP tools to enable time-based querying:\n\n### Enhanced `search_code` Tool\nAdd optional parameters:\n```typescript\n{\n since?: string; // ISO date string (e.g., \"2024-01-01\")\n until?: string; // ISO date string (e.g., \"2024-12-31\")\n dateRange?: string; // Relative range (e.g., \"last-3-months\", \"last-year\")\n gitRevision?: string; // Specific commit/tag/branch\n compareRevisions?: { // Compare between two points in time\n from: string;\n to: string;\n };\n includeDeletedFiles?: boolean; // Include files that were deleted in timeframe\n}\n```\n\n### Enhanced `list_repos` Tool\nAdd repository filtering by activity timeframe:\n```typescript\n{\n activeAfter?: string; // Only repos with commits after this date\n activeBefore?: string; // Only repos with commits before this date\n}\n```\n\n### New `search_commits` Tool\n```typescript\n{\n query: string; // Search in commit messages, authors, changes\n since?: string;\n until?: string;\n author?: string;\n repository?: string[];\n}\n```\n\n## Technical Implementation Considerations\n\n1. **Git Integration**: Leverage git log with `--since`, `--until`, `--author` flags\n2. **Zoekt Enhancement**: Extend Zoekt indexing to include commit metadata and timestamps\n3. **API Compatibility**: Maintain backward compatibility by making all new parameters optional\n4. **Performance**: Consider caching mechanisms for frequently requested time ranges\n5. **Date Formats**: Support both absolute (ISO 8601) and relative dates (\"1 week ago\", \"last month\")\n\n## Benefits\n\n- **Enhanced AI Analysis**: Enable LLMs to provide comprehensive temporal insights and trend analysis\n- **Historical Context**: Allow developers to understand code evolution and decision history\n- **Compliance \u0026 Auditing**: Support regulatory requirements for tracking code changes over time\n- **Research Capabilities**: Enable academic and organizational research on codebase evolution\n- **Debugging**: Help identify when bugs or issues were introduced\n\n## Related Issues\n\nThis request complements issue #22 \"FR: Ability to query for configuration in repositories over time\" but focuses specifically on enhancing the MCP interface for broader temporal querying capabilities.\n\n## Community Impact\n\nThis feature would make Sourcebot's MCP integration significantly more powerful for AI-assisted development workflows, positioning it as a leader in temporal code analysis capabilities. Many organizations need this functionality for compliance, research, and advanced AI-powered insights.\n\n## Alternative Approaches Considered\n\n1. **Client-side Git Integration**: Less efficient and requires additional tooling\n2. **Separate Temporal API**: Would fragment the interface and require additional complexity\n3. **External Time-series Database**: Overkill for this use case and adds infrastructure complexity\n\nThe proposed approach of enhancing existing MCP tools provides the most seamless integration with current workflows while enabling powerful new capabilities.","author":{"url":"https://github.com/waynesun09","@type":"Person","name":"waynesun09"},"datePublished":"2025-09-17T16:53:11.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/511/sourcebot/issues/511"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0d2db1ee-2621-19af-e769-5d65abbed206 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B48E:310BDB:338BF2F:470611A:6A4F323A |
| html-safe-nonce | 2aba1ed8910cc049e18bf294b8a8f41d60cf0e79d0f7882de1a3f137a5654b10 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDhFOjMxMEJEQjozMzhCRjJGOjQ3MDYxMUE6NkE0RjMyM0EiLCJ2aXNpdG9yX2lkIjoiNjk3MDUyNzcwMTc5MTYxNzU5NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 140053e3943ff60bc19432868aff6ad9c5738611dfc7fbcb9a005825ce78317b |
| hovercard-subject-tag | issue:3427075313 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/sourcebot-dev/sourcebot/511/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6048f1ee67f99a1edc748861efff57bda822f235ad9d2990856136cd91ca9fcd/sourcebot-dev/sourcebot/issues/511 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6048f1ee67f99a1edc748861efff57bda822f235ad9d2990856136cd91ca9fcd/sourcebot-dev/sourcebot/issues/511 |
| og:image:alt | Problem Statement Currently, Sourcebot's MCP tools (search_code, list_repos, get_file_source) only provide access to the current state of the codebase. This limitation prevents AI language models f... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | waynesun09 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| go-import | github.com/sourcebot-dev/sourcebot git https://github.com/sourcebot-dev/sourcebot.git |
| octolytics-dimension-user_id | 135396723 |
| octolytics-dimension-user_login | sourcebot-dev |
| octolytics-dimension-repository_id | 846729675 |
| octolytics-dimension-repository_nwo | sourcebot-dev/sourcebot |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 846729675 |
| octolytics-dimension-repository_network_root_nwo | sourcebot-dev/sourcebot |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b8f23afb982271f1b22258a94aede67a6b77760 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width