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
Problem
The
music_generation()function has its entiretryblock indented one extra level compared to all other tool functions. This is a style inconsistency that suggests a copy-paste error.Exact location
minimax_mcp/server.pymusic_generation()Evidence
Compare with
text_to_audio():Impact
exceptcould mask bugsProposed 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)ruff checkpasses with no indentation warnings