π The fast, Pythonic way to build MCP servers and clients.
Add a new martian
William Eastonea81cfd08bf1
diff --git a/.github/workflows/marvin-issue-triage.yml b/.github/workflows/marvin-issue-triage.ymlnew file mode 100644index 000000000..4a3da4de3--- /dev/null+++ b/.github/workflows/marvin-issue-triage.yml@@ -0,0 +1,138 @@+name: The Martian Issue Triage++on:+ issues:+ types: [opened]+ workflow_dispatch:+ inputs:+ issue_number:+ description: "Issue to triage"+ required: true+ type: string++concurrency:+ group: triage-issue-${{ github.event.issue.number || inputs.issue_number }}+ cancel-in-progress: true++jobs:+ marvin-issue-triage:+ runs-on: ubuntu-latest+ timeout-minutes: 10+ permissions:+ contents: read+ issues: write+ pull-requests: read+ id-token: write++ steps:+ - name: Checkout base repository+ uses: actions/checkout@v5+ with:+ repository: ${{ github.repository }}+ ref: ${{ github.event.repository.default_branch }}++ - name: Generate Marvin App token+ id: marvin-token+ uses: actions/create-github-app-token@v2+ with:+ app-id: ${{ secrets.MARVIN_APP_ID }}+ private-key: ${{ secrets.MARVIN_APP_PRIVATE_KEY }}++ - name: Set triage prompt+ id: triage-prompt+ run: |+ cat >> $GITHUB_OUTPUT << 'EOF'+ PROMPT<<PROMPT_END+ You're an issue triage assistant for FastMCP, a Python framework for building Model Context Protocol servers and clients.++ Your triage process is broke up into 2 steps:++ # Lay of the land+ 1. Call the generate_agents_md tool to get a high-level summary of the project you're working in+ 2. Get the issue ${{ github.event.issue.number || inputs.issue_number }} in the GitHub repository: ${{ github.repository }}.+ 3. Use the issue and pull request search tools to scour the repository for related issues and pull requests+ 3. Call the code-search, get_files, etc. tools to search the repository to identify the related classes, methods, tests, etc that are relevant to the issue.++ # Recommendations+ Once you have enough background, you will thoroughly review the issue and you will outline a single high-quality recommendation for how to resolve the issue that is deeply rooted in the codebase, conventions, and best practices. If you do not have a high quality recommendation, you will share your findings and indicate why you don't have a recommendation.++ # Example Output++ The Calculator.divide method on the main branch of jlowin/fastmcp currently raises a ValueError with the message "Division by zero" when the divisor is 0. This behavior aligns with the "Actual Behavior" described in your bug report.++ While raising a ValueError is a standard way to handle invalid input in Python, the suggestion of handling division by zero "gracefully with a clear error message" is a valid improvement. A more specific exception type would allow consumers of the calculator API to differentiate between various types of ValueErrors.++ We have identified an open pull request, #654, titled "Fix division by zero handling." This pull request introduces a custom DivisionByZeroError and a safe_divide function, which aligns with your desired "Expected Behavior." However, an inconsistency was found in the fix/division-by-zero branch associated with this pull request: the Calculator.divide method itself has not been updated to utilize the new DivisionByZeroError or the safe_divide function, and still raises a generic ValueError.++ Next Steps:+ It is recommended to update the existing pull request #654 to fully integrate the DivisionByZeroError and safe_divide function into the Calculator.divide method. This would ensure that the calculator consistently raises the more specific error, fulfilling the goal of graceful error handling with a clear message.++ #### Related Issues and Pull Requests++ | Repository | Issue or PR | Title | Confidence |+ | --- | --- | --- | --- |+ | jlowin/fastmcp | [Add matrix operations support](https://github.com/jlowin/fastmcp/pull/680) | Add matrix operations support | [High β](## "This pull request directly addresses the feature request for adding matrix operations to the calculator.") |+ | jlowin/fastmcp | [Add matrix operations support](https://github.com/jlowin/fastmcp/issues/681) | Add matrix operations support | [High β](## "This issue directly addresses the feature request for adding matrix operations to the calculator.") |++ #### Related Files++ | Repository | File | Confidence | Sections |+ | --- | --- | --- | --- |+ | modelcontextprotocol/python-sdk | [test_calculator.py](https://github.com/modelcontextprotocol/python-sdk/blob/main/test_calculator.py) | [High β](## "This file contains the test cases for the Calculator class, including a test that specifically asserts a ValueError is raised for division by zero, confirming the current intended behavior.") | [25-27](https://github.com/modelcontextprotocol/python-sdk/blob/main/test_calculator.py#L25-27) |+ | modelcontextprotocol/python-sdk | [calculator.py](https://github.com/modelcontextprotocol/python-sdk/blob/main/calculator.py) | [High β](## "This file contains the implementation of the Calculator class, specifically the `divide` method which raises the ValueError when dividing by zero, matching the bug report.") | [29-32](https://github.com/modelcontextprotocol/python-sdk/blob/main/calculator.py#L29-32) |++ #### Related Webpages++ | Name | URL | Confidence |+ | --- | --- | --- |+ | Handling Division by Zero Best Practices | https://my-blog-about-division-by-zero.com/handling+division+by+zero+in+calculator | [High β](## "This webpage provides general best practices for handling division by zero in calculator applications and in Python, which is directly relevant to the issue and potential solutions.") |++ IMPORTANT: You will not make branches or pull requests. Your ONLY action will be investigating the issue, locating related issues,+ pull requests, and files in the repository and reporting your findings.++ PROMPT_END+ EOF++ - name: Setup GitHub MCP Server+ run: |+ mkdir -p /tmp/mcp-config+ cat > /tmp/mcp-config/mcp-servers.json << 'EOF'+ {+ "mcpServers": {+ "repository-summary": {+ "type": "http",+ "url": "https://agents-md-generator.fastmcp.app/mcp"+ },+ "code-search": {+ "type": "http",+ "url": "https://github-code-search.fastmcp.app/mcp"+ },+ "github-research": {+ "command": "uvx",+ "args": [+ "github-research-mcp"+ ],+ "env": {+ "DISABLE_SUMMARIES": true,+ "GITHUB_PERSONAL_ACCESS_TOKEN": "${{ steps.marvin-token.outputs.token }}"+ }+ }+ }+ }+ EOF++ - name: Run Marvin for Issue Triage+ uses: anthropics/claude-code-action@v1+ with:+ github_token: ${{ steps.marvin-token.outputs.token }}+ bot_name: "Marvin Context Protocol"+ prompt: ${{ steps.triage-prompt.outputs.PROMPT }}+ anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY_FOR_CI }}+ claude_args: |+ --model claude-sonnet-4-5-20250929+ --allowedTools WebSearch,WebFetch,mcp__repository-summary,mcp__code-search,mcp__github-research+ --mcp-config /tmp/mcp-config/mcp-servers.json+ settings: |+ {+ "GH_TOKEN": "${{ steps.marvin-token.outputs.token }}"+ }