Slack MCP server request fails with AI_APICallError: tools.11.custom.name: String should match pattern '^[a-zA-Z0-9_-]{1,128}$' #2149

Closed
opened 2026-02-16 17:34:25 -05:00 by yindo · 6 comments
Owner

Originally created by @mgryszko on GitHub (Oct 17, 2025).

Originally assigned to: @rekram1-node on GitHub.

Steps to reproduce:

  • Install Slack MCP server and configure it
  • Simple prompt like Show me latest 10 messages in Slack #foo channel fails with tools.11.custom.name: String should match pattern '^[a-zA-Z0-9_-]{1,128}$'

Claude Desktop can use the same MCP server without any problems.

Originally created by @mgryszko on GitHub (Oct 17, 2025). Originally assigned to: @rekram1-node on GitHub. Steps to reproduce: - Install [Slack MCP](https://github.com/korotovsky/slack-mcp-server/) server and configure it - Simple prompt like `Show me latest 10 messages in Slack #foo channel` fails with `tools.11.custom.name: String should match pattern '^[a-zA-Z0-9_-]{1,128}$'` Claude Desktop can use the same MCP server without any problems.
yindo closed this issue 2026-02-16 17:34:25 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 17, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #441: Invalid Schema errors on Azure OpenAI Models - also deals with tool schema validation errors and naming patterns
  • #650: bug: MCP - Invalid JSON Schema when using Docker MCP Gateway - similar JSON schema validation issues with MCP tools
  • #3140: AI_APICallError: GenerateContentRequest.tools[0].function_declarations[32].parameters. required[0]: property is not defined with Gemini API - similar function declaration validation issues

The error pattern you're seeing (tools.11.custom.name: String should match pattern '^[a-zA-Z0-9_-]{1,128}$') suggests that the Slack MCP server is providing tool names that don't conform to OpenCode's tool name validation pattern. This appears to be a broader issue with how OpenCode validates MCP tool names versus how different MCP servers define their tool names.

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Oct 17, 2025): This issue might be a duplicate of existing issues. Please check: - #441: Invalid Schema errors on Azure OpenAI Models - also deals with tool schema validation errors and naming patterns - #650: bug: MCP - Invalid JSON Schema when using Docker MCP Gateway - similar JSON schema validation issues with MCP tools - #3140: AI_APICallError: GenerateContentRequest.tools[0].function_declarations[32].parameters. required[0]: property is not defined with Gemini API - similar function declaration validation issues The error pattern you're seeing (tools.11.custom.name: String should match pattern '^[a-zA-Z0-9_-]{1,128}$') suggests that the Slack MCP server is providing tool names that don't conform to OpenCode's tool name validation pattern. This appears to be a broader issue with how OpenCode validates MCP tool names versus how different MCP servers define their tool names. Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Oct 17, 2025):

Yeah we need to sanitize mcp server tools, this is because whatever provider you are using doesnt accept the format of the mcp server tools it has. So we need to "sanitize" the fields before sending them to specific providers

@rekram1-node commented on GitHub (Oct 17, 2025): Yeah we need to sanitize mcp server tools, this is because whatever provider you are using doesnt accept the format of the mcp server tools it has. So we need to "sanitize" the fields before sending them to specific providers
Author
Owner

@mgryszko commented on GitHub (Oct 17, 2025):

@rekram1-node will it be addressed in the next Opencode release?

@mgryszko commented on GitHub (Oct 17, 2025): @rekram1-node will it be addressed in the next Opencode release?
Author
Owner

@rekram1-node commented on GitHub (Oct 17, 2025):

what provider are you using? Anthropic directly?

Lmk which one and i can debug quicker

normally these issues are with google models

@rekram1-node commented on GitHub (Oct 17, 2025): what provider are you using? Anthropic directly? Lmk which one and i can debug quicker normally these issues are with google models
Author
Owner

@mgryszko commented on GitHub (Oct 17, 2025):

I was using Claude Sonnet 4.5 from GitHub Copilot.

Here is my opencode.json config for reference:

    "slack": {
      "type": "local",
      "command": ["npx", "-y", "slack-mcp-server@latest", "--transport", "stdio"],
      "environment": {
        "SLACK_MCP_XOXC_TOKEN": "xoxc-xxx",
        "SLACK_MCP_XOXD_TOKEN": "xoxd-xxx"
      }
    }

Claude Desktop configuration (claude_desktop_config):

    "slack": {
      "command": "npx",
      "args": [
        "-y",
        "slack-mcp-server@latest",
        "--transport",
        "stdio"
      ],
      "env": {
        "SLACK_MCP_XOXC_TOKEN": "xoxc-xxx",
        "SLACK_MCP_XOXD_TOKEN": "xoxd-xxx"
      }
    }
@mgryszko commented on GitHub (Oct 17, 2025): I was using Claude Sonnet 4.5 from GitHub Copilot. Here is my `opencode.json` config for reference: ``` "slack": { "type": "local", "command": ["npx", "-y", "slack-mcp-server@latest", "--transport", "stdio"], "environment": { "SLACK_MCP_XOXC_TOKEN": "xoxc-xxx", "SLACK_MCP_XOXD_TOKEN": "xoxd-xxx" } } ``` Claude Desktop configuration (`claude_desktop_config`): ``` "slack": { "command": "npx", "args": [ "-y", "slack-mcp-server@latest", "--transport", "stdio" ], "env": { "SLACK_MCP_XOXC_TOKEN": "xoxc-xxx", "SLACK_MCP_XOXD_TOKEN": "xoxd-xxx" } } ```
Author
Owner

@rekram1-node commented on GitHub (Oct 17, 2025):

Ahh well if you were using anthropic then it should work, I guess we need special sanitization for copilot then.

I need to familiarize myself with their requirements to see but I dont think this is terribly difficult to add

@rekram1-node commented on GitHub (Oct 17, 2025): Ahh well if you were using anthropic then it should work, I guess we need special sanitization for copilot then. I need to familiarize myself with their requirements to see but I dont think this is terribly difficult to add
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2149