MiniMax-AI / MiniMax-AI/MiniMax-MCP

fix(server): music_generation has inconsistent indentation — try block indented inside function body

Open Beginner friendly
#69 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.6k
Forks
284
PR merge metrics
No merged PRs in 30d

Description

Problem

The music_generation() function has its entire try block indented one extra level compared to all other tool functions. This is a style inconsistency that suggests a copy-paste error.

Exact location

  • File: minimax_mcp/server.py
  • Function: music_generation()

Evidence

def music_generation(...) -> TextContent:
        try:  # <-- extra indentation (8 spaces instead of 4)
            if not prompt:
                raise MinimaxRequestError("Prompt is required.")
            ...
        except MinimaxAPIError as e:
            return TextContent(
                type="text",
                text=f"Failed to generate music: {str(e)}"
            )
        except (IOError, requests.RequestException) as e:
            return TextContent(
                type="text",
                text=f"Failed to save music: {str(e)}"
        )  # <-- closing paren misaligned

Compare with text_to_audio():

def text_to_audio(...):
    if not text:  # <-- correct indentation (4 spaces)
        raise MinimaxRequestError("Text is required.")
    ...

Impact

  • Code works but is confusing to read
  • The misaligned closing paren on the last except could mask bugs
  • Linters (ruff, flake8) would flag this

Proposed solution

Dedent the entire function body by one level to match other functions. Fix the misaligned closing paren.

Acceptance criteria

  • music_generation() body indented at 4 spaces (same as all other functions)
  • All closing parens properly aligned
  • ruff check passes with no indentation warnings

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open minimax_mcp/server.py and inspect the music_generation() function alongside text_to_audio() for the expected indentation style. Run ruff check before and after the formatting change, and confirm the function body and closing parentheses match the stated acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.