Introduction¶
When integrating tools registered via MCP, built-in tools, or other plugins in DeepSeek Harness (DSH), the tools payload sent to the model often carries JSON Schemas that are “legal elsewhere.” However, when routed through strict validation paths like Google Gemini’s functionDeclarations[].parameters, the entire request may be rejected (HTTP 400), with error messages pointing to specific schema details, making troubleshooting costly.
Modifying schemas solely at the MCP proxy layer only covers the services behind that specific proxy; built-in tools and tools not transmitted via MCP do not pass through that chain. Therefore, unified normalization must occur within the Harness before assembling the toolset and sending model requests to ensure all sources are covered at once. The following section introduces the purpose and integration methods of the community plugin dsh-gemini-tool-schema (Maintainer: ChenXu233, Category: Model Inference).
What is this¶
dsh-gemini-tool-schema is a TypeScript plugin for DSH that sanitizes tool schemas into a strict OpenAPI 3.0 subset acceptable by Gemini function declarations before the model request is dispatched. The README positions it as a fix for Gemini functionDeclarations 400 errors triggered by any MCP or built-in tool, rather than a replacement for a specific MCP implementation.
Common 400 Errors¶
The documentation lists three categories of examples that are “valid in other environments but cause the entire request to fail on the Gemini route”:
| Actual Error | Problematic Schema | Source |
|---|---|---|
schema didn't specify the schema type field |
{ anyOf: [{type:'string',…}, {type:'null'}] }, missing type at the top level |
Playwright MCP browser_emulate_media.colorScheme (z.string().nullable()) |
properties[v_types].items: missing field |
{ type: 'array' }, missing items |
Lingshu MCP lingshu_cg / lingshu_stg (19 parameters) |
properties[permission].enum[3]: cannot be empty |
Contains empty strings in enum |
DSH built-in task_board_update.permission |
Such issues are often only exposed on Gemini-flavored routes, leading to the misconception that a specific MCP is malfunctioning.
Why Hook in the Harness¶
MCP proxies can only handle the server-side services they wrap; built-in tools and tools registered by other plugins do not pass through MCP transmission. Normalizing at the Harness assembly stage is the approach described in the documentation that can cover all tools simultaneously.
Core Capabilities and Normalization Rules¶
The plugin determines whether to rewrite schemas based on configuration during toolset assembly. The normalization rules summarized in the README include:
- Add
typeto every node; additemsto everyarray. - Ensure
enumentries are not empty;constcannot reintroduce empty enums. - Inline
$ref/$defswhile avoiding circularity; strip unsupported keywords and apply an allowlist for other scalars. - Narrow
requiredto properties that actually exist.
Additionally, it supports diagnostics and auditing: dryRun allows reporting and linting without rewriting the schema sent to the model; logFile / logLevel and dumpDir / dumpSchemas are used for offline verification of the toolset seen by the model side.
Installation and Enablement¶
There are two methods, both sourced from the repository README.
Method 1: Mount dist after local build
git clone https://github.com/ChenXu233/dsh-gemini-tool-schema.git
cd dsh-gemini-tool-schema && npm install && npm run build
Append to <DSH home>/profiles/<profile>/cordis.patch.yml:
- insert:
- id: gemini-tool-schema
name: '/absolute/path/to/dsh-gemini-tool-schema/dist/index.js'
config:
mode: list
apis: ['gemini', 'google', 'vertex']
Replace name with the absolute path to dist/index.js on your machine.
Method 2: npm package
npm install dsh-gemini-tool-schema
Mount by package name (the package includes a cordis.patch.yml snippet; refer to the npm package description).
Runtime Environment: package.json requires Node >=20; development testing can run TypeScript tests directly under Node ≥22.6 (the README states there are 36 tests).
Configuration Options¶
| Field | Default Value | Meaning |
|---|---|---|
mode |
list |
all process every request · list match only apis · off disable |
apis |
['gemini','google','vertex'] |
API match patterns, compiled as regex |
unknownApi |
apply |
When route cannot be read: apply or skip |
itemsFallback |
{type:'string'} |
Element schema used for arrays missing items |
nullable |
true |
Output nullable: true for null union types |
dryRun |
false |
Report and lint only, still send original schema |
logFile / logLevel |
None / info |
One line of diagnostics per assembly |
dumpDir / dumpSchemas |
None / true |
Export model-side toolset for offline audit |
apis performs matching against the provider/model string (e.g., gemini-lumiya/gemini-4-argon), supporting substrings, regex, and /pattern/flags; entries that cannot be compiled degrade to case-insensitive substring matching. '*' matches all, or set mode: all.
Use Cases and Notes¶
Suitable for: Using Gemini, Google, or Vertex routes for function calling in DSH where tools come from multiple MCPs, built-in capabilities, or other plugins, requiring the avoidance of entire request 400s caused by schema subset differences.
Notes:
- The plugin runs with the permissions of the current DSH process. Please review the GitHub Source Code and the MIT license before installing or mounting.
- The community directory SkillHub Plugin Page and the GitHub repository are published by the maintainer and have no official affiliation with DeepSeek / High-Flyer; the DSH ecosystem emphasizes “everything is a plugin,” and the directory site is a community index, not an official app store.
- To verify normalization logic without modifying live requests, you can first enable
dryRun: trueand combine it withdumpSchemasto compare tool definitions before and after.
Conclusion¶
dsh-gemini-tool-schema moves the constraint of “the OpenAPI 3.0 subset that Gemini can consume” forward to the Harness assembly stage, using a unified set of rules to handle MCP and built-in tools, reducing broken links caused by functionDeclarations 400s. Refer to the README for integration and configuration details:
- Directory Page: https://www.skillhub.cn/plugins/ChenXu233/dsh-gemini-tool-schema
- Repository: https://github.com/ChenXu233/dsh-gemini-tool-schema