Skip to content

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

Closed

Description

@mgryszko

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.

Activity

  1. github-actions commented on Oct 17, 2025

    @github-actions
    Contributor

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

    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.

  2. rekram1-node commented on Oct 17, 2025

    @rekram1-node
    Contributor

    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

  3. self-assigned this
    on Oct 17, 2025
  4. mgryszko commented on Oct 17, 2025

    @mgryszko
    Author

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

  5. rekram1-node commented on Oct 17, 2025

    @rekram1-node
    Contributor

    what provider are you using? Anthropic directly?

    Lmk which one and i can debug quicker

    normally these issues are with google models

  6. mgryszko commented on Oct 17, 2025

    @mgryszko
    Author

    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"
          }
        }
    
  7. rekram1-node commented on Oct 17, 2025

    @rekram1-node
    Contributor

    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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions