Skip to content
    ↑↓ select↵ openesc close
    English中文
    EmilioEsposito

    Strip Empty Params

    v0.1.1MCP Integrations
    opencode-strip-empty-params-plugin

    Strips empty-string values from non-required MCP tool-call arguments before the call reaches the server. Fixes LLM function-calling quirks where models emit every optional key with an empty default.

    GitHub stars

    0

    Monthly installs

    410

    10 in 7 days

    Composite scoreSCORE

    32.6

    Multi-signal model

    Last commit

    2 months ago

    2026-06-12

    Install and configure

    opencode.json

    Writes to this project's opencode.json — applies to this repository only.

    opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["opencode-strip-empty-params-plugin@0.1.1"]
    }

    opencode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.

    npm version npm downloads license GitHub

    An opencode plugin that strips empty-string values from non-required MCP tool-call arguments before the call reaches the server.

    Problem

    Some LLMs (notably OpenAI GPT-family models) always emit every JSON key defined in a tool's input schema, filling optional parameters with empty strings, zeros, or false even when no value was intended.

    Several MCP servers treat "" differently from an absent key. For example, Slack's MCP server returns zero results when cursor: "" is passed, even though omitting cursor entirely works correctly. This makes the same MCP tool work with one model family and silently fail with another.

    How it works

    The plugin hooks tool.execute.before and, for each MCP tool call, removes any argument whose value is "" and whose key is not in the tool schema's required array.

    Required parameters are never touched so genuine validation errors still surface.

    Installation

    # in opencode.json
    
    {
      "plugin": [
        "opencode-strip-empty-params-plugin"
        // or with options:
        // ["opencode-strip-empty-params-plugin", { "scope": "all", "verbose": true }]
      ]
    }
    

    Options

    Option Type Default Description
    scope "mcp" | "all" "mcp" Which tools to apply to
    verbose boolean false Log each stripped key to stderr for debugging

    Links

    Publishing

    This package publishes through GitHub Actions trusted publishing from .github/workflows/publish.yml.

    For maintainer release steps and verification, use:

    • .claude/skills/publish-package/SKILL.md

    License

    MIT