Skip to content

Fixing issue where LLM's sometimes choose to pass a json array of model names#19

Open
JKapostins wants to merge 1 commit intodisler:mainfrom
JKapostins:fix/mcp-json-array-parsing-upstream
Open

Fixing issue where LLM's sometimes choose to pass a json array of model names#19
JKapostins wants to merge 1 commit intodisler:mainfrom
JKapostins:fix/mcp-json-array-parsing-upstream

Conversation

@JKapostins
Copy link
Copy Markdown

  • Add parse_json_array_parameter() helper function to handle JSON array parsing
  • Fix issue where LLMs sometimes pass JSON arrays as strings instead of parsed arrays
  • Apply fix to all existing MCP tools with models_prefixed_by_provider parameter:
    • PROMPT
    • PROMPT_FROM_FILE
    • PROMPT_FROM_FILE_TO_FILE
    • CEO_AND_BOARD
  • Gracefully handles both properly parsed arrays and JSON string arrays
  • Prevents errors when LLMs pass ["model1", "model2"] as string instead of array

🤖 Generated with Claude Code

- Add parse_json_array_parameter() helper function to handle JSON array parsing
- Fix issue where LLMs sometimes pass JSON arrays as strings instead of parsed arrays
- Apply fix to all existing MCP tools with models_prefixed_by_provider parameter:
  - PROMPT
  - PROMPT_FROM_FILE
  - PROMPT_FROM_FILE_TO_FILE
  - CEO_AND_BOARD
- Gracefully handles both properly parsed arrays and JSON string arrays
- Prevents errors when LLMs pass ["model1", "model2"] as string instead of array

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <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