MCPcopy Create free account
hub / github.com/echoVic/blade-code / sanitizeParameters

Method sanitizeParameters

src/tools/validator.ts:117–130  ·  view source on GitHub ↗

* 清理参数(移除未定义的参数)

(
    parameters: Record<string, any>,
    schema: Record<string, ToolParameterSchema>
  )

Source from the content-addressed store, hash-verified

115 * 清理参数(移除未定义的参数)
116 */
117 public static sanitizeParameters(
118 parameters: Record<string, any>,
119 schema: Record<string, ToolParameterSchema>
120 ): Record<string, any> {
121 const result: Record<string, any> = {};
122
123 for (const [key, value] of Object.entries(parameters)) {
124 if (key in schema && value !== undefined) {
125 result[key] = value;
126 }
127 }
128
129 return result;
130 }
131
132 /**
133 * 生成参数文档

Callers 1

callToolMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected