一键导入
mcp-strict-param-rejection
Strict unknown-parameter rejection for MCP tools: Stage A (UnmappedMemberHandling.Disallow) + Stage B (did-you-mean CallToolFilter).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Strict unknown-parameter rejection for MCP tools: Stage A (UnmappedMemberHandling.Disallow) + Stage B (did-you-mean CallToolFilter).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
{what this skill teaches agents}
Query .NET APIs across NuGet packages, platform libraries, and local files. Search for types, list API surfaces, compare versions, find extension methods and implementors. Use whenever you need to answer questions about .NET library contents.
Query Maestro/BAR dependency flow data using the mstro CLI tool via bash. USE FOR: subscription health checks, build flow tracing, codeflow status, channel discovery, triggering subscription updates — when MCP tools aren't loaded or when scripting with JSON output and jq. Also use when investigating "is this subscription stale", "what's the latest build", "check backflow status". DO NOT USE FOR: tasks where maestro MCP tools are already available in context (prefer flow-analysis or flow-tracing skills when MCP server is loaded). INVOKES: bash (mstro CLI commands with --json output).
| name | mcp-strict-param-rejection |
| description | Strict unknown-parameter rejection for MCP tools: Stage A (UnmappedMemberHandling.Disallow) + Stage B (did-you-mean CallToolFilter). |
| domain | mcp-binding |
| confidence | high |
| source | earned |
Use when adding strict unknown-parameter rejection so callers receive a structured McpException instead of silent data loss when they pass a hallucinated or misspelled parameter name.
Two complementary layers — deploy both for best UX + safety:
UnmappedMemberHandling.Disallow (stopgap; no hints)AddUnknownParameterFilter CallToolFilter (polished UX with "did you mean" hints)Microsoft.Extensions.AI.Abstractions 10.5.2 (shipped with MCP 1.3.0+) includes a strict check in ReflectionAIFunction.InvokeCoreAsync:
if (SerializerOptions.UnmappedMemberHandling == Disallow && !HasCustomParameterBinding)
throw ArgumentException(paramName: "arguments",
message: "The arguments dictionary contains an unexpected key 'X' that does not correspond to any parameter of 'Y'.");
Pass a JsonSerializerOptions with UnmappedMemberHandling = Disallow and TypeInfoResolver = new DefaultJsonTypeInfoResolver() to WithToolsFromAssembly:
using System.Text.Json.Serialization.Metadata;
.WithToolsFromAssembly(typeof(MaestroMcpTools).Assembly, new JsonSerializerOptions
{
UnmappedMemberHandling = JsonUnmappedMemberHandling.Disallow,
TypeInfoResolver = new DefaultJsonTypeInfoResolver(), // ← required companion
})
Apply to both HTTP and stdio transport registrations if both are used.
TypeInfoResolver is requiredThe SDK calls MakeReadOnly() on the passed JsonSerializerOptions before schema generation. Setting any property on already-read-only options throws InvalidOperationException.
Fix: Always set TypeInfoResolver = new DefaultJsonTypeInfoResolver() upfront, before MakeReadOnly() is called.
AddUnknownParameterFilter (Polished UX)Runs as a CallToolFilter before SDK dispatch. Computes unknowns = argKeys − canonicalParams.
On non-empty unknowns, throws a structured McpException with "did you mean" hints:
Unknown parameter 'chanelId' for tool 'maestro_channel'.
Did you mean: channelId?
Allowed parameters: channelId, noCache.
options.AddBindingErrorFilter(); // 1. exception wrap
options.AddUnknownParameterFilter(asm); // 2. did-you-mean check (Stage B)
// SDK dispatch with Disallow runs next // 3. safety net (Stage A)
Threshold: 6. Catches both typos and hallucinated compound names (e.g. subscriptionFilter → sourceRepoFilter).
Keep UnmappedMemberHandling.Disallow alongside Stage B. Defense-in-depth: Stage B fires first with better UX; Stage A catches schema-extraction failures.
src/MaestroTool.Core/MaestroMcpTools/McpServerOptionsExtensions.cs — AddBindingErrorFilter, AddUnknownParameterFilter, Levenshtein helpersrc/MaestroTool.Mcp/Program.cs — WithToolsFromAssembly with serializer options (HTTP) + both filter registrationssrc/MaestroTool/Program.cs — same for stdio transportsrc/MaestroTool.Tests/McpServerOptionsExtensionsTests.cs — binding-error and unknown-param tests