Skip to content

fix: MCP humanize tool rendering findings as [object Object]#10

Open
iVibudh wants to merge 1 commit into
brandonwise:mainfrom
iVibudh:main
Open

fix: MCP humanize tool rendering findings as [object Object]#10
iVibudh wants to merge 1 commit into
brandonwise:mainfrom
iVibudh:main

Conversation

@iVibudh
Copy link
Copy Markdown

@iVibudh iVibudh commented May 21, 2026

fix: MCP humanize tool returning [object Object] for all findings

What's broken

The humanize tool in the MCP server renders every finding as [object Object].
Any agent or LLM client calling this tool gets no usable information about what to fix.

Root cause

humanize() returns critical and important as arrays of objects:

{
  pattern: "AI vocabulary",
  text: "delve",
  line: 1,
  suggestion: "Tier 1 AI word: \"delve\". Use a simpler, more specific alternative.",
  confidence: "high"
}

The MCP handler was iterating them as if they were strings:

for (const s of suggestions.critical) {
  output += `- ${s}\n`; // → "- [object Object]"
}

Fix

Format each object into a readable line with line number, pattern name, flagged text, and suggestion:

output += `- L${s.line}: [${s.pattern}] "${s.text}" → ${s.suggestion}\n`;

Before / after

Before:

### 🔴 Critical (Dead giveaways)
- [object Object]
- [object Object]
- [object Object]

After:

### 🔴 Critical (Dead giveaways)
- L1: [AI vocabulary] "delve" → Tier 1 AI word: "delve". Use a simpler, more specific alternative.
- L1: [AI vocabulary] "synergies" → Tier 1 AI word: "synergies". Use a simpler, more specific alternative.
- L1: [Chatbot artifacts] "I hope this helps" → (remove)

Files changed

  • mcp-server/index.js — fixed critical and important loop formatting in the humanize case

critical and important arrays contain objects, not strings. Format each
item with line number, pattern name, flagged text, and suggestion so
agent clients receive actionable output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant